Archived

This topic is now archived and is closed to further replies.

Pho

Depth of the Depth Buffer

Recommended Posts

Pho    122
Is it possible to set the depth of the depth buffer in OpenGL ? I now that NeHe sets this buffer to 16 bit in CreateGLWindow function in the PIXELFORMATDESCRIPTOR structure, but... It appears that on my system ( C333 with RivaTNT ) it doesn’t have any meaning to what value I set it. It can be set to 0, -7 or even 89. It really doesn’t matter. No error is reported. The system is always using “default” value which depends on the color depth of the windows desktop. I use this little function which is called by pressing Z key: void ReadZDepth() { GLint Depth; glGetIntegerv( GL_DEPTH_BITS, &Depth ); char text[255]; sprintf( text, "Current Z Depth is %d", Depth ); MessageBox( NULL, text, NULL, MB_OK ); } So, if my Desktop is set to 8 bit or 16 bit color depth, this function always reports 16 bit depth buffer. If color depth is 32 bit, the depth buffer is 24 bit. The questions on my mind are: Is it possible to specify 16 bit depth buffer even if you are using 32 bit color depth desktop? Or vice versa, 24 bit depth buffer with 16 bit color depth desktop? Is there any gfx card capable of utilizing 32 bit depth buffer ? What values of depth buffer are valid anyway ? Is it possible to have 8 bit depth bufffer ? Yes, I know it would be meaningless, low precison and all that, but simply from the “Want To Know” standpoint. Thanks for replying Pho

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Nvidia has two basic modes for their cards:
16 bit color, 16 bit depth
or
32 bit color, 24 bit depth, 8 bit stencil

If you request anything else, it will try to match one of those.

Share this post


Link to post
Share on other sites