0

I recently read that simply switching the render targets of a framebuffer object is much faster than switching framebuffer object.

As extreme as it sounds, does this this mean I should only ever use one framebuffer object and only switchout it's targets?

EDIT: I changed 'swapping' to 'switching' to avoid confusion. By switching I mean binding a new framebuffer in place of the old one. Not to be confused with the SwapBuffers() call used to swap the front- and backbuffers.

6
  • 2
    Where did you read that? Swapping the framebuffer should take no time at all, unless you have a bug in your driver Commented May 22, 2011 at 11:14
  • songho.ca/opengl/gl_fbo.html last paragraph of the overview section. Commented May 22, 2011 at 11:21
  • A framebuffer is something different than a framebuffer object. The article talks about FBOs. Commented May 22, 2011 at 11:34
  • I was under the impression that they both mean the same thing. OpenGL officially calls them framebuffer objects, and I couldn't find anything in the specs about a 'framebuffer'. Commented May 22, 2011 at 11:42
  • In the beginning of the article the differences are explained. Commented May 22, 2011 at 12:51

1 Answer 1

3

EDIT: this answer is probably wrong. Read the comments below.

It's faster to switch framebuffer-attachable textures than switching between framebuffers (FBOs). More here http://www.songho.ca/opengl/gl_fbo.html

There are limits to how many attachments a FBO can have though.

Sign up to request clarification or add additional context in comments.

6 Comments

Ah, so you been switching between textures that are already attached to that framebuffer?
@Hannesh Yes,that's essentially what the article recommends. Haven't done extensive testing though.
It's very interesting how much directly conflicting information there is on the internet. Just another SO answer describes the complete opposite to be true.
This seems unproven. the article linked provides no timing examples and no explanation of why it might be so. Having effectively written an OpenGL driver I can tell you that switching between framebuffers should be faster than switching attachments. The reason is a framebuffer is only complete if a whole set of criteria are true. Everytime you change an attachment all of those criteria need to be checked. On the other hand a framebuffer that has already been checked doesn't need to be checked again. QED switching framebuffers should be faster.
What gman said. From Valve's OpenGL talks and John McDonald/Cass Everitt talks (can't remember if both mentioned it or just one), FBO validation can take a "long" time, whereas switching already prevalidated FBOs is less expensive.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.