4.5 UMG: Incorrect gamma in mobile preview (w/ fix)

All UMG controls are brighter in mobile preview and don’t match the actual device. The problem can be fixed by editing Engine/Shaders/SlateElementPixelShader.usf

Change this block:

#if !COMPILER_GLSL_ES2
	// gamma correct
	OutColor.rgb = pow(OutColor.rgb,InvDisplayGamma);
#endif

To this:

#if !ES2_PROFILE && !ES3_1_PROFILE
	// gamma correct
	OutColor.rgb = pow(OutColor.rgb,InvDisplayGamma);
#endif

The flag COMPILER_GLSL_ES2 is false in mobile preview (because it’s using DirectX on Windows), so it’s needed to check the ES2_PROFILE as well.

Hey pedro_clericuzzi -

Thank You for the catch. If you would like you can enter a Pull Request through GitHub we will correct the Shader file in the engine.

Eric Ketchum

Nice catch!

Thanks for the heads up! Coincidentally, we just changed that code to #if !(ES2_PROFILE || ES3_1_PROFILE) as testing for COMPILER_GLSL_ES2 is a bit redundant.

I was wary of whether my change would work with the new ES3 support (I have no way to test that), but your change seems ideal.