Fix T54420: too much volume render noise with multiple volume objects.

Random numbers for step offset were correlated, now use stratified samples
which reduces noise as well for some types of volumes, mainly procedural
ones where the step size is bigger than the volume features.
This commit is contained in:
Brecht Van Lommel
2018-03-26 12:13:36 +02:00
parent 3c45fdd171
commit a7aee250b8
4 changed files with 61 additions and 36 deletions

View File

@@ -60,8 +60,6 @@ ccl_device_inline void path_state_init(KernelGlobals *kg,
if(kernel_data.integrator.use_volumes) {
/* Initialize volume stack with volume we are inside of. */
kernel_volume_stack_init(kg, stack_sd, state, ray, state->volume_stack);
/* Seed RNG for cases where we can't use stratified samples .*/
state->rng_congruential = lcg_init(rng_hash + sample*0x51633e2d);
}
else {
state->volume_stack[0].shader = SHADER_NONE;