Fixed cdf and added Standard Lit
This commit is contained in:
@@ -52,7 +52,7 @@ static inline float sobol_uint_to_float(uint32_t x)
|
||||
return x * 2.3283064365386963e-10f; // 1/2^32
|
||||
}
|
||||
|
||||
float sobol_sample(uint32_t index, uint32_t dimension)
|
||||
float sobol_sample(uint32_t index, uint16_t dimension)
|
||||
{
|
||||
// return random_float();
|
||||
if (dimension >= SOBOL_DIMENSIONS)
|
||||
@@ -71,3 +71,25 @@ float sobol_sample(uint32_t index, uint32_t dimension)
|
||||
|
||||
return sobol_uint_to_float(result);
|
||||
}
|
||||
|
||||
float sobol_sample_scrambled(uint32_t index, uint16_t dimension, uint32_t scramble)
|
||||
{
|
||||
if (dimension >= SOBOL_DIMENSIONS)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
uint32_t result = 0;
|
||||
for (int i = 0; i < SOBOL_BITS; i++)
|
||||
{
|
||||
if (sobol_get_bit(index, i))
|
||||
{
|
||||
result ^= sobol_direction_vectors[dimension][i];
|
||||
}
|
||||
}
|
||||
|
||||
// Apply XOR scrambling to decorrelate pixels
|
||||
result ^= scramble;
|
||||
|
||||
return sobol_uint_to_float(result);
|
||||
}
|
||||
Reference in New Issue
Block a user