A problem which has been bugging me for ages is the ability to ‘see’ the depth buffer.
For a while now, my deferred renderig engine has been making use of depth_stencil texture as the depth buffer. Whilst this works just fine on nVidia h/w, it has come to light that it (the stencil part) does not work properly on ATI Radeon 4850.
So, instead of depth_stencil textures, I now use a depth_stencil render buffer. Everything renders just fine.
I now need to ‘see’ the depth and display it (for debugging purposes) as a texture. When the depth buffer was a texture I had difficulty displaying the contents of the texture becuase it was only ever black when I bind it and apply it to a 2D quad on my GUI front end.
Now that I’m using a render buffer, I am trying to use glCopyPixels (assuming nv_Copy_Depth_To_Color) exists (which it does) but that just gives black as well. I’ve tried specifying GL_COLOR as the operation as well as DEPTH_STENCIL_TO_RGBA_NV but nothing - just black.
Has anyone else managed to get glCopyPixels to work and display the depth buffer ?