93 bits = (bits << 16u) | (bits >> 16u);
94 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
95 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
96 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
97 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
102 return float(bits) * 2.3283064365386963e-10f;
111 return fract(offset + 52.9829189f *
fract(0.06711056f * v.x + 0.00583715f * v.y));
120 uint
state = u * 747796405u + 2891336453u;
122 return (word >> 22u) ^ word;
133 pixel += seed * (
float2(47, 17) * 0.695f);
177 u = u * 1664525u + 1013904223u;
197 u = u * 1664525u + 1013904223u;
231 int sample_per_dim = int(
sqrt(
float(sample_count)));
232 return (
float2(i % sample_per_dim, i / sample_per_dim) + 0.5f) /
float(sample_per_dim);
246 float phi = (rand - 0.5f) *
M_TAU;
247 float cos_phi =
cos(phi);
ccl_device_inline float cos_theta(const float3 w)
ccl_device float sin_phi(const float3 w)
ccl_device_inline float sin_theta(const float3 w)
#define SAMPLING_BUF_SLOT
float3 sample_cos_hemisphere(const float2 rand)
float3 sample_cylinder(float2 rand)
float3 sample_ball(float3 rand)
float2 sample_disk(float2 rand)
float3 sample_sphere(float2 rand)
float3 sample_uniform_cone(float2 rand, float cos_angle)
float2 sample_circle(float rand)
float2 regular_grid_2d(int i, int sample_count)
float3 sample_hemisphere(float2 rand)
#define storage(slot, qualifiers)
VecBase< uint, D > floatBitsToUint(VecOp< float, D >) RET
VecBase< int, D > bitfieldReverse(VecOp< int, D >) RET
float sin_from_cos(float c)
float van_der_corput_radical_inverse(uint bits)
float interleaved_gradient(float2 v, float offset=0.0f)
static constexpr float pcg_rcp
float3 interleaved_gradient_3d(float2 pixel, float3 seed, float3 offset)
float2 interleaved_gradient_2d(float2 pixel, float2 seed, float2 offset)
float interleaved_gradient(float2 pixel, float seed, float offset)
float2 hammersley_2d(T i, T sample_count)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
float3 rng_3D_get(const eSamplingDimension dim) const
const SamplingData & sampling_buf
float2 rng_2D_get(const eSamplingDimension dim) const
float rng_1D_get(const eSamplingDimension dim) const