LightAttenuationTexture & LightAttenuationTextureSampler are returning garbage in 4.17.1

Hello guys,

We’re using custom shader for making shadows from movable directional light on a plane with unlit material. Here is the code:

float s = Texture2DSampleLevel(LightAttenuationTexture, LightAttenuationTextureSampler, UV, 0).x;
s = saturate(s);
return float4(s, 1-s, s, s);

Last engine’s version where it works properly is custom dev-ar-kit branch. After release of 4.17 and 4.17.1 LightAttenuationTexture looks like garbaged data or some another texture from memory and depending on camera position.

Thank you :slight_smile:

Anybody? We are now living with ugly modulated shadows :frowning:

LightAttenuationTexture is only bound when using the deferred or desktop forward renderer which explains why you’re getting junk data.

There should be a way to lookup the CSM shadowmap data with the mobile renderer which should look a lot better than modulated. In MobileBasePassPixelShader.usf, something very similar to all the code in the block under “// Cascaded Shadow Map” should do what you want although you only want the MOVABLE_DIRECTIONAL_LIGHT path, the other case is for blending CSM with lightmaps.

Cheers
Jack

This post is kinda old but will try my luck.
I am having similar issues on my side with mobile builds…zulman, did you guys sort out a solution for that shadow issue?
If so, would love to hear about it!