I know frame-buffers are not textures themselves, but they do contain a texture, given they are set up correctly, which I believe mine are, as:


returns true.

The reason I am using multiple frame-buffers is so that I can perform some post-processing on individual objects/layers - is this even a best-practice approach?. So I render to a bunch of textures, and to not end up with a black screen, due to never rendering to the default frame-buffer, I need to somehow combine the frame-buffers/textures into the default frame-buffer.

My naive approach would be to bind the default frame-buffer and then just make a simple shader-program that would write each texture back to the screen.

This seems like a task that could be optimized through some built-in function specially for this as it must be a standard thing now'a'days, so what is the correct way to combine a bunch of frame-buffers/textures into one (the default frame-buffer)?


1 Answer 1


Sorry to break it to you, but if you're using a shader based pipeline (as opposed to fixed functionality), then your "naive" approach is the standard approach.

Deferred rendering, which most modern graphics engines have adopted, involves rendering various aspects of the scene to different textures. Typically things such as the normals, depth, diffuse and specular albedo. They are then sampled at the next stage, to calculate per-pixel lighting. It might be drawn multiple times to framebuffers, and to multiple textures, to implement things like SSAO, bloom, field of depth, and so on. Even if it's something simple like an additive blend, it's usually done with a shader.

So go ahead and use as many textures and FBOs as you need, but only as many as you need. Moving around lots of texture data will have an impact on performance, so whenever possible, try to combine post-processing steps to reduce the number of passes you need to make.

  • \$\begingroup\$ So in the end-step I just write all the final post-processed images to the frame? Is it possible to skip to vertex part and just go directly to a full-screen fragment-shader? \$\endgroup\$ Commented Jan 28, 2014 at 0:48
  • \$\begingroup\$ Yes to the first question. Not sure what you mean by skipping? You're going to want to draw a full-screen quad to get the final texture on screen. \$\endgroup\$
    – Fault
    Commented Jan 28, 2014 at 1:03
  • \$\begingroup\$ Okay thanks. I was just wondering if there was a built-in shortcut to do full-screen drawing/generating the 4 vertecies, maybe by leaving out the vertex-shader, but it all seems very straight forward, exactly the same way as always. Thank, I'll mark this as answered. \$\endgroup\$ Commented Jan 28, 2014 at 1:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .