Very high contrast and saturation on android build (LWRP)

Our team recently discovered that whenever we build our game for android, we get a really high saturation and contrast that looks really really bad. The first time I noticed it I thought it was only something odd in one particular test scene, because our main test device is an iPad and the game looked right whenever we build for ios.

We changed to 2019.1 a few weeks ago, but I’m not sure if we had the problem before that or if that’s when it started. All android builds worked fine like a month ago at least.

When we build the entire game to android, every scene but one had the issue, and that scene did not have any post process in it, so we tried removing the post process on the cameras in all the scenes, but that actually just made the problem appear in all the scenes, including the one that looked fine before.We use the standard post process for unity.

We tried comparing our build settings to the LWRP example project and found nothing obvious, and we’ve tried googling but this does not seem to be a common issue because I found nothing.

Any takers on how to solve this?

1 Like

Update with screenshots of the issue and settings.

This is part of a scene what it looks like in the editor (and it looks the same in an ios-build):

This is what it looks like in the android build:

Player settings:

LWRP settings:

It seems as though lighting has been omitted from the shaders compiled for Android. Or perhaps that the shader is not supported for that particular GPU and is reverting to an unlit fallback

Hm, not sure what you mean. Like the standard unlit shader in LWRP? Because the contrast and saturation effect is on everything in the game, even UI and terrain, trees etc, and even if everything would have unlit shaders it would just look flat and not that dark and saturated. However, the shader compilation takes like and hour so maybe that’s an indicator of something, but it’s been like that for a while before this problem occured.

I did just notice though that there’s no saturation and contrast issue when building in gamma, so it’s got to have something to do with linear color space.

This issue was fixed in 2019.1.4f1.

Thanks, but we tried to build in 2019.1.4f1 as well and still had the issue. The 2019.2b seems to work however, so we’re gonna wait for that to come out of beta instead.

I still got that issue in 2019.2b. On all devices using Vulkan, everything looks as it should, just with OpenGL3 things get that too high contrast.

@TilmiteinemL on which devices do you get this?
Is postprocessing enabled?

@aleksandrk Yes it is! The normal postprocessing stack. It doesn some stuff though when i enter different PP-volumes, the effects just dont get displayed properly.

@TilmiteinemL I’m working on a fix for this :slight_smile:
I’ll post here when it’s fixed.

@aleksandrk Nice :slight_smile: Devices were: LG Nexus 5 and Nexus 6 (all running OpenGL due to their old Android Version). Every device that supports Vulkan didnt show the issue (Nokia 5, Galaxy Tab 2016, Pixel 1st Gen).

@TilmiteinemL
It’s fixed for Universal RP (7.1.1 should have the fix in place).

Are there any plans to back port the fix to other versions of 2019?

@rjosebfs Partially. The bug had two parts, one in the pipeline itself, and one in the post processing stack. The pipeline part is going to be back ported (if not already), but the post processing part is trickier. It would double the variants for the Uber shader in PPv2, and it’s already quite a lot of them there.

@aleksandrk my project is locked to 2019.1 for some time, so I’m trying to patch this asap.

I pulled these changes into my local embedded lwrp package v5.16.1
https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4226/commits/30f5ed8a99c36bd3f46637445ff37e9cc71b3584
FinalBlitPass.cs is now in universal pipeline, but in 5.16.1 I found it in lwrp.

Those changes fixed the darkness of everything but the screen overlay UI. I can’t find any other related issues. Is this known? Is FinalBlitPass happening after UI in the newer versions?

Thanks for the help!

So in the future we would likely be able to work around this by disabling post processing for those devices?

Either that or render in gamma space. You can check with https://docs.unity3d.com/ScriptReference/Display-requiresSrgbBlitToBackbuffer.html if the device support automagical conversions, or try and modify your local PP stack with https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4238/commits/a9fa23d6fc992e21e4b6aaf27f5664149d053cbf and https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4238/commits/b3554a72ee614efed41e847724aee607138421f9#diff-0fc38bcad4c9bdbb2263ff5f4e949b4a (only the ShaderPreprocessor.cs changes). But this will double the amount of variants in the Uber shader.

No, it would be very nice if you could submit a bug report.

Hi @aleksandrk

I am seeing this in 2018.3, is this the same issue or something else?

@o1o101 perhaps. 2018.3 is not supported anymore, so please consider upgrading to 2018.4 :slight_smile:

@aleksandrk I upgraded my project from LWRP to Universal now to see if the fix worked. Everything seems fine, but now I dont get any PP-effects shown at all anymore, but I noticed that the camera itself has some PostProcess-Options now (Volume Mask and a Trigger to render PP-Effects), that were not there before. (Post Processing stack is up to date according to the Package Manager).