Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_jitter.h
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | ccl_device_inline float cmj_randfloat(uint i, uint p) | ||||
| return cmj_hash(i, p) * (1.0f / 4294967808.0f); | return cmj_hash(i, p) * (1.0f / 4294967808.0f); | ||||
| } | } | ||||
| ccl_device_inline float cmj_randfloat_simple(uint i, uint p) | ccl_device_inline float cmj_randfloat_simple(uint i, uint p) | ||||
| { | { | ||||
| return cmj_hash_simple(i, p) * (1.0f / (float)0xFFFFFFFF); | return cmj_hash_simple(i, p) * (1.0f / (float)0xFFFFFFFF); | ||||
| } | } | ||||
| ccl_device float pmj_sample_1D(ccl_global const KernelGlobals *kg, | ccl_device float pmj_sample_1D(KernelGlobals kg, uint sample, uint rng_hash, uint dimension) | ||||
| uint sample, | |||||
| uint rng_hash, | |||||
| uint dimension) | |||||
| { | { | ||||
| /* Perform Owen shuffle of the sample number to reorder the samples. */ | /* Perform Owen shuffle of the sample number to reorder the samples. */ | ||||
| #ifdef _SIMPLE_HASH_ | #ifdef _SIMPLE_HASH_ | ||||
| const uint rv = cmj_hash_simple(dimension, rng_hash); | const uint rv = cmj_hash_simple(dimension, rng_hash); | ||||
| #else /* Use a _REGULAR_HASH_. */ | #else /* Use a _REGULAR_HASH_. */ | ||||
| const uint rv = cmj_hash(dimension, rng_hash); | const uint rv = cmj_hash(dimension, rng_hash); | ||||
| #endif | #endif | ||||
| #ifdef _XOR_SHUFFLE_ | #ifdef _XOR_SHUFFLE_ | ||||
| Show All 26 Lines | # endif | ||||
| fx = fx - floorf(fx); | fx = fx - floorf(fx); | ||||
| #else | #else | ||||
| # warning "Not using Cranley-Patterson Rotation." | # warning "Not using Cranley-Patterson Rotation." | ||||
| #endif | #endif | ||||
| return fx; | return fx; | ||||
| } | } | ||||
| ccl_device void pmj_sample_2D(ccl_global const KernelGlobals *kg, | ccl_device void pmj_sample_2D(KernelGlobals kg, | ||||
| uint sample, | uint sample, | ||||
| uint rng_hash, | uint rng_hash, | ||||
| uint dimension, | uint dimension, | ||||
| ccl_private float *x, | ccl_private float *x, | ||||
| ccl_private float *y) | ccl_private float *y) | ||||
| { | { | ||||
| /* Perform a shuffle on the sample number to reorder the samples. */ | /* Perform a shuffle on the sample number to reorder the samples. */ | ||||
| #ifdef _SIMPLE_HASH_ | #ifdef _SIMPLE_HASH_ | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||