Fix T71402 EEVEE: Transparent material add volume scattering

This adds correct scattering handling by removing the extra light added
to opaque pass.

Also fix T69062 EEVEE alpha blend and volumetrics
This commit is contained in:
Clément Foucault
2020-01-14 16:47:54 +01:00
parent ba5bbf14f9
commit 39d5d11e02

View File

@@ -934,6 +934,11 @@ void main()
vec3 vol_transmit, vol_scatter;
volumetric_resolve(uvs, gl_FragCoord.z, vol_transmit, vol_scatter);
/* Removes part of the volume scattering that have
* already been added to the destination pixels.
* Since we do that using the blending pipeline we need to account for material transmittance. */
vol_scatter -= vol_scatter * cl.transmittance;
outRadiance = vec4(cl.radiance * vol_transmit + vol_scatter, alpha * holdout);
outTransmittance = vec4(cl.transmittance, transmit * holdout);
# else