we’re currently working on a project which makes usage of the real time shadows of Unity 5 on mobile platforms. We’re exclusively using latest Android tablets and iPad Airs (first generation).
We’re currently seeing a problem with the shadow setup, especially when using cascades. It seems that the actual cascade setup is more or less ignored.
We’ve set the max shadow distance to 10 meters, and the cascades are 5%, 5%, 5%, 85%. This should lead to highest quality for closest objects with rapid degression.
Unfortunately, fact is that the shadows for the objects are mediocre for the closest one.
AND NOW THE STRANGE THING: If I look straight forward (towards the horizon), the shadow quality of close objects is bad. And when I slowly tilt the camera to look downwards, the shadow quality gets better and better until reaching the quality settings O_o
What is this kind of sorcery? Who implements things like this?!?
Has anyone encountered the same problem and has a solution for this?
Firstly, without seeing what you’re referring to, no one can really help, second, Mobiles are quite often limited by what they can do with realtime shadows, some devices don’t support them at all, some support only the most basic features.
thanks for your comment. But as I said, we’re targeting iPad Airs which support the features we need.
Here’s a video of the problem:
I’va also attached an image of the settings…
Additional information: this is not due to the shadow bias, we have tested this with more complex objects with the same result (big blocky shadows switch to fine shadows)
That’s normal, its probably happening all the time - it’s screen space shadows. Problem here is probably to do with a bug on the mobile render texture size or something, so could you file a bug?
Have you also checked your quality settings? Likely it might be set to “low” shadow res in quality, while using hard shadows.
We’ve tried every combination you can image of. From changing the % of the shadow cascades to changing shadow quality. We already think that this is most likely a bug, so a small repro case is in production… gonna post case # here…
Can the shadow distance be changed in runtime? We need higher shadow distances for overview views and lower distances when inside. Unfortunately we cannot use lightmaps…
SO… didn’t say thanks to Ippokratis Works like a charm
@hippocoder Well, it would be nice to have it. At least we could select the number of shadow cascades. There is a mismatch between what you can do in the editor and what is finally visible in the mobile view (independent on the actual tablet/smartphone capabilities). If the cascades are not supported, there should at least be a “warning” at the cascade setup to tell us so. Currently, it’s a simple note on the directional lights shadow page of the Unity Manual (which I overread at least 5 times).
We adjusted the shadow distance settings dynamically. We determined which object was closest to the player’s view and changed the shadow distance accordingly. Worked perfectly for our use case.