depth buffer

Hello I have a huge problem,
I draw my scene in the depth buffer, then i set with the function glDepthMask(0) that the Depth buffer is readonly.

than i draw the depth buffer in an array and save it in a bitmap.

but there is only a grey rectangle?

when i draw the depth buffer in the bitmap without setting it readonly i can see the depth buffer in the image

thank you for help


glDepthMask(0) = read-only (as you said) = no write = buffer empty (no values are written there) = empty bitmap

but when i first draw my scene and then set the buffer read only, the depth information should be in the buffer?

glDepthTest(GL_FALSE) DOES NOT PREVENT you from READING ACTUAL DEPTH DATA!!! I check it right now - the behaviour is the same whether i call glDepthTest(GL_FALSE) before reading depth or not - i CAN see the depth data. Your problem seems to be like you never again turn depth writing, or turn off too early, or other type of logic mistakes.
I repeat - i check & found that glDepthTest(GL_FALSE) called before reading depth data does not have influence to the result!

Originally posted by CWiC:

What does that have to do with calling glDepthMask(0) ?

helda, are you calling glDepthMask(0) for a specific reason?

[This message has been edited by rgpc (edited 11-06-2002).]

Hm, i’m sorry for misprint. In my previous message must be glDepthMask(0) instead of glDepthTest. Actually i have an application which read the depth buffer, and i just insert glDepthMask(0) before such reading occure and i still able to see normal depth data as expected, not the gray square.

…and use GL_FALSE, not 0 You never know…


how are you reading/drawing the values in the depth buffer?

extraction from my gl.h
/* Boolean */
#define GL_TRUE 1
#define GL_FALSE 0
It seems like helda don’t have interest to this issue any more, but this is good reason to have a chat instead of help…