Skip to main content
gamedev.net
🔒 Locked

Visual Depth Buffer!

Started by golgoth Sep 22, 2005 at 12:24 PM 2 replies 550+ views
Original Post
golgoth
golgoth
Hi all! Abstract: I m trying to see what my how depth buffer looks like... when i map it to a ortho plane... it turns out all black... but it does the job calculating shadow map textures... shouldnt i see a gray scale image or do i need some kind of special trick to make it human eye visible? codes: create a GL_DETH_COMPONENT texture ... glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); glShadeModel(GL_FLAT); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); GenerateTexture(in_texture); // bind if ID == 0 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, in_width, in_height); // unset then map it to a plane later on the pipeline... thx
golgoth
golgoth
o

glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);

doesnt write info to color buffer... i see...

so no texture could be output from the depth buffer... but can we visualize the depth information ? how ?

im trying to get something like:

http://www.gamedev.net/reference/articles/article2193.asp

in opengl ofcourse!

thx
Dobbs
Dobbs
A combination of glReadPixels and glDrawPixels will do it, but it's slow reading from the depth buffer into memory.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.