Get GBuffer Information

I would like to get the Information stored in the GBuffer. I saw some approaches using custom HLSL nodes, e.g.:

MaterialFloat2 UV = MaterialFloat2(ScreenAlignedPosition(Parameters.ScreenPosition).xy);

FGBufferData GBData = GetGBufferData(UV, false);
return GBData.Metallic;

But I get the errors:

[SM5] /Engine/Generated/Material.ush(1271,14-19): error X3000: unrecognized identifier ‘GBData’

[SM5] /Engine/Generated/Material.ush(1271,1-12): error X3000: unrecognized identifier ‘FGBufferData’

Has anyone an idea?

1 Like

GetGBufferData() is defined in DeferredShadingCommon.ush.

For materials, it is only included, if material has access to scene textures, and thus, it will only work in post process or translucent materials.