# How to Accessing GBuffer from C++ In UE5

**URL:** <https://forums.unrealengine.com/t/how-to-accessing-gbuffer-from-c-in-ue5/632696>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 23, 2022, 3:04pm UTC](https://forums.unrealengine.com/t/how-to-accessing-gbuffer-from-c-in-ue5/632696 "2022-08-23T15:04:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meteoc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meteoc](https://forums.unrealengine.com/u/Meteoc)\
**Post date:** [August 23, 2022, 3:04pm UTC](https://forums.unrealengine.com/t/how-to-accessing-gbuffer-from-c-in-ue5/632696/1 "2022-08-23T15:04:15Z")

</div>

In my project, I want to get the depth information of the scene, custom depth information, and maybe some others, which can be obtained from Gbuffer. I found a related question [Accessing GBuffer from C++](https://forums.unrealengine.com/t/accessing-gbuffer-from-c/414915), but the solution is out of date in UE5, as RHI has been completely replaced by RDG in UE5.  
FSceneRenderTargets& SceneContext = FSceneRenderTargets::Get(RHICmdList) is no longer available in UE5.  
So what is the C++ access Gbuffer method in UE5, this problem has been tormenting me for two days.

---

<div class="post-metadata">

**Author:** ![lusaidan2012](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lusaidan2012](https://forums.unrealengine.com/u/lusaidan2012)\
**Post date:** [November 9, 2022, 9:39am UTC](https://forums.unrealengine.com/t/how-to-accessing-gbuffer-from-c-in-ue5/632696/2 "2022-11-09T09:39:34Z")

</div>

I have the same problem as yours. Have you resolved this? If yes,would you please share your metod? thank you ~

---

<div class="post-metadata">

**Author:** ![Meteoc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meteoc](https://forums.unrealengine.com/u/Meteoc)\
**Post date:** [December 21, 2022, 9:08am UTC](https://forums.unrealengine.com/t/how-to-accessing-gbuffer-from-c-in-ue5/632696/3 "2022-12-21T09:08:38Z")

</div>

Sorry replay too late,Actually I found you are using MRQ，The function you are doing is very likely to be similar to mine。MRQ can export postprocess i think you had know，just create a prostprocess material to out scenetexture。
