Download

Shader compile error in MobileBasePassPixelShader.usf concerning MobileDirectionalLight

So here is the errors from a modification of a former worker which compiles fine in 4.19

LogShaderCompilers: Display: /Engine/Private/MobileBasePassPixelShader.usf(439): error: ‘MobileDirectionalLight’ undeclared
LogShaderCompilers: Display: /Engine/Private/MobileBasePassPixelShader.usf(439): error: type mismatch
LogShaderCompilers: Display: /Engine/Private/MobileBasePassPixelShader.usf(439): error: cannot construct ‘vec3’ from a non-numeric data type
LogShaderCompilers: Display: /Engine/Private/MobileBasePassPixelShader.usf(439): error: no matching function for call to ‘FastPhongMain(FPixelMaterialInputs, FMaterialPixelParameters, , half3)’
LogShaderCompilers: Display: /Engine/Private/MobileBasePassPixelShader.usf(439): error: candidates are: half3 FastPhongMain(FPixelMaterialInputs, FMaterialPixelParameters, vec3, half3)

Now I’m assuming that MobileDirectionalLight comes from the buffer declaration in SceneView.cpp

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT(FMobileDirectionalLightShaderParameters, “MobileDirectionalLight”);

This modification is in the main function and I can see it be used further down in that function fine

#if DIRECTIONAL_LIGHT_CSM && !MOBILE_MULTI_VIEW
// Cascaded Shadow Map
{
FPCFSamplerSettings Settings;
Settings.ShadowDepthTexture = MobileDirectionalLight.DirectionalLightShadowTexture;
Settings.ShadowDepthTextureSampler = MobileDirectionalLight.DirectionalLightShadowSampler;
Settings.TransitionScale = MobileDirectionalLight.DirectionalLightShadowTransition;
Settings.ShadowBufferSize = MobileDirectionalLight.DirectionalLightShadowSize;

Is this no longer visible now? I’m kinda a bit lost as my rendering experience with UE4 is basically 0.

The name has changed to MobileDirectionalLight.DirectionalLightDirectionAndShadowTransition.xyz.

Dooohhh! Should have known it was something this simple.