Mobile Shadows - Anyone got them to work?

Does anyone have an example project with working iOS mobile shadows? I can’t get them to work in my project at all–in the Editor or on the device. I’m wondering if you need to use specific shaders for it to work? (I’m using custom shaders on most objects). I seem to have the quality, lighting, and gameobject settings (send/receive shadows) correct.

Are you using dynamic shadows? Dynamic shadows for mobile requires Unity Pro and even then they are very taxing, If not look into using a combination of baked and blob shadows that gives you good performance and decent graphics.

Yep, I have Unity Pro. Blob shadows look terrible (their performance isn’t that great either!), and my game is pretty basic so I think it’s a good candidate for mobile shadows. I’d actually like to test it out to see what the perf is like. I figure maybe in more complicated games I’d only enable them on the iPhone 4S or above etc.

Try seeing if it will work with some of unity’s included shaders, I had no trouble in making dynamic shadows work on a project I did a few weeks back for mobile.

I have them working on an iPhone 4 using normal mapped surfaces. Make sure you:

  • Use a directional light (shadows won’t cast from any other light type on mobile).
  • Set your directional light to either “Important” or “Auto”.
  • Check the mesh renderers you want to receive shadows with “Receive Shadows”.
  • Check the mesh renderers you want to cast shadows with “Cast Shadows”.
  • Take a look at Edit > Project Settings > Quality (I’m using Hard Shadows, Low Resolution, Stable Fit, No Cascades, Shadow Distance = 12)

I found shadows did NOT work when OpenGL ES 1.x was selected.
Make sure OpenGL ES 2.0 is highlighted in the player settings.

Turning shadows on I went from ~30 fps to 12-15 on my iPad 1 and iPod touch 4, with low res shadows.

hi ,
here is my problem . i work on unity for an AR project . i mad a box with a extrude in it and i put an animation of rotation on the box … the problem is that when i export an .apk for my android , i don’t have any self shadow projected on my box in AR … and i have dynamic shadow in unity . i don’t understand why it doens’t export on my android …

i’m using unity pro , and my player settign are :

minimum API level : android 2.0.1 exlair ( api level 6 )
device filter : ARMv7 only
instal location : prfer external
graphic level : openGL ES 2.0

Can u help me plz ? Thanks

Hi,

posting this question on dedicated Unity Android forum: http://forum.unity3d.com/forums/30-Android-Development migh have better chances to be answered. Shadows are not supported on some Android devices, which one are you using for testing?

i have an sony ericson android , version : 2.3.4

You should be more specific about device model, because it highly depends on what GPU it has. From Unity Manual (http://docs.unity3d.com/Documentation/Manual/Shadows.html) : “GL_OES_depth_texture support. Most notably, Tegra-based Android devices do not have it, so shadows are not supported there.”. Also you need Pro version of Android license.