Fix #36620: sss + indirect light rendering artifacts, due to wrong correlation in

the random numbers.
This commit is contained in:
Brecht Van Lommel 2013-09-01 14:10:40 +00:00
parent 902e1d0b53
commit f3252c261d
2 changed files with 4 additions and 4 deletions

@ -791,10 +791,10 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
hit_state.flag |= PATH_RAY_BSSRDF_ANCESTOR;
if(kernel_path_integrate_lighting(kg, rng, sample, num_samples, &bssrdf_sd[hit],
&tp, &hit_min_ray_pdf, &hit_ray_pdf, &hit_state, rng_offset, &L, &hit_ray, &hit_ray_t)) {
&tp, &hit_min_ray_pdf, &hit_ray_pdf, &hit_state, rng_offset+PRNG_BOUNCE_NUM, &L, &hit_ray, &hit_ray_t)) {
kernel_path_indirect(kg, rng, sample, hit_ray, buffer,
tp, num_samples, num_samples,
hit_min_ray_pdf, hit_ray_pdf, hit_state, rng_offset+PRNG_BOUNCE_NUM, &L);
hit_min_ray_pdf, hit_ray_pdf, hit_state, rng_offset+PRNG_BOUNCE_NUM*2, &L);
/* for render passes, sum and reset indirect light pass variables
* for the next samples */
@ -1265,7 +1265,7 @@ __device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, int
kernel_branched_path_integrate_lighting(kg, rng, sample*num_samples + j,
aa_samples*num_samples,
&bssrdf_sd[hit], throughput, num_samples_inv,
ray_pdf, ray_pdf, state, rng_offset, &L, buffer);
ray_pdf, ray_pdf, state, rng_offset+PRNG_BOUNCE_NUM, &L, buffer);
}
}

@ -126,7 +126,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
max_samples = max(max_samples, max(ao_samples, max(mesh_light_samples, subsurface_samples)));
}
max_samples *= (max_bounce + transparent_max_bounce + 2);
max_samples *= (max_bounce + transparent_max_bounce + 3);
int dimensions = PRNG_BASE_NUM + max_samples*PRNG_BOUNCE_NUM;
dimensions = min(dimensions, SOBOL_MAX_DIMENSIONS);