diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-22 02:00:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-22 02:22:20 +0300 |
commit | af940c68cbed7e840d6ae58f2645ff12ed6abffb (patch) | |
tree | 336ad913bc22f2bbc0f8f9a7eb76a686abae86b9 /intern/cycles/kernel/kernel_volume.h | |
parent | a3f091d7ceda77181422625135225e55afa612c8 (diff) |
Fix Cycles world volume scattering missing light in some cases
With very large distances there were precision / overflow errors, normalize
the average albedo to avoid that. This was causing test failures on macOS
Arm, but also other architectures had slightly wrong results.
Ref T78710
Diffstat (limited to 'intern/cycles/kernel/kernel_volume.h')
-rw-r--r-- | intern/cycles/kernel/kernel_volume.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_volume.h b/intern/cycles/kernel/kernel_volume.h index 2e73da166b9..e46b0436107 100644 --- a/intern/cycles/kernel/kernel_volume.h +++ b/intern/cycles/kernel/kernel_volume.h @@ -840,7 +840,7 @@ ccl_device void kernel_volume_decoupled_record(KernelGlobals *kg, /* compute average albedo for channel sampling */ if (closure_flag & SD_SCATTER) { - accum_albedo += dt * safe_divide_color(coeff.sigma_s, sigma_t); + accum_albedo += (dt / ray->t) * safe_divide_color(coeff.sigma_s, sigma_t); } /* compute accumulated transmittance */ |