Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

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

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
6 replies to this topic

#1 db123   Members   

222
Like
0Likes
Like

Posted 22 February 2014 - 11:54 PM

biggrin.png
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.

#2 db123   Members   

222
Like
0Likes
Like

Posted 23 February 2014 - 12:31 AM

not fixed.

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


Edited by db123, 23 February 2014 - 12:58 AM.


#3 db123   Members   

222
Like
0Likes
Like

Posted 23 February 2014 - 01:37 AM

if i do not attach the depth buffer,clear works ...



#4 mhagain   Members   

13148
Like
0Likes
Like

Posted 23 February 2014 - 05:47 AM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#5 db123   Members   

222
Like
0Likes
Like

Posted 23 February 2014 - 07:42 AM

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/



#6 cgrant   Members   

1785
Like
0Likes
Like

Posted 23 February 2014 - 07:48 AM

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.

 



#7 db123   Members   

222
Like
0Likes
Like

Posted 23 February 2014 - 08:03 AM

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






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.