Jump to content
  • Advertisement
Sign in to follow this  
DJHoltkamp

OpenGL Circular drawing with FBO's

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

Hello, I need to do some circular drawing to achieve an effect where two buffers keep using each other as a source. I had been using two frame buffers bound to textures and then kept switching back and forth but this is very slow on the architecture I am using (its opengl ES -- embedded systems). In the documentation it says that binding to a new framebuffer is expensive so here is my question... Is it legal for a framebuffer to use its own texture when drawing to itself so that I might have both items on the same frame buffer and texture and just keep drawing both sides to eachother? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by DJHoltkamp
Is it legal for a framebuffer to use its own texture when drawing to itself so that I might have both items on the same frame buffer and texture and just keep drawing both sides to eachother?


No, that's undefined behaviour.

Share this post


Link to post
Share on other sites
You may try using just one FBO with 2 attached textures. Specify glDrawBuffer to GL_COLOR_ATTACHMENT_[0/1]_EXT and draw another texture like a quad. You don't need to reactivate FBO this way.

Share this post


Link to post
Share on other sites
Quote:
Original post by HuntsMan
Quote:
Original post by DJHoltkamp
Is it legal for a framebuffer to use its own texture when drawing to itself so that I might have both items on the same frame buffer and texture and just keep drawing both sides to eachother?


No, that's undefined behavior.


Actually it's a pretty well defined behavior, it fails, and throws up an error, something like "framebuffer incomplete" i believe, binding the texture should also fail under some circumstances.

Instead use blending if possible, if you think about it you might be able to do a lot more than you with it than you normally would assume.
Otherwise framebuffer Pingpong is the only way.

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!