PDA

View Full Version : Processing depth/stencil values.



DmitryM
07-29-2010, 08:31 AM
I have a texture with Depth24Stencil8 format. Is there a way to process the values from it into the other texture with the same format?

I'd like to have some calculations of both depth and stencil to be done for the processing. Binding the texture to the ColorAttachment0 of the FBO gives me InvalidOperation error. I can't find such a restriction in the specification. Maybe you can point me to it?

The depth can be optionally written using glFragDepth variable, but I'm not aware of a similar mechanics for stencil values.

Dark Photon
07-31-2010, 06:28 PM
The depth can be optionally written using glFragDepth variable, but I'm not aware of a similar mechanics for stencil values.
You may have seen this but it came out earlier this week with the OpenGL 4.1 goodies:

* ARB_shader_stencil_export (http://www.opengl.org/registry/specs/ARB/shader_stencil_export.txt) - Specify stencil value in frag shader

Not sure if that'll be a GL4/D3D11-GPU-only feature, as doesn't look like anybody supports it yet...