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

This commit is contained in:
Clément Foucault 2019-07-01 19:24:25 +02:00
parent dcf520cdad
commit c2a762c8e6
Notes: blender-bot 2023-02-14 10:37:50 +01:00
Referenced by issue #65771, Volumetric emission no longer works if density of reflective volume is set to zero
1 changed files with 4 additions and 0 deletions

View File

@ -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;