• Advertisement
Sign in to follow this  

[fixed] glclear can't clear the frame buffer if there is attached a depth buffer

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

biggrin.png
[attachment=20085:1.png]
after glclear,the color target is always black..
why the glclear is not working?sad.png


-----------------------------------------
--------------------------------------------------------------
the reason is the depth-stencil buffer is not attach to frame buffer valid.

Share this post


Link to post
Share on other sites
Advertisement

not fixed.

i want to know what state can cause opengl clear fbo failure.

Edited by db123

Share this post


Link to post
Share on other sites

You're mixing GL_EXT_framebuffer_object calls with GL_ARB_framebuffer_object calls.

 

Don't do that.

 

As the specification for GL_ARB_framebuffer_object says:

 

Undefined behavior results when using FBOs created by EXT commands through non-EXT interfaces, or vice-versa.

 

First of all, get your code into a state where it may be expected to work, i.e is supported by the specification.  Then see if you still have problems.

Share this post


Link to post
Share on other sites

You're mixing GL_EXT_framebuffer_object calls with GL_ARB_framebuffer_object calls.

 

Don't do that.

 

As the specification for GL_ARB_framebuffer_object says:

 

Undefined behavior results when using FBOs created by EXT commands through non-EXT interfaces, or vice-versa.

 

First of all, get your code into a state where it may be expected to work, i.e is supported by the specification.  Then see if you still have problems.

 

i have clear all the EXT from my code, but there is no change.

 

i have a new question, could you help me ?

http://www.gamedev.net/topic/653731-cant-bind-a-texture-depth-buffer-to-a-frame-bufferwith-demo-codes/

Share this post


Link to post
Share on other sites

Also, the sequence of GL calls does not give a clear indication as to how the code is structured on the CPU side. If possible, could you post the actual source code segments? I'm seeing duplicated calls to set the FBO color attachment and depth attachment ( renderbuffer ). Do you have check in place for the values return from checking the FBO status? If the FBO is configured correctly with the correct attachments and cleared with the correct flags, then everything should work fine.

 

Share this post


Link to post
Share on other sites

Also, the sequence of GL calls does not give a clear indication as to how the code is structured on the CPU side. If possible, could you post the actual source code segments? I'm seeing duplicated calls to set the FBO color attachment and depth attachment ( renderbuffer ). Do you have check in place for the values return from checking the FBO status? If the FBO is configured correctly with the correct attachments and cleared with the correct flags, then everything should work fine.

 

thanks for your help.

i have fix this error.

because i have set Depth write to false, when i clear the depth, it will failure.

biggrin.png

Share this post


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

  • Advertisement