Android Shadows Acting Strangely

Lights in my scene: Single Directional Light (Movable)

In the editor everything works as expected.

On Android devices (S5, S6 and Sony Xperia) I have a banana which drops from a tree but it’s shadow incorrectly starts at the ground and goes up to the canopy (like the coordinate system for the shadows is inverted). The monkey which collects the banana doesn’t cast a shadow for some reason.

I’ve tried creating physics assets for both the tree and the monkey (they’re both skinned meshes). I’m using Moveable; though I’d rather set the light to Stationary (for performance reasons) but this makes all the shadows (on Android) disappear.

Hi!

In UE 4.9 have new feature - Modulated Shadow, like in UE3/UDK. This is old stile shadows for movable object for mobile platform. In current implementation this features has same limitation like in UE3/UDK. Maybe you will need rebuild light, if shadow not appear after activating.

Thanks for your reply. I’ve tried Stationary+Modulated already but I just tried it again (and rebuilding lighting / everything). I get viewport shadows but nothing on device

I also tried UE4.10 rev3 and am having the same issue

Try package project created from template.

This is screenshot from my Galaxy S2. UE 4.10.0 P3. I create TPS from template and enable Cast Modulated Shadows

Thanks. That project works for me on device. I’ve tried copying the values as well as making a blueprint from the light and migrating it. Still no shadows in my own project when launching to the S6

So I’ve noticed in that project Mobile HDR is on. However when I try and enable that in my project it crashes on startup

Not sure if it helps debug it but if I enable ES2 for the editor viewport - the shadows look fine. But as soon as I hit play (in editor) the shadows disappear (and it still says Feature Level: ES2 in the bottom RHS).

OK so this is not working with the Third Person Project if you start the project as a Mobile Project. That causes the shadows to disappear. For my previous test, I created a default TP Proj (defaults to desktop platform) which I built to my S6. This allowed shadows to work on S6. So now I need to find what those presets are actually changing

Modulated Shadows required Mobile HDR. If you create project with mobile optimization, you must enable Mobile HDR.
I create previous example on my Samsung Galaxy S2. Project was created for Desktop/Console Maximum Quality. I create new test with new TPS proj with mobile optimization. Enable Mobile HDR. Package and run. All works normal.

You know what… you may have just hit the nail on the head! If so thank you! I actually tried toggling Mobile HDR before; but I don’t think it affects anything- until an editor restart (I didn’t realise this coming from a Unity bg that some of these settings don’t have immediate effect). But booting up the project just now … shadows are working! and yes Mobile HDR is on from a previous session.

So I think my issue has been a combination of factors. Restarting in Mobile HDR doesn’t seem to make me lose viewport ES2 shadows; but it does lose shadows on ES2 devices. It would be nice if the viewport settings were saved between sessions so you don’t suddenly think viewport shadows are back (until you realise it’s really just defaulted back to a D3D viewport)

Setting a project up as Mobile doesn’t enable Cast Modulated Shadows (svv3dUDN thanks for pointing this out) nor does it enable the ES2 viewport. Whilst I’d done this on my own project; when comparing with a vanilla TP project; I also noticed I couldn’t disable MobileHDR (every time I restarted UE4 - it was back on again). I’d be interested to know why shadows rely on HDR (just out of curiosity/not related to my Q - but I couldn’t find any docs on it).