Jump to content
  • Advertisement
Sign in to follow this  
Endar

multi-pass rendering?

This topic is 4596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!