Sign in to follow this  

Deferred Rendering and Transparent Objects

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

Hello everybody,

I am researching about deferred rendering and especially the handling of transparent objects. I know the "easy" way to do it by rendering them in a separate pass using forward lighting, however could it be possible to integrate them in the deferred pass using an order independent transparency technique such as depth peeling or stochastic transparency?

I would like your views on this :)
Cheers

Share this post


Link to post
Share on other sites
I wouldn't say it was the "easy" way, but rather the only way. At least the only way that makes any practical sense.

There is inferred rendering and plain old screen door transparency (filtering optional), but those techniques obviously have many problems. Namely quality and the number of transparent layers. Then there is the deep gbuffer approach, which suffers from a limited number of transparent layers and also a high memory consumption and bandwidth usage.

Stochastic transparency is a nice concept, but I don't think its close to being practical. If my understanding is correct, it would require a lot of memory and most likely several render passes for noiseless images. My guess is that you would never see playable frame rates on current hardware.

Share this post


Link to post
Share on other sites
but if you use order independent transparency, why not shade them forward? then you just store the color (and sometimes depth) per layer, if you want to shade transparent objects the deferred way, you have to write out a gbuffer for every layer, this could be quite expensive.

In my opinion, for transparent passes, one of the techs described [url=http://www.gamedev.net/topic/619525-light-index-buffer/]here[/url] is the way to go :)

Share this post


Link to post
Share on other sites
Light indexing is probably the most interesting.
Rendering using OIT could be possible in forward rendering, but that defeats the purpose of the OIT, doesn't it? I wanted to use it to integrate it in the deferred pass somehow.

Share this post


Link to post
Share on other sites
I put together a [url="http://www.john-chapman.net/content.php?id=13"]hybrid method[/url], rendering transparent/alpha blended materials in a separate pass(es) using deferred shading. It's a bit more flexible than a using forward rendering and has the bonus of unifying the lighting between the opaque and transparent steps. As for order-independance...ShaderX7 describes an interlacing method for deferred rendering transparency; it could be used to do OIT but is very limiting on the number of per-pixel transparent layers.

Share this post


Link to post
Share on other sites
[quote name='alkisbkn' timestamp='1330019673' post='4915918']
Rendering using OIT could be possible in forward rendering, but that defeats the purpose of the OIT, doesn't it?
[/quote]

Not really. OIT has nothing to do with deferred shading. They are completely orthogonal concepts.

Share this post


Link to post
Share on other sites
In my implementation (seen in my journals) I was able to implement very simple transparency accidentily though basic alpha channels. But i have multiple layer draws due to having to draw a tilemap and overlaying sprites. Shading doesnt apply fully (i.e., the underlying material will not be shaded) since the material is overwritten with the transparent sprite and thus its material now defines the area of the color/normal buffer. Though, if adding the two color channels when the alpha channel is detected to be "transparent" when defining the normal buffer, the shading buffer should still be correctly applied for the "occluded" material since the normal buffer took transparency into account. That would require per-pixel rasterization when defining the normal buffer, but i think it would be doable. (there is probably a technique name for this, i just dont know it)

Share this post


Link to post
Share on other sites
[quote name='alkisbkn' timestamp='1330019673' post='4915918']
Rendering using OIT could be possible in forward rendering, but that defeats the purpose of the OIT, doesn't it?.
[/quote]not really, OIT solves the problem of the proper order of alpha fragments/pixels. it's needed for proper transparency even without any lighting. check out
http://www.youtube.com/watch?v=j_I1fTG-sSo
I think the only shading comes from a fresnel term for the blend intensity.

the solution you want to choose is very dependant on what you're actually rendering. having just one layer of glass (e.g. window) might work with simple MSAA and a custom sample mask where you writ every second pixel in case of transparency. it's simple to implement, fits naturally into the deferred shading pipeline with all the other effects. particles on the other side won't work with satisfying results with this solution. but particles can be shaded per vertex (or at least you can select like the 4 most contributing light sources per particle/vertex and use those in the usually forward rendering fashion (but that won't work for big windows that might be affected by several tiny lightsources. For tiny objects (e.g. a bottle), you might get away with cubemaps only that have lighting backed in etc.

And lighting + transparent objects are not the only issues you might have, you also want fog (even fog areas?) to work fine, mirrors (e.g. a water plane)? you might want to have shadows + projectors, decals?

and on top, you need to be very careful regarding performance, while you have an exact limit of solid pixels on the screen (-> your resolution), transparent objects can easily add 10x the cost. you might become limited to e.g. the fillrate, which isn't that common in solid deferred rendering. you might also process a lot of fully transparent or overwritten pixel. that's the main reason why most games nowadays have very few transparent objects.

Share this post


Link to post
Share on other sites

This topic is 2118 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this