diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-07-06 01:27:42 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-07-06 01:28:13 +0300 |
commit | f67c331bedd5bfd0a70f3d9774cf71c8267f7081 (patch) | |
tree | 9a6b0231c349d5be59f2c18faf76287014258007 /source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl | |
parent | cb554981594cd734f877a2ff78daec6622ecee83 (diff) |
Eevee: Volumetrics: Avoid light leaking if last step is going trough geometry.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl index 56fa126e490..a99769c7fec 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_frag.glsl @@ -181,7 +181,7 @@ void main() // float rand = (1.0 / 16.0) * float(((int(gl_FragCoord.x + gl_FragCoord.y) & 0x3) << 2) + (int(gl_FragCoord.x) & 0x3)); float dist = volume_start; for (float i = 0.5; i < VOLUMETRIC_INTEGRATION_MAX_STEP && i < (volume_integration_steps - 0.1); ++i) { - float new_dist = find_next_step(rand, i); + float new_dist = max(max_z, find_next_step(rand, i)); float step = dist - new_dist; /* Marching step */ dist = new_dist; @@ -227,7 +227,7 @@ void main() /* Evaluate transmittance to view independantely */ transmittance *= Tr; - if (dist < max_z) + if (dist <= max_z) break; } |