Implementing Custom Buffer / Scene Texture

Hello - IU posted this on the Answerhub too, but since the original thread from April also didn’t get any real responses, I’m going to post here too.

I’m wanting to create a custom 24/32-bit GBuffer pass or scene texture (much like a diffuse pass), allowing me to render to an RGB/RGBA texture from materials, and use it in solely in post process.

What would be the best way to approach this?

I’ve found the custom depth pass in FSceneRenderer::RenderCustomDepthPass() and it looks like I could do something very similar, with a few different flags and replacing FCustomDepthPrimSet::DrawPrims() with a function appropriate to what I would like to achieve? Would this be a good approach? One thing I may want to do is to render objects that may potentially be obscured by other geometry; would primitives / geometry already be culled in this step, or is this still viable? Should I instead be trying to track down where the other passes are made before being compressed into their respective parts of the GBuffer?

Original answerhub thread: