• Advertisement
Sign in to follow this  

Combining deferred rendering with other techniques

This topic is 2192 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

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?

Share this post


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

Share this post


Link to post
Share on other sites
[quote name='bzroom' timestamp='1326579189' post='4902781']
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.
[/quote]

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?

Share this post


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

Share this post


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

Share this post


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

  • Advertisement