PDA

View Full Version : How to read from stencil buffer



Xiaofeng
12-26-2001, 11:12 PM
How can i read stencil values from the stencil buffer, i had tried the following code but failed:
wglMakeCurrent(....);
pStencilPool = (GLushort*)malloc(sizeof(GLushort) * width * height);
glReadPixels(0, 0, width, height, GL_STENCIL_INDEX, GL_UNSIGNED_SHORT, pStencilPool);
p.s. The stencil buffer has 16 bit per pixel.
Thanks for your attention.

Serge K
12-29-2001, 02:49 PM
Originally posted by Xiaofeng:
p.s. The stencil buffer has 16 bit per pixel.

http://www.opengl.org/discussion_boards/ubb/confused.gif
Never heard about 3D hardware with 16bit stencil buffer...
Maybe it should be - "frame buffer has 16 bit per pixel"?
Most (if not all) of the consummer level 3D cards do not support stencil buffer in 16bit mode.