[SOLVED] Accessing Gbuffers BeforeLighting

Okay so here’s the situation. In Deferred mode I want to be able use a BeforeLighting command buffer to read from the Gbuffer normals and depth. I need them so that I can generate data that will then be used in my deferred override shader. However, when I try to read from _CameraGBufferTexture2 & _CameraDepthTexture inside my blit shaders it never reads. I know it’s possible to get access to these textures in a command buffer setup, as it was done for the command buffer custom light types demo.

My question is, in what camera event can I access these buffers? Is there any other set up work I need to do to make them accessible? Am I supposed to use render targets and draw a mesh?

Thanks.

Never mind. I just did a check and they are available in AfterReflections mode. Apparently the editor was glitching out because I wasn’t doing a good enough job cleaning up command buffers between script modifications.

1 Like