From 0deb074f1c09d4e2bf74cd099bce565aea4527bb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 10 Jan 2013 19:28:16 +0000 Subject: [PATCH] Fix #33824: cycles non-progressive render mode did not do correct path termination, leading to too much noise when the min bounce setting was lower than max bounce. --- intern/cycles/kernel/kernel_path.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 6302031475a..532c32896d9 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -486,7 +486,8 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample, #ifdef __NON_PROGRESSIVE__ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray ray, __global float *buffer, - float3 throughput, float min_ray_pdf, float ray_pdf, PathState state, int rng_offset, PathRadiance *L) + float3 throughput, float throughput_normalize, + float min_ray_pdf, float ray_pdf, PathState state, int rng_offset, PathRadiance *L) { #ifdef __LAMP_MIS__ float ray_t = 0.0f; @@ -558,7 +559,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray /* path termination. this is a strange place to put the termination, it's * mainly due to the mixed in MIS that we use. gives too many unneeded * shader evaluations, only need emission if we are going to terminate */ - float probability = path_state_terminate_probability(kg, &state, throughput); + float probability = path_state_terminate_probability(kg, &state, throughput*throughput_normalize); float terminate = path_rng(kg, rng, sample, rng_offset + PRNG_TERMINATE); if(terminate >= probability) { @@ -946,7 +947,8 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam #endif kernel_path_indirect(kg, rng, sample*num_samples + j, bsdf_ray, buffer, - tp*num_samples_inv, min_ray_pdf, bsdf_pdf, ps, rng_offset+PRNG_BOUNCE_NUM, &L); + tp*num_samples_inv, num_samples, + min_ray_pdf, bsdf_pdf, ps, rng_offset+PRNG_BOUNCE_NUM, &L); } } -- 2.28.0