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

<p>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.</p>

<p>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".</p>

CC BY-SA 3.0
2018-02-22T08:15:05.907Z
2018-02-22T14:54:24.150Z
2018-02-22T14:54:24.150Z
Tare
<p>A fundamental assumption of deferred shading is that there will be only one surface, and therefore only one depth, at a given pixel.</p>

<p>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.</p>

CC BY-SA 3.0
2018-02-22T18:44:07.040Z
You can use multiple GBuffers instead (Deep GBuffers) to capture multiple layers of transparency; which is still "deferred" shading.
Matthias
CC BY-SA 3.0
2018-02-22T12:19:11.880Z
2018-02-22T12:19:11.880Z
Julien Guertault
<p>From the  sources that I have read about deferred rendering they all mention "handling transparency is hard" without much more information.</p>

<p>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.</p>

<p>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?</p>

CC BY-SA 3.0
2018-02-22T07:57:48.010Z
This doesn't account for multiple layers of transparent geometry. What happens if i'm looking through a window at another transparent object?
PaulHK
<rendering><transparency><deferred-rendering>
Why is this not a proper solution to handling transparency in deferred rendering?
Makogan
# Why is this not a proper solution to handling transparency in deferred rendering?

(Asked by: username_0 on 2018-02-22)

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?

**Tags:** rendering, transparency, deferred-rendering

> **Comments:**
> **username_1**: This doesn't account for multiple layers of transparent geometry. What happens if i'm looking through a window at another transparent object?  

---

## 2 answers

### Answer by username_2 on 2018-02-22. Score: 5 | Accepted answer

username_1 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".


---

### Answer by username_3 on 2018-02-22. Score: 1

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.

> **Comments:**
> **username_4**: You can use multiple GBuffers instead (Deep GBuffers) to capture multiple layers of transparency; which is still "deferred" shading.  

---

