Mobile Lighting Artefacts / Device Rendering Issues

[Related Thread][1]

Note: This full project including source code has been sent via PM to Tim Hobson, in the hope that these issues can be looked into more directly. Please ask him for the files if you need them, they need to remain internal to Epic and kept private :slight_smile:

I am experiencing some severe lighting and rendering issues on Mobile that have persisted since at least 4.9 and still occur in 4.10. None of the issue here occur when running the game in PIE or in a packaged Windows game - only Mobile or Mobile Preview mode.

The game relies on Dynamic Lighting from a single directional light that acts as the sun, with very mild ambient lighting from a skylight. The skylight itself seems to be behaving as expected, but the dynamic light is causing a tonne of rendering artefacts. The devices I’m testing on are an nVidia Shield and a Sony Xperia Z1 Compact (DXT and ATC respectively). I’ve been told that the phone uses a Snapdragon 800 GPU. The game has Mobile HDR enabled, and is using the standard ES2 renderer. I have tried ES3.1 AEP previously way back in 4.8, but the issues still persisted there.

Some of these issues are not visislbe in the Mobile Previewer in Editor and only occur when the game is deployed to the device. I have PM’d Tim Hobson with a private copy of the game and it’s assets, in the hope that the issue can be resolved or at least confirmed on Epic’s end.

The first issue is harsh shadowing artefacts from the Dynamic Light. I am fairly certain I have the shadow cascading setup correctly, and what’s confusing is that this only seems to affect the Satellite in Mobile Preview, but affects all objects when deployed to the device. Any surfaces that are even slightly facing away from the sun are shadowed incredibly harshly, and there is no soft shadowing.

The first image below shows the game running in the mobile previewer in the editor. Notice the harsh shadow artifacts on the underside of the solar panels. The shadowed faces have normals that aren’t perfectly flat, but they still shouldn’t receive shadows as harsh as this. Non-mobile preview doesn’t produce these artifacts. You can also see that the Earth object has a regular soft shadow, and does not have any harsh blending in Mobile Previewer.

When deployed to the device however, not only do the artifacts on the Satellite persist, the Earth also gets shadowed incredibly harshly:

Additionally, you can also see that the (very simple) Atmosphere shader of the Earth also doesn’t draw correctly on the mobile device, even though it brings up no warnings or rendering errors in the Mobile Previewer. This is an incredibly simple material, the graph of which is posted below. If you have the source files, it’s in Content->Earth->Materials->Mat_AtmosBlue. What would cause it to render completely solid? It’s as if the Fresnel never get’s calculated properly.

The final issue, is that the sun disk disappears from the Universe Sky-dome. This sky-dome uses the same method as the engines BP_SkySphere Blueprint to draw the disc, except that the light vector is already preset in the material. On mobile however, the sun disc disappears, as if the light has been removed entirely. Again, the material editor gives me no warnings about incompatible operations or nodes on ES2.

As you can see there are some very significant differences between the deployed results and those in the Mobile previewer, which makes this difficult if not impossible for me to fix - especially the Materials. If somebody with more knowledge of the mobile renderer could take a look at this (I’ve sent the full project inc. source code to Tim Hobson), I would be eternally grateful. If I’m trying to achieve the impossible, It would be nice to know sooner rather than later so I can think about workarounds :slight_smile:

So I have deployed the most recent build to an nVidia Shield (Android DXT) and it appears to have resolved a couple of the major artifacts with lighting. There are still some solid shadows, but the sun disc has returned as has the correct Earth shadow.

This is what it currently looks like on an nVidia Shield with DXT textures - though the Android ATC version still has all the issues. BOth are still using the ES2 rendering path.

Thanks for the updates James.

I’ve still not had a chance to dig into this one yet. I’ve got to get a fresh copy of VS 2015 Pro installed. Had issues with my other version yesterday. I’ll see if I can take a look and get the project you provided compiled this afternoon or tomorrow. I’ll hit you up in our private message from the forums if I run into any issues.

No worries, thanks Tim!

Got everything compiled and working on a Nexus5, NV Shield, and Galaxy Note 4. I’m glad the NV Shield stuff resolved itself. I’ll look into the ES2 material issues between tomorrow and friday and get back to you with what I find.

Great stuff Tim, glad to hear it deploys on your end. Any updates at all?

Hi Tim

Have there been any updates on this at all? I’m currently considering scrapping lighting altogether and using unlit for everything, which would be a pretty disappointing change if we had to make it!

Have posted my own update in this thread. The issue appears to be related to precision problems with mobile shaders.

Hey, I’ve assigned Eric to see if he can offer any assistance. He’ll know more about material issues than I would and may be able to offer some help in that regard. I’ve still got your project on my drive that he can take a look if needed.

Hello -

Just a heads up I do think there is an issue here with some precision in World Position, but I am trying to currently track down the cause and if it is a regression.

Thank You for your patience -

Eric Ketchum

Hello -

There does appear to be an issue we are looking into about precision on certain levels of Android devices. We are tracking this issue as UE-25532. I have updated teh report to include your additional information and links to this Answehub and your last forum post listed above. As always we will try to keep you informed here as we get new updates.

Thank You

Eric Ketchum