[Bf-blender-cvs] [39d5d11e022] blender-v2.82-release: Fix T71402 EEVEE: Transparent material add volume scattering
Clément Foucault
noreply at git.blender.org
Tue Jan 14 16:55:25 CET 2020
Commit: 39d5d11e022a39383103f1e46dd74dbf5a36a850
Author: Clément Foucault
Date: Tue Jan 14 16:47:54 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rB39d5d11e022a39383103f1e46dd74dbf5a36a850
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
===================================================================
M source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
===================================================================
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
index b9a971570df..359e6fe4cc2 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
@@ -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
More information about the Bf-blender-cvs
mailing list