1
$\begingroup$

From the sources that I have read about deferred rendering they all mention "handling transparency is hard" without much more information.

However a solution that I see is, handle the scene once without the transparent geometry, once assuming the geometry is fully opaque, then interpolate between the 2 based on the transparency coefficient.

Is this a bad solution because it's slow due to the additional render pass or is it that there is something else I am not seeing?

$\endgroup$
  • 3
    $\begingroup$ This doesn't account for multiple layers of transparent geometry. What happens if i'm looking through a window at another transparent object? $\endgroup$ – PaulHK Feb 22 '18 at 7:57
5
$\begingroup$

PaulHK is right in what he said: you have to consider that there may be more than 2 transparent objects behind each other.

Also, the idea of deferred shading is to render the geometry only once to be more efficient. If you render the geometries multiple times, you lose (part of) your efficiency. Moreover, the lighting is deferred, thus you'd need to do lighting calculations for all your geometries before you can do the correct color calculations from transparency. So what you're really doing is going back to forward shading.

That being said, one solution is to first render any opaque geometry with deferred shading and afterwards render the transparent objects with forward shading, so maybe you weren't too far off. Those transparent objects however shouldn't be affected by too many lights to still render frames "fast".

$\endgroup$
1
$\begingroup$

A fundamental assumption of deferred shading is that there will be only one surface, and therefore only one depth, at a given pixel.

An effect that contradicts that assumption will require some sort of special handling in a deferred renderer. Translucency, because it allows to see through multiple layers, is such an effect and therefore will need its own rendering pass, or use some sort of compromise.

$\endgroup$
  • $\begingroup$ You can use multiple GBuffers instead (Deep GBuffers) to capture multiple layers of transparency; which is still "deferred" shading. $\endgroup$ – Matthias Feb 22 '18 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.