I’m currently modifying the engine source to make some additions/alterations to the renderer. One thing I’d like to be able to do is alter certain aspects of the Post Processing part of the rendering. Specifically, I’m trying to figure out if I can access the SceneTexturesStruct (containing GBuffer data etc.) during one of the Post Processing global shaders.
For example, I’m trying to include a line like this inside PostProcessTonemap.usf:
float3 Mask = Texture2DSample(SceneTexturesStruct.SceneDepthTexture, SceneTexturesStruct.SceneDepthTextureSampler, SceneUV).rgb;
However, when I run this, I get the following error:
Fatal error: [File:C:\Users\X\Documents\GitHub\UnrealEngine\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Commands.cpp] [Line: 1508] Shader expected a uniform buffer of struct type SceneTexturesStruct at slot 2 but got null instead. Rendering code needs to set a valid uniform buffer for this slot.
I’m in a bit over my head here, but it seems like the SceneTexturesStruct isn’t available to this shader, so I’m wondering whether its actually possible to make it accessible? Or am I way off base here?!