PDA

View Full Version : multipass rendering algorithms and frameworks



strattonbrazil
10-27-2011, 11:05 PM
I was wondering if I could get a few suggestions of various algorithms that require multiple passes to complete their goal? By multiple passes, I mean the same geometry is sent down multiple times. Shadow mapping might be an example, or many refraction/reflection related techniques.

Also, are there any frameworks that actually abstract these multiple passes? I know frameworks like Stanford's RTSL or the Ashli framework break up multipasses for shaders with a large number of outputs, but I'm thinking more along the lines of "surface" shaders as the Frostbite engine supposedly does or the Unity "surface" shader by abstracting the vertex/fragment separation away from the artist. I don't think this covers multipass to a huge extent besides transparency, but just as an example of extracting part of the process.

As an example, there's a scene with a lambertian terrian of geometries and water-shader for a lake. The water shader might implement some kind of refraction that required depth/color/normals of what it was rendering over as a reference image that it couldn't write to. So this shader might have a "render separate" toggle that means to render other geometry first and might have "requiresNormals, requiresColors, requiresDepth" flags. I know a lot of languages have been written to abstract GLSL code specifically from vertex/shader generation, but I'm wondering how many frameworks actually support passes.

thokra
10-28-2011, 05:08 AM
My suggestions:

a) any renderer involving a z-prepass
b) deferred renderers (classic or light pre-pass)

The light pre-pass can actually be implemented using

a) a z-prepass
b) a pass for rendering light attributes
c) normals material pass with lighting reconstruction