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
This commit is contained in:
2021-02-22 00:00:56 +01:00
parent a3f091d7ce
commit af940c68cb

View File

@@ -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 */