diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-07-01 20:24:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-07-01 21:05:13 +0300 |
commit | c2a762c8e6e529a36b0e8cff5ac9339e084829b4 (patch) | |
tree | afe46211cfa13d2d9472c023d16e8cc4624e6b95 /source/blender/draw/engines/eevee/shaders | |
parent | dcf520cdad7903acb911a3da2cd62064a79208b5 (diff) |
Fix T65771 Eevee: Volume Emission not working if density is zero
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl | 4 |
1 files changed, 4 insertions, 0 deletions
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; |