Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Fattie · Dec 12, 2011 at 05:55 PM · iosiphoneshadowsgeometryrealtime-shadows

What if you really, truly want real-time shadows on iPhone/iPad?

NOTE -- it looks like Unity4 has realtime shadows on iOS, so this question is now of historic interest only


Unless I'm mistaken or something has changed recently, essentially you cannot use realtime "actual" shadows on mobile - iPhone, iPad. Of course, you can:

  1. bake in some shadows, awesome for static objects ( http://unity3d.com/support/documentation/Manual/Lightmapping.html )

  2. you can use a blob shadow solution (which is a projector ... http://unity3d.com/support/documentation/Components/class-Projector.html ) which is a fantastic solution for implying the sense of a shadow under a moving character or vehicle (particularly useful to help mentally suggest the altitude of the item, if it bounces up and down)

However, in some cases you may need an actual, hard, calculated shadow of a particular object.

(I don't really have a use case example - but you can imagine a game where, say, the shape of the shadow of some key character or element is literally important to game play for some reason.)

The only way I know of to do this is literally "calculate it yourself" and pretend you are a gpu on an ongoing basis. This is of course untidy. It is messy for very regular objects (cubish) and really messy for any complex object.

Perhaps ..

(*) someone already sells some sort of package that solves this problem "So you need shadows on the iPhone..."

(*) there may be some obvious technology in Unity I am too dense to know about?

(*) is there some very simple way to cast shadows do-it-yourself that everyone knows about other than me? at least for, perhaps, overhead beams on to a flat ground? (perhaps an isometric projection of the object shape or something, just guessing?)

Any ideas or info appreciated!

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image citizen12 · May 14, 2012 at 09:20 PM 0
Share

I have tried using the Beast Lightmapping to create baked-in shadows for my iOS game, but I never get any results. The whole terrain dims or lights a bit, but no shadows to speak of. Is there a working example project somewhere that shows off baked in shadows for iOS?

avatar image Tracy-Ma · Jan 02, 2013 at 07:38 AM 0
Share

Can you give a link of how to use Unity4 realtime shadows?

avatar image Dreamora · Jan 02, 2013 at 08:47 AM 0
Share

Nothing special is required. Just use your Unity Pro + iOS Pro license. This allows you to use the normal receive shadow / cast shadow checkboxes to enable and disable shadows. Additionally to that, you need to ensure that you are running on OpenGL ES 2.0 (default in Unity 4) and that the quality settings allow shadows at all

avatar image Fattie · Jan 02, 2013 at 08:57 AM 0
Share

heh @dreamora ... I don't think you noticed this! -->

"NOTE -- it looks like Unity4 has realtime shadows on iOS, so this is now of historic interest only"

For you young people growing up with Unity4, you wouldn't understand the problems of the old days ...

avatar image Dreamora · Jan 02, 2013 at 09:48 AM 0
Share

Indeed, I missed that one as I jumped to the actual content as the question popped up at the top of the list.

And I agree, U4 users are kinda spoiled compared to us Unity iOS 1.0 users were back then ;)

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Eric5h5 · Dec 12, 2011 at 08:46 PM

Shadow volumes.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Dec 12, 2011 at 10:59 PM 0
Share

Ha, that's great :D the alpha channel as stencil buffer ;) I've got to look at the implementation...

+1

avatar image
2

Answer by runonthespot · May 22, 2012 at 08:38 AM

The character shadow on the Unity wiki worked well for me; it's a neat trick involving RenderTexture and a projector (so requires Unity IOS pro unfortunately). Dial down the size of the texture to speed it up (and to taste).

http://www.unifycommunity.com/wiki/index.php?title=Character_Shadow

Results here:

http://www.youtube.com/watch?feature=player_detailpage&list=UUqVR5F6N5rWJ5UZTS6ojIkA&v=GEK5O9jAOOM#t=120s

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · May 22, 2012 at 10:40 AM 0
Share

Fantastic tip - thanks! That's a fantastic AR scene, congrats

avatar image
1

Answer by Bunny83 · Dec 12, 2011 at 07:08 PM

"Real" realtime shadows are near to impossible. I guess stencil shadows won't work on iPhone because (i guess) the iPhone doesn't have a stencil buffer. It depends on what shadow you need. In this post( ricardo_arango's answer ) there's a script that will kind of "project" a mesh to a flat surface. Of course this will only work for flat surfaces.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Dec 12, 2011 at 08:47 PM 0
Share

Not really impossible; see my answer.

avatar image ina · Dec 13, 2011 at 07:09 AM 0
Share

What about realtime antialiased shadows?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Behavior of Realtime Shadows on iOS 1 Answer

iPhone Resolution Screen Switch 0 Answers

Mini Mac - Can this Compile Unity? 2 Answers

Too much triangles and more doubts performance-related 1 Answer

Unity modules for iOS? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges