multi-pass rendering?

Started by
3 comments, last by GameDev.net 18 years ago
I've seen a lot of people talking about whether they should render this or that in a single pass or 2 passes, etc, etc. What exactly is meant by a pass? Is it when you have a bunch of settings set in your renderer that will render everything normally, so you render the scene, then you change the renderer settings and then render another time to get something different? Like, a single pass to draw the geometry, textures and lighting, and then another pass to draw reflections and another to draw shadows? Am a close or really way off?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Advertisement
Quote:Original post by Endar
Am a close or really way off?
Close :-)

I'm not really up to speed on vertex and pixel shaders (my primary interests are elsewhere), but as far as fixed-function goes you basically have multi-pass and multitexture. Different aspects of a surface (texture, lightmap, decals, etc.) can be rendered in multiple passes, or in some cases combined into single multitexture passes. This is how Quake 3-style graphics were implemented, so as you can see you can get a lot of mileage out of these techniques. I don't know if or how that's changed with the advent of pixel and vertex shaders, but I'm sure others can tell you all about that.
You may need multiple passes to render one effect depending on the target hardware. On my GeForce 2, I only have 2 texture units so I need 2 passes to do simple bump mapping. If I want an ambient map and a reflection map, it is one more pass. To add stencil shadows, as I don't have the two side stencil extension, I have to add one Z pass and 2 passes for front and back faces. Now, I added a glow effect that need one more pass in a smaller resolution... with a modern hardware, you can do all this in just a few passes...
Uh, okay.

Is the whole multi pass thing run from the dev's code? Or is it done automatically API side?

I mean, just say I have a function 'render' for my scene graph that calls 'render' for each object. If I want multi pass, am I going to have to call that more that once a frame, but say if I wanted to have reflections, would I call 'render' once with the stencil buffer disabled, and then once with the stencil buffer enabled to draw the reflections?
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
Quote:Original post by Endar
Uh, okay.

Is the whole multi pass thing run from the dev's code? Or is it done automatically API side?

I mean, just say I have a function 'render' for my scene graph that calls 'render' for each object. If I want multi pass, am I going to have to call that more that once a frame, but say if I wanted to have reflections, would I call 'render' once with the stencil buffer disabled, and then once with the stencil buffer enabled to draw the reflections?


Multipass is manual. You have to set up each rendering phase and call the rendering functions every time. Sometimes you even have to switch textures and set other options between two passes. This is one of the reasons why it's relatively slow compared to single pass shaders. In many cases, you have to draw a scene multiple times over and over until you get all passes done, which results in lower framerates. For shaderless hardware the only choice is multipass, but for modern cards a well designed shader is much faster.

Viktor

This topic is closed to new replies.

Advertisement