Jump to content
  • Advertisement
Sign in to follow this  
golgoth

Visual Depth Buffer!

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
A combination of glReadPixels and glDrawPixels will do it, but it's slow reading from the depth buffer into memory.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!