• Advertisement
Sign in to follow this  

depth test and fbo

This topic is 1966 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

I am in the process of implementing early ray termination using multipple interation. My colde is like this:
glClearDepth(1.0); //Set all the depth to the maximum
glBindFramebuffer(GL_FRAMEBUFFER, _framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex_dst, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, _vol_buffer_tex_mult_depth, 0);
///////////////////////Shader to change the depth, draw a quad
glBindFramebuffer(GL_FRAMEBUFFER, 0);

I use: glClearDepth(1.0); glDepthFunc(GL_ALWAYS) to make the shader update the depth buffer.
It works right. The problem I met is when I change glClearDepth(1.0) to glClearDepth(0.0), there is no display anymore. It seems
that, at this case, the first part will fail in the depth test, why? I already used glDepthFunc(GL_ALWAYS) which should pass the test
at anytime. Thanks for any hint.

Share this post

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

  • Advertisement