Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_jitter.h
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | ccl_device_inline uint cmj_hash(uint i, uint p) | ||||
| i *= 0x93fc4795; | i *= 0x93fc4795; | ||||
| i ^= 0xdf6e307f; | i ^= 0xdf6e307f; | ||||
| i ^= i >> 17; | i ^= i >> 17; | ||||
| i *= 1 | p >> 18; | i *= 1 | p >> 18; | ||||
| return i; | return i; | ||||
| } | } | ||||
| ccl_device_inline uint cmj_hash_simple(uint i, uint p) | |||||
| { | |||||
| i ^= p; | |||||
| i ^= i >> 17; | |||||
| i *= 0x9e3791d5; | |||||
| i *= 1 | p >> 18; | |||||
| return i; | |||||
| } | |||||
| ccl_device_inline float cmj_randfloat(uint i, uint p) | 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); | ||||
| } | } | ||||
| #ifdef __CMJ__ | #ifdef __CMJ__ | ||||
| ccl_device float cmj_sample_1D(int s, int N, int p) | ccl_device float cmj_sample_1D(int s, int N, int p) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||