diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-29 18:27:24 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-29 18:27:24 +0400 |
commit | 238f3a7d343875992f5b9c2ad657f2bc6f148938 (patch) | |
tree | ddc809124879b7eef15a708470f9de6bce43118a /intern/cycles/kernel | |
parent | 996f2cd8b2362779e16fdfbd3913231c38e4a623 (diff) |
Cycles: seed value to get different noise values from renders, there was a patch
for this but I've implemented it differently.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_random.h | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index 13cf4df8b8c..df876e6f726 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -128,11 +128,15 @@ __device_inline void path_rng_init(KernelGlobals *kg, __global uint *rng_state, *rng = sobol_lookup(bits, frame, x, y, &px, &py); + *rng ^= kernel_data.integrator.seed; + *fx = size * (float)px * (1.0f/(float)0xFFFFFFFF) - x; *fy = size * (float)py * (1.0f/(float)0xFFFFFFFF) - y; #else *rng = rng_state[x + y*kernel_data.cam.width]; + *rng ^= kernel_data.integrator.seed; + *fx = path_rng(kg, rng, sample, PRNG_FILTER_U); *fy = path_rng(kg, rng, sample, PRNG_FILTER_V); #endif @@ -159,6 +163,8 @@ __device void path_rng_init(KernelGlobals *kg, __global uint *rng_state, int sam /* load state */ *rng = rng_state[x + y*kernel_data.cam.width]; + *rng ^= kernel_data.integrator.seed; + *fx = path_rng(kg, rng, sample, PRNG_FILTER_U); *fy = path_rng(kg, rng, sample, PRNG_FILTER_V); } diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index d8270b2cd71..46cdcd1151e 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -362,7 +362,6 @@ typedef struct KernelIntegrator { int num_all_lights; float pdf_triangles; float pdf_lights; - float pdf_pad; /* bounces */ int min_bounce; @@ -380,6 +379,9 @@ typedef struct KernelIntegrator { /* caustics */ int no_caustics; float blur_caustics; + + /* seed */ + int seed; } KernelIntegrator; typedef struct KernelBVH { |