From 3437c9c3bf3d16a5ae070226d927a3a329239c8c Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Sun, 8 Dec 2019 21:19:37 +0100 Subject: Cycles: perform clamping per light contribution instead of whole path With upcoming light group passes, for them to sum up correctly to the combined pass the clamping must be more fine grained. This also has the advantage that if one light is particularly noisy, it does not diminish the contribution from other lights which do not need as much clamping. Clamp values on existing scenes will need to be tweaked to get similar results, there is no automatic conversion possible which would give the same results as before. Implemented by Lukas, with tweaks by Brecht. Part of D4837 --- intern/cycles/kernel/kernel_path_surface.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'intern/cycles/kernel/kernel_path_surface.h') diff --git a/intern/cycles/kernel/kernel_path_surface.h b/intern/cycles/kernel/kernel_path_surface.h index a32690d51eb..ba48c0bdfc4 100644 --- a/intern/cycles/kernel/kernel_path_surface.h +++ b/intern/cycles/kernel/kernel_path_surface.h @@ -121,8 +121,14 @@ ccl_device_noinline_cpu void kernel_branched_path_surface_connect_light( if (has_emission) { if (!blocked) { /* accumulate */ - path_radiance_accum_light( - L, state, throughput * num_samples_inv, &L_light, shadow, num_samples_inv, is_lamp); + path_radiance_accum_light(kg, + L, + state, + throughput * num_samples_inv, + &L_light, + shadow, + num_samples_inv, + is_lamp); } else { path_radiance_accum_total_light(L, state, throughput * num_samples_inv, &L_light); @@ -250,7 +256,7 @@ ccl_device_inline void kernel_path_surface_connect_light(KernelGlobals *kg, if (has_emission) { if (!blocked) { /* accumulate */ - path_radiance_accum_light(L, state, throughput, &L_light, shadow, 1.0f, is_lamp); + path_radiance_accum_light(kg, L, state, throughput, &L_light, shadow, 1.0f, is_lamp); } else { path_radiance_accum_total_light(L, state, throughput, &L_light); -- cgit v1.2.3