Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-01-14 18:47:54 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-01-14 18:55:11 +0300
commit39d5d11e022a39383103f1e46dd74dbf5a36a850 (patch)
tree62d493afc2b45e3cc39cbe1f436d142940fca903 /source/blender/draw/engines/eevee/shaders
parentba5bbf14f92bfb87d8d42b5e4c68a2b7864c90cf (diff)
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
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r--source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl5
1 files changed, 5 insertions, 0 deletions
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