Sampling from a depth texture bound to the FBO

Started by
-1 comments, last by myers 10 years, 8 months ago

On DX11, disabling depth writes allows you simultaneously to sample and depth-test against the same depth texture. This feature is useful, for example, for soft particles: without it, you'd either have to make a copy of the depth texture, or disable depth testing and lose early-z culling.

Is this supported in OpenGL 4+? If I call glDepthMask(0), is it safe to assume that I can sample from the depth texture bound as an attachment of the FBO I'm rendering to? I see nothing in the specs to indicate that it is. I don't notice any problems on my hardware, but I've found that a lot of off-spec behaviour works ok on Nvidia.

This topic is closed to new replies.

Advertisement