Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.