Stencil fbo attachments

Stefan Dösinger stefandoesinger at
Tue Jul 17 17:49:36 CDT 2007

Hi Henri,

Apparently I have debugged Splinter Cell in a wrong direction. The depth copy 
can hardly be the problem because splinter cell renders everything offscreen, 
except the final composition and the HUD.

I think the problem is the lack of a stencil attachment to our fbos. 
Implementing them looks rather simple - just adjust the internal format of 
D24S8 to the packed depth stencil format and set the same texture for depth 
and stencil attachments.

However, I think I remember that you tried that before and it failed for some 
reason. There are two extensions, GL_NV_packed_depth_stencil and 
GL_EXT_packed_depth_stencil, whereas the NV one is the only one supported on 
my nvidia card and the EXT one the only one supported on my ATI card(on 
macos). The EXT one seems to be the only one that is written with fbos in 
mind. fglrx does not support either extension.

As a fallback a combined depth stencil surface could contain an extra 8 bit gl 
texture(luminance, or GL_RED, or whatever) and just use it as a separate 
stencil buffer. We just have to watch out when locking the texture, and using 
such a surface for texuring will be tricky. (Stencil texture? Is that 
possible even? The EXT_packed_stencil extension says yes).

More information about the wine-devel mailing list