diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-05-29 16:12:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-05-29 16:51:02 +0400 |
commit | 0780f5915b29ab7102bf1cb8bddd54774161d0d3 (patch) | |
tree | 2f3d08aceeaeb50f0aee1242946f49d73bacd70b /intern/cycles/kernel/kernel_random.h | |
parent | 9e61dcc6b89f21420bf64c25741c3a259c4158ba (diff) |
Fix T39804: cycles smoke domain visible in rendering.
Transparent objects could become subtly visible by the different sampling
patterns for pixels covered and not covered by the object. It still converged
to the right solution but that can take a while. Now we try to use the same
sampling pattern here.
Diffstat (limited to 'intern/cycles/kernel/kernel_random.h')
-rw-r--r-- | intern/cycles/kernel/kernel_random.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index 31cb6ff6abd..ac04b3168a1 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -266,6 +266,19 @@ ccl_device_inline float path_state_rng_1D(KernelGlobals *kg, RNG *rng, PathState return path_rng_1D(kg, rng, state->sample, state->num_samples, state->rng_offset + dimension); } +ccl_device_inline float path_state_rng_1D_for_decision(KernelGlobals *kg, RNG *rng, PathState *state, int dimension) +{ + /* the rng_offset is not increased for transparent bounces. if we do then + * fully transparent objects can become subtly visible by the different + * sampling patterns used where the transparent object is. + * + * however for some random numbers that will determine if we next bounce + * is transparent we do need to increase the offset to avoid always making + * the same decision */ + int rng_offset = state->rng_offset + state->transparent_bounce*PRNG_BOUNCE_NUM; + return path_rng_1D(kg, rng, state->sample, state->num_samples, rng_offset + dimension); +} + ccl_device_inline void path_state_rng_2D(KernelGlobals *kg, RNG *rng, PathState *state, int dimension, float *fx, float *fy) { path_rng_2D(kg, rng, state->sample, state->num_samples, state->rng_offset + dimension, fx, fy); |