glFramebufferTexture2D performance
Asked Answered
R

3

5

I'm doing heavy computation using the GPU, which involves a lot of render-to-texture operations. It's an iterative computation, so there's a lot of rendering to a texture, then rendering that texture to another texture, then rendering the second texture back to the first texture and so on, passing the texture through a shader each time.

My question is: is it better to have a separate FBO for each texture I want to render into, or should I rather have one FBO and bind the target texture using glFramebufferTexture2D each time I want to change render target?

My platform is OpenGL ES 2.0 on the iPhone.

Romanov answered 14/6, 2010 at 7:39 Comment(0)
I
6

On the iPhone implementation, it is inexpensive to change the attachment, assuming the old and new textures are the same dimensions/format/etc. Otherwise, the driver has to do some additional work to reconfigure the framebuffer.

Inventor answered 19/6, 2010 at 2:28 Comment(0)
C
3

AFAIK, better performance is achieved by using only one FBO, and changing the texture attachments as necessary.

Caramelize answered 14/6, 2010 at 11:43 Comment(2)
Do you have any resources that support this?Romanov
http.download.nvidia.com/developer/presentations/2005/GDC/… Slide 28 onwards.Caramelize
C
0

The best way is to do benchmark.

Calfee answered 28/11, 2016 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.