Download

4.20.3 Fix for broken Backlit property in Hair shader

The “Backlit” input in the hair shader has been broken for some time - it ignores any input and is apparently set to max. There’s a “Backlogged” bug report for it here: Unreal Engine Issues and Bug Tracker (UE-39061)

A fix for it was described by **stororokw **here. However, this seems to apply to an older version of the engine, and the shader files in 4.20.3 have changed since then.

I seem to have been able to fix it in 4.20.3 by modifying Engine/Shaders/Private/ShadingModels.ush. I changed the line:


Lighting.Transmission = AreaLight.FalloffColor * Falloff * HairShading( GBuffer, L, V, N, Shadow.TransmissionShadow, **1**, 0, uint2(0,0) );

to:


Lighting.Transmission = AreaLight.FalloffColor * Falloff * HairShading( GBuffer, L, V, N, Shadow.TransmissionShadow, **GBuffer.CustomData.z**, 0, uint2(0,0) );

I guess the engine needs to recompile all shaders after making this change, so opening a project immediately afterwards will take a long time, but should be normal speed after that.

For me this bug made the hair shader unusable, but it seems like a great option with the fix. Hope others will find it useful.

Just wanted to add this is to prevalent in 4.25.1

The fix still works, however the should be updated to:


Lighting.Transmission = AreaLight.FalloffColor * Falloff * HairShading( GBuffer, L, V, N, Shadow.TransmissionShadow, Shadow.HairTransmittance, GBuffer.CustomData.z, 0, uint2(0,0), bEvalMultiScatter);

Note, the new **Shadow.HairTransmittance **parameter. The goal of the fix is still to replace, the constant 1 value.

I never looked into it, but I wonder if this could potentially also address the fact that transmission doesn’t fade to 0 but starts at .01 or .11 can’t remember witch, creating a line on skin…