Combining deferred rendering with other techniques

Started by
3 comments, last by kauna 12 years, 3 months ago
Hi all,
I've been working on a standard deferred rendering technique using G-buffers and a second mini-pass where the g-buffer textures are combined for the final image.

My question is, what is the best way of combining this technique with say, a completely different rendering technique that doesn't use G-buffers? For example, rendering the skybox/quad/dome, or rendering water, etc?

Would I want to use a stencil buffering technique, or some sort of alpha blending to combine the final deferred rendered image with the environmental renderings? My concern is that deferred rendering doesn't really have an alpha channel in the g-buffered textures, so how do I ensure I don't overwrite something like the skybox that lives at max-depth?
Advertisement
You draw all that stuff after the shading (mini) pass.

Hopefully your depth buffer is preserved (or restored) so you can just enable depth testing as usual.

Then draw all your transparent objects with forward shading.

You draw all that stuff after the shading (mini) pass.

Hopefully your depth buffer is preserved (or restored) so you can just enable depth testing as usual.

Then draw all your transparent objects with forward shading.


Don't the G-buffer quads in the minipass overlap the entire screen? How would the depth testing work then unless you explicitly write depths for the g-buffer quad's pixels to your depth buffer?
The quads, or other geometry, drawn for the lighting does not need to write to the depth buffer. you can turn off depth writes. or you can turn on depth writes and write the value you stored in your depth texture during the g-buffer creation pass, restoring the depth buffer.

it really just depends on how you have things set up and how clever you make it.

Alternatively, if you're just trying to render particles on top, you can use your depth texture from the g-buffer to have your particle shader fade out as the particle approaches the stored depth value. this is called soft particles. It will also allow you to render particles to a lower resolution for performance reasons.
Hi,

I use a cube map for the sky. I don't draw the sky box separately, but in the phase where I combine the lighting and albedos together. I can sample it directly with the world space view frustum rays.

Cheers!

This topic is closed to new replies.

Advertisement