Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are some effects for which I must do multi-pass rendering. I've got the basics set up (FBO rendering etc.), but I'm trying to get my head around the most suitable setup. Here's what I'm thinking...

The framebuffer objects:

  1. FBO 1 has a color attachment and a depth attachment.
  2. FBO 2 has a color attachment.

The render passes:

  1. Render g-buffer: normals and depth (used by outline & DoF blur shaders); output to FBO no. 1.
  2. Render solid geometry, bold outlines (as in toon shader), and fog; output to FBO no. 2. (can all render via a single fragment shader -- I think.)
  3. (optional) DoF blur the scene; output to the default frame buffer OR ELSE render FBO2 directly to default frame buffer.
  4. (optional) Mesh wireframes; composite over what's already in the default framebuffer.

Does this order seem viable? Any obvious mistakes?

share|improve this question
up vote 1 down vote accepted

That's the standard way for it, I would profile your second stage as your performance may decrease with only a large shader with branches. you are mostly bound to one shader in the last stage tho. Use multi target render if possible and again, profile some setups.

share|improve this answer

Depending on your target platforms (e.g. if you're not targeting ios/android) you may wish to take advantage of multi-target rendering, combining your first two passes using an FBO with two color attachments (normals and diffuse or final color, depending on if you're doing deferred lighting or not). Sounds viable though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.