[Bf-blender-cvs] [c2a762c8e6e] master: Fix T65771 Eevee: Volume Emission not working if density is zero

Clément Foucault noreply at git.blender.org
Mon Jul 1 20:05:16 CEST 2019


Commit: c2a762c8e6e529a36b0e8cff5ac9339e084829b4
Author: Clément Foucault
Date:   Mon Jul 1 19:24:25 2019 +0200
Branches: master
https://developer.blender.org/rBc2a762c8e6e529a36b0e8cff5ac9339e084829b4

Fix T65771 Eevee: Volume Emission not working if density is zero

===================================================================

M	source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl

===================================================================

diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
index e756cafba52..acd1e58ff97 100644
--- a/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
@@ -48,6 +48,10 @@ void main()
     float cell_depth = volume_z_to_view_z((float(i) + 1.0) / tex_size.z);
     float ray_len = orig_ray_len * cell_depth;
 
+    /* Emission does not work of there is no extinction because
+     * Tr evaluates to 1.0 leading to Lscat = 0.0. (See T65771) */
+    s_extinction = max(vec3(1e-7) * step(1e-5, Lscat), s_extinction);
+
     /* Evaluate Scattering */
     float s_len = abs(ray_len - prev_ray_len);
     prev_ray_len = ray_len;



More information about the Bf-blender-cvs mailing list