switching fbo rendering: fastest way ?


What is the fastest:
-switching multiple FBO (with one texture for each) using glBindFramebufferEXT()
-switching associated texture (with only one FBO) using glFramebufferTexture2DEXT() ?

The result seems the same to me, but I wonder if one method has performance impact compared to the other…

thanks !

I don’t think so, not a lot anyway.
Theoreticly they should be the same, but i could be horribly wrong.

Use glBindFramebufferEXT. That’s the reason why we have a model using objects. Each object contains a complete state that can be prevalidated to some degree. For current hardware the difference may be relatively small, but for future hardware I would expect the difference to be bigger. It may not be immediately obvious, but FBO is structured in a way that’s somewhat similar to how DX10 handles render target states. Of course, if the bottleneck is rendering it probably won’t matter.

I use glBindFramebufferEXT because it’s how the extension is meant to be used, just like you don’t reload your texture objects content but bind different textures, you should use extensions in the spirit they are given. (And so the spirit in which the IHV will optimise their drivers.)

Well my 0.02€

Ok, I was asking that because my render scheme is a ping-pong between 2 textures (more than 6 pass) and I didn’t saw the needs for numerous FBO if I could just switch the texture binding of one. So I’ll create 2 FBO and attach each one a texture, and switch FBO context during my ping-pong…

However another part of my rendering process need to write to different mipmap level… This time I won’t able to escape the texture switch inside the FBO.