diff options
author | Lukas Stockner <lukasstockner97> | 2019-12-08 23:19:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-12-12 15:04:43 +0300 |
commit | 3437c9c3bf3d16a5ae070226d927a3a329239c8c (patch) | |
tree | f7ad2b332a4200caa8d57ac85199ac760fc6bfeb /intern/cycles/kernel/kernel_bake.h | |
parent | 85b7d397f7620b57ce4014ee7b0119eef64578d9 (diff) |
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
Diffstat (limited to 'intern/cycles/kernel/kernel_bake.h')
-rw-r--r-- | intern/cycles/kernel/kernel_bake.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h index 8e5a279e6cd..a349b225abb 100644 --- a/intern/cycles/kernel/kernel_bake.h +++ b/intern/cycles/kernel/kernel_bake.h @@ -39,7 +39,7 @@ ccl_device_inline void compute_light_pass( # endif /* init radiance */ - path_radiance_init(&L_sample, kernel_data.film.use_light_pass); + path_radiance_init(kg, &L_sample); /* init path state */ path_state_init(kg, &emission_sd, &state, rng_hash, sample, NULL); @@ -64,7 +64,7 @@ ccl_device_inline void compute_light_pass( /* sample emission */ if ((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) { float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); - path_radiance_accum_emission(&L_sample, &state, throughput, emission); + path_radiance_accum_emission(kg, &L_sample, &state, throughput, emission); } bool is_sss_sample = false; @@ -118,7 +118,7 @@ ccl_device_inline void compute_light_pass( /* sample emission */ if ((pass_filter & BAKE_FILTER_EMISSION) && (sd->flag & SD_EMISSION)) { float3 emission = indirect_primitive_emission(kg, sd, 0.0f, state.flag, state.ray_pdf); - path_radiance_accum_emission(&L_sample, &state, throughput, emission); + path_radiance_accum_emission(kg, &L_sample, &state, throughput, emission); } # ifdef __SUBSURFACE__ @@ -287,7 +287,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, /* light passes */ PathRadiance L; - path_radiance_init(&L, kernel_data.film.use_light_pass); + path_radiance_init(kg, &L); shader_setup_from_sample( kg, |