4.12.5 preview shadow issue on mobile and PIE

First of all this issue has been stated by hls333555 and TeamKingdom many times on different posts (links at the bottom) and it is a known bug at 4.5. but since then it seems, problem has not solved and there is no clear answer. And staff member Sean Flint asked me to post a new question due to age of these post, I’m opening a new one. Related posts:

Question: I have shadow issue related to dynamic lights. They don’t work on android builds and mobile preview. PC builds and viewport preview are fine. My scene does not contain any skylight because it’s not outdoor. It’s indoor a closed building, there are some dynamic movable lights that give colorful light effects to the area. If you run the scene with selected viewport it’s fine.

But when you switch it to the mobile preview (PIE) it’s not so nice.

Same results also can be observed in builds. PC build has the same result with image 1, and Android build is the same with image 2. They match their related images in here.

I don’t know this is a bug or maybe it was a bug but solved i don’t know, But i have the similar issue of these almost 2 years old posts and i haven’t find any clear answer (most of them say change environment color but it doesn’t help)

Hi finwefeanor,

Dynamic lighting on mobile does not shadow cast for point lights. So part of the issue here is that shadow casting for dynamic lights may be part of what you’re seeing.

Secondly, you can only have a max of 4 overlapping dynamic point lights for each actor. This is not to say that you cannot have more than 4 for your scene though. As an example, if you have a floor mesh. You can have 4 dynamic point lights casting on the floor. The fifth or more will not cast on the floor mesh. This image below demonstrates this.

See how 5 and 5 cast on the wall, but not on the floor, which is a single static mesh. This is likely the issue you’re seeing with your colored lights not working properly.

The issues in the other posts linked aren’t necessarily directly related to this iss, but are more in line with limitations of their use or the mobile platform itself.

  1. Dynamic shadow casting is expensive. You should try using [modulate shadows][2] which are only supported for directional lights.
  2. Reflection captures are static. They cannot work to capture direct/dynamically lit worlds.
  3. Rolando posted the fix CL at the bottom for 4.6

For a good source of information on mobile development I would recommend our documentation here.

I hope this helps.

Tim

Hi! Tim Hobson :diamonds::diamonds:

I have an idea about casting shadows, but I haven’t tested it yet. Currently it’s only a theory.

What do you think about using black decals as shadow under player, for example there is a Character with green circle under it in TopDownTemplate. And to make it “dynamic” use it with Flipbook.

Will it work?

I can’t say for certain since I’ve not set up something like that before, but with Decals these are newer to mobile (since 4.9) and I’m not sure all devices support them, but I could be wrong on that.

You may want to see a solution that was used in the Showdown demo (available on the Epic Games Launcher in the Learn tab) that used “blob” shadows to make it look like the character had a contact shadow. I think that should work on Mobile and is used in this VR demo where performance impacts have higher cost.

Hi Tim,

thanks for quick and detail response. Let me sum up the situation on my end first:

  1. Especially TeamKingdom stated this issue on other threads and staff member RCaloca also stated that it will be fixed on 4.6 (or 4.7 something like that) But interesting part is that there is no clear answer for this issue since that time like it’s been fixed for good nobody complaining. But Mobile platform has this dynamic light problem, especially on android i think.

  2. What you say is certain about dynamic lighting like mobile can’t cast dynamic shadows ? Because i believe if i use directional light or skylight, it can cast dynamic shadows right ? This is the only way to cast shadows i suppose.

  3. Related to above , In my scene ( see img1) there are couple of dynamic movable spot lights. It’s a indoor scene , and the colorful lights are moving lights , think about disco lights. I’m explaining this part a bit long because you said “Dynamic lighting on mobile does not shadow cast for point lights”. In img1, the colorful pink lights that you see are not point lights, they are dynamic movable spot lights that give colorful changing lights. I just wanted to clarify this part(I can upload a small video if necessary).

  4. I know that it’s really expensive feature. But I’m just wondering about it maybe it could be possible in very low texture. So in order to use dynamic movable changable lights and shadows in the scene for mobile, only way is to use directional light and skylight right ?

edit: here a sample video from the scene. this is in viewport preview for windows. https://sendvid.com/rsyy8gez

  1. Looks like TeamKingdom responded with his detailed explanation and setup.

  2. I didn’t say that Dynamic lighting doesn’t work, just that it’s expensive. Not all devices may support it.

Breakdown of lighitng on Mobile:

  • Directional Light: Needs to be set to Movable for dynamic shadow casting. An alternative method for dynamic shadow casting is Modulate Shadow casting that needs to be enabled but only works with Stationary Directional Lights.
  • Point Lights: These can be dynamic, but they do not shadow cast and any single actor in the scene can only have up to 4 dynamic point lights affecting them at a given time.
  • Spot Lights: These are not supported on mobile for dynamic lighting.
  • Skylights: This worked for me in Dynamic/Stationary/Static capacity. Dynamic Skylight does not shadow cast though.
  1. Dynamic Spot Lights are not supported.

  2. For shadow casting Directional Light source is the only way for dynamic shadow casting or using Modulated Shadowing with a Stationary Directional Light.

Tim thank you very much for detaily answer. Things are more clear right now, I’ll read the docs for more info about them but clarifying this really helped.

and last question: future release of UE might support dynamic lighting for spot lights ? maybe when specs of mobile phones’ increase to a standart/ an acceptable point.

Dynamic Spotlight support I think would be a goal that is in line for the future, but would likely depend on Point Lights having shadow casting first since they are a masked version of a point light. I’m sure that limitations and variety of Android phone types plays a large role in the support of this at the moment. As phones become more powerful I would expect to see these devices be able to handle more rendering features, especially with the new Vulkan API that is supported on some mobile devices.