Hi everyone,
I’m writing a custom shader in a .usf file and I’m trying to access the View uniform buffer (e.g. View.ViewProjectionMatrix, etc.). However, the shader compiler errors out with:
error: use of undeclared identifier 'View'; did you mean 'new'?
On the C++ side, my shader derives from FGlobalShader, and I’ve added the following parameter:
SHADER_PARAMETER_STRUCT_REF(FViewUniformShaderParameters, View)
The shader compiles fine on the C++ side, but inside the .usf file the View symbol is still not defined.
I’ve also tried including common headers like:
#include "/Engine/Private/Common.ush"
#include "/Engine/Private/SceneTexturesCommon.ush"
but the issue persists.
What is the correct way to expose and access the View uniform buffer inside a custom .usf shader?
Am I missing a required include, binding step, or macro on the shader side?
Any guidance or minimal working example would be greatly appreciated.
Thanks!