1
\$\begingroup\$

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?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

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