PDA

View Full Version : depth buffer



helda
11-05-2002, 03:36 AM
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

helda

dawn
11-05-2002, 03:50 AM
glDepthMask(0) = read-only (as you said) = no write = buffer empty (no values are written there) = empty bitmap

helda
11-05-2002, 04:14 AM
but when i first draw my scene and then set the buffer read only, the depth information should be in the buffer?

CWiC
11-05-2002, 04:42 AM
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!

rgpc
11-06-2002, 03:49 PM
Originally posted by CWiC:
[B]glDepthTest(GL_FALSE) DOES NOT PREVENT you from READING ACTUAL DEPTH DATA!!!

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).]

CWiC
11-06-2002, 09:33 PM
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.

knackered
11-06-2002, 11:54 PM
...and use GL_FALSE, not 0 http://www.opengl.org/discussion_boards/ubb/wink.gif You never know...

exn2002
11-08-2002, 10:07 AM
helda,

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

CWiC
11-08-2002, 12:09 PM
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...