# Get GBuffer Information

**URL:** <https://forums.unrealengine.com/t/get-gbuffer-information/407403>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 19, 2017, 2:37pm UTC](https://forums.unrealengine.com/t/get-gbuffer-information/407403 "2017-10-19T14:37:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_46a83031](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_46a83031](https://forums.unrealengine.com/u/anonymous_user_46a83031)\
**Post date:** [October 19, 2017, 2:37pm UTC](https://forums.unrealengine.com/t/get-gbuffer-information/407403/1 "2017-10-19T14:37:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [October 20, 2017, 7:06am UTC](https://forums.unrealengine.com/t/get-gbuffer-information/407403/2 "2017-10-20T07:06:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Joachim.L](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joachim.L](https://forums.unrealengine.com/u/Joachim.L)\
**Post date:** [July 12, 2024, 8:11am UTC](https://forums.unrealengine.com/t/get-gbuffer-information/407403/3 "2024-07-12T08:11:33Z")

</div>

Hello There!  
I know that this is an old thread but…

In UE5.3, I defined a custom material node to fetch the underlying BaseColor from a Transluency Material:

```auto
FGBufferData GBData = GetGBufferData(UV, false);
return GBData.BaseColor;

```

when I connect the node, UE5.3 crash hard:

```auto
[2024-07-12T07:56:35.031Z]LogOutputDevice: Error: Ensure condition failed: ShaderTableHash == 0 || UniformBufferHash == ShaderTableHash [File:D:\build\++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Commands.cpp] [Line: 77] 
[2024-07-12T07:56:35.031Z]LogOutputDevice: Error: Invalid uniform buffer FOpaqueBasePassUniformParameters bound on PixelShader at index 2.
[2024-07-12T07:56:35.031Z]LogStats: FDebug::EnsureFailed - 0.000 s
Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\RHICore\Public\RHICoreShader.h] [Line: 147] 
Uniform buffer bound to slot 2 is not what the shader expected:
	Bound : Uniform Buffer[FOpaqueBasePassUniformParameters] with Hash[0x09880f28]
	Expected : Uniform Buffer[SceneTexturesStruct] with Hash[0x09700e08]
	Shader Name : <unknown>
	Layout CB Size : 2432
	Layout Num Resources : 49
	Resource Types : 9 8 5 8 16 16 16 16 9 8 5 8 16 16 16 16 9 8 5 8 5 8 5 8 5 8 5 8 9 8 5 8 9 8 13 13 9 9 9 9 9 9 9 8 8 8 5 8 16

```

Also tested:

```auto
FScreenSpaceData ScreenSpaceData = GetScreenSpaceData(UV, false);
return ScreenSpaceData.GBuffer.BaseColor;

```

with exact same results…

Of course, I have no idea what does this mean 🙂  
Any idea someone?

---

<div class="post-metadata">

**Author:** ![Joachim.L](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joachim.L](https://forums.unrealengine.com/u/Joachim.L)\
**Post date:** [July 12, 2024, 8:42am UTC](https://forums.unrealengine.com/t/get-gbuffer-information/407403/4 "2024-07-12T08:42:29Z")

</div>

Browsing the Forum, I realise that I may have access to the SceneTexture Node in Transluent material…

 ![getbasecolor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/4/c94467e8dfc8cdd4ffc82f35eb022f5d3289ce7c.jpeg)

And of course, it works and provide access to all GBuffer I need…
