Jump to content

  • Log In with Google      Sign In   
  • Create Account

Depth Testing in Deferred Rendering


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
1 reply to this topic

#1 hondrion   Members   -  Reputation: 139

Like
0Likes
Like

Posted 15 August 2012 - 07:35 PM

Final edit: Managed to resolve the issue, apparently my depth calculation for the particles were wrong

Hello,

I am working on a deferred rendering engine on XNA, and I'm stuck on how to perform depth testing when it comes to combining transparent objects and particles on the final render target.

Right now, I render my opaque geometry on the GBuffer, whilst packing the linear depth into a ARGB surface.

What would be the ideal way to draw the transparent geometry on the scene? I thought of sampling the opaque depth, calculating the depth of the particle, and drawing or clipping depending on the sampled depth, but I couldn't make it work so far.

Thanks in advance!
Edit: what I'm trying to prevent (particles are behind the curtain in here)
Posted Image

spawner is in the center
Posted Image

Edited by hondrion, 15 August 2012 - 08:21 PM.


Sponsor:

#2 Seabolt   Members   -  Reputation: 633

Like
2Likes
Like

Posted 16 August 2012 - 11:12 AM

So the standard approach is to perform a standard forward rendering pass with transparent geometry.

This is because even if you were to perform your own depth testing on the pixels, (which would be slow), the geometry behind it wouldn't be lit properly, causing your color to not be accurate. Even if you were to do a separate G-Buffer for transparent data and blend the two, you'd have the same issue with transparency overlaying each other.

The best way so far is to render out your deferred opaque scene, blit it into the back-buffer (or equivalent), then render your transparent geometry on top of it. This usually means that lighting will be a little off for transparent data, but that's the price we pay.

You could also look into Inferred Rendering, which allows transparency (sort of) in a deferred-like structure.
Perception is when one imagination clashes with another




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