Access depth buffer without creating shader that extracts the z-depth of each pixel

Hello,

is it possible to access the depth buffer after every frame without a shader that extracts the z-value of each pixel?
The reason is, I would have had to render the entire scene twice: first for the depth, and second for the real image.

Is there any workaround?

Best regards.

no the depthbuffer resides on the GPU and is not sent back from there.

but you can totally just pass 2 rendertargets and render depth and color at the same time. This is commonly used in Deferred Shading (where even more information is generated during one pass)

1 Like

Ahh, that makes sense.
(-: