Jump to content

  • Log In with Google      Sign In   
  • Create Account

Combining deferred rendering with other techniques


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 magicstix   Members   -  Reputation: 191

Like
0Likes
Like

Posted 14 January 2012 - 04:04 PM

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?

Sponsor:

#2 bzroom   Members   -  Reputation: 646

Like
1Likes
Like

Posted 14 January 2012 - 04:13 PM

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.

#3 magicstix   Members   -  Reputation: 191

Like
0Likes
Like

Posted 14 January 2012 - 04:52 PM

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?

#4 bzroom   Members   -  Reputation: 646

Like
1Likes
Like

Posted 14 January 2012 - 05:06 PM

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.

#5 kauna   Crossbones+   -  Reputation: 2514

Like
0Likes
Like

Posted 18 January 2012 - 01:44 AM

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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS