Shader compilation error

Hi guys,

I copied my project on another machine and the shader start to fail the compilation. The detailed dump follows:

D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: use of undeclared identifier ‘View’; did you mean ‘new’?
return lerp(Pre,Cur,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: ‘new’ is a reserved keyword in HLSL
Internal Error!
M_Base_SpeedTree_VT_V2_25048c5fa488591c/High/DepthPipeline/FLocalVertexFactory/TDepthOnlyVS/0:/Engine/Private/DepthOnlyVertexShader.usf|Main VF ‘FLocalVertexFactory’ Type ‘TDepthOnlyVS’ ‘/Engine/Private/DepthOnlyVertexShader.usf’ Entry ‘Main’ Permutation 0
Internal Error!
M_Base_SpeedTree_VT_V2_25048c5fa488591c/High/VelocityPipeline/FLocalVertexFactory/FVelocityVS/0:/Engine/Private/VelocityShader.usf|MainVertexShader VF ‘FLocalVertexFactory’ Type ‘FVelocityVS’ ‘/Engine/Private/VelocityShader.usf’ Entry ‘MainVertexShader’ Permutation 0
LogShaderCompilers: Warning: Failed to compile Material /Game/00Main/GlobalMat/BaseLibrary/Env/M_Base_SpeedTree_VT_V2.M_Base_SpeedTree_VT_V2 (MI:/Game/HSH/00MainHZ/Environment/Speedtree/Materials/HFS_Plant_Group/HFS_Plant_Group_PP/SM_HFS_Plants_Forest_09_n_leaf_PP09b.SM_HFS_Plants_Forest_09_n_leaf_PP09b) for platform PCD3D_SM6, Default Material will be used in game.
Shader debug info dumped to: “E:\proj\unreal\HSH\Saved\ShaderDebugInfo\PCD3D_SM6\M_Base_SpeedTree_VT_V2_25048c5fa488591c\High\FLocalVertexFactory\TMaterialCHSFNoLightMapPolicyFAnyHitShader\0”
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: use of undeclared identifier ‘View’; did you mean ‘new’?
return lerp(Pre,Cur,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader TMaterialCHSFNoLightMapPolicyFAnyHitShader, Permutation 0, VF FLocalVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: ‘new’ is a reserved keyword in HLSL
Internal Error!
M_Base_SpeedTree_VT_V2_25048c5fa488591c/High/DepthPipeline/FLocalVertexFactory/TDepthOnlyVS/0:/Engine/Private/DepthOnlyVertexShader.usf|Main VF ‘FLocalVertexFactory’ Type ‘TDepthOnlyVS’ ‘/Engine/Private/DepthOnlyVertexShader.usf’ Entry ‘Main’ Permutation 0
Internal Error!
M_Base_SpeedTree_VT_V2_25048c5fa488591c/High/VelocityPipeline/FLocalVertexFactory/FVelocityVS/0:/Engine/Private/VelocityShader.usf|MainVertexShader VF ‘FLocalVertexFactory’ Type ‘FVelocityVS’ ‘/Engine/Private/VelocityShader.usf’ Entry ‘MainVertexShader’ Permutation 0
LogShaderCompilers: Warning: Failed to compile Material /Game/00Main/GlobalMat/BaseLibrary/Env/M_Base_SpeedTree_VT_V2.M_Base_SpeedTree_VT_V2 (MI:/Game/HSH/00MainHZ/Environment/Speedtree/Materials/HFL_Plant_Group/HFL_Plant_Group_PP/SM_HFL_Plant_08c_Frond_PP08c.SM_HFL_Plant_08c_Frond_PP08c) for platform PCD3D_SM6, Default Material will be used in game.
Shader debug info dumped to: “E:\proj\unreal\HSH\Saved\ShaderDebugInfo\PCD3D_SM6\M_Base_SpeedTree_VT_V2_fed90365b0093223\High\VelocityPipeline\FInstancedStaticMeshVertexFactory\FVelocityPS\0”
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4348,39): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4348:39: error: no member named ‘InstanceLocalPosition’ in ‘FMaterialVertexParameters’
float3 LocalPosition = Parameters.InstanceLocalPosition;
~~~~~~~~~~ ^
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4498,61): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4498:61: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: use of undeclared identifier ‘View’; did you mean ‘new’?
return lerp(Pre,Cur,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4664,21): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4664:21: error: ‘new’ is a reserved keyword in HLSL
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4724,39): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4724:39: error: no member named ‘InstanceLocalPosition’ in ‘FMaterialVertexParameters’
float3 LocalPosition = Parameters.InstanceLocalPosition;
~~~~~~~~~~ ^
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: use of undeclared identifier ‘View’; did you mean ‘new’?
CollisionWind = lerp(CollisionWind,CurCollisionWind,View.IsGamePause);
^~~~
D:\Epic\Unreal\UE_5.5\Engine\Shaders\Private\MaterialTemplate.ush(4874,61): Shader FVelocityPS, Permutation 0, VF FInstancedStaticMeshVertexFactory:
/Engine/Generated/Material.ush:4874:61: error: ‘new’ is a reserved keyword in HLSL

What can be wrong here? The new machine has a 5090 card and the newest driver, RHI configured to D3D12.

Hello there @joeyskeys !

Considering you just migrated your entire scene to a new rig, there’s more likely a file or cache conflict affecting your project. Checking through your extended log, the critical errors are as follows:

error: use of undeclared identifier ‘View’; did you mean ‘new’?

error: no member named ‘InstanceLocalPosition’ in ‘FMaterialVertexParameters’

These errors indicate that your shader source is either e de-synced or corrupted, and the engine is trying to compile materials using incomplete shader code. In order to resolve the problem, let’s try the following:

  • Fully clear your project cache, via closing UE, then deleting foldersDerivedDataCache, Intermediate, and Saved from your project directory.

  • Next, check the Epic Launcher, open the options on your 5.5 install, and click the “Verify” button to check for and repair any corrupted or missing engine files.

  • Now, re-opening the engine will reconstruct your cache and shader compilation. It will take a bit of time, but this will most likely resolve the problem.

  • If the issue persists, we can also try switching between DX11 and DX12, as well as clearing your current GPU drivers, and performing a clean install of the nVidia Developer drivers.