When I hardcode these values, the distribution returns to look like Sobol.
Code: Select all
sobolSequence.rng0 = 0.2;//rngGenerator.
sobolSequence.rng1 = 0.7;//rngGenerator.floatValue();
sobolSequence.rngPass = 0.55;//rngGenerator.uintValue();
Code: Select all
sobolSequence.rng0 = 0.2;//rngGenerator.
sobolSequence.rng1 = 0.7;//rngGenerator.floatValue();
sobolSequence.rngPass = 0.55;//rngGenerator.uintValue();
Code: Select all
// Initialize rng0, rng1 and rngPass
rngGenerator.init(pixelIndex % (0xFFFFFFFFu - 1u) + 1u);
sobolSequence.rng0 = rngGenerator.floatValue();
sobolSequence.rng1 = rngGenerator.floatValue();
sobolSequence.rngPass = rngGenerator.uintValue();
In theory, a sequence of (pseudo)random numbers is the same of a sequence of random numbers but I would be very suprised if the problem is really in the correlation of the sequence (pseudo)random.alpistinho wrote: ↑Wed Apr 17, 2019 9:41 am I am not 100% sure about what is causing the issue, but as you can see on the samples distributions I've posted, the current solution is making Sobol more like Random.
Code: Select all
// Initialize rng0, rng1 and rngPass
rngGenerator.init(seedBase + pixelIndex % (0xFFFFFFFFu - 1u) + 1u);
sobolSequence.rng0 = rngGenerator.floatValue();
sobolSequence.rng1 = rngGenerator.floatValue();
sobolSequence.rngPass = rngGenerator.uintValue();
It makes the rendering noisier again and the distribution for an arbitrary pixel I chose looks random and not Sobol.Dade wrote: ↑Wed Apr 17, 2019 10:39 am The other option is that there is something going wrong with the value "seedBase", have you tried to use this code ?
The only difference with your code is the "seedBase +".Code: Select all
// Initialize rng0, rng1 and rngPass rngGenerator.init(seedBase + pixelIndex % (0xFFFFFFFFu - 1u) + 1u); sobolSequence.rng0 = rngGenerator.floatValue(); sobolSequence.rng1 = rngGenerator.floatValue(); sobolSequence.rngPass = rngGenerator.uintValue();
I am not saying it is this necessarily, but somehow initializing rngGenerator using different values causes the distribution to degrade into a simple Random sampling.
But this is very strange is like saying that the this sequence of a0-aN:alpistinho wrote: ↑Thu Apr 18, 2019 1:42 am It makes the rendering noisier again and the distribution for an arbitrary pixel I chose looks random and not Sobol.
Code: Select all
rngGenerator.init(1);
a0 = rngGenerator.floatValue();
a1 = rngGenerator.floatValue();
a2 = rngGenerator.floatValue();
a3 = rngGenerator.floatValue();
...
Code: Select all
rngGenerator.init(1);
a0 = rngGenerator.floatValue();
rngGenerator.init(2);
a1 = rngGenerator.floatValue();
rngGenerator.init(3);
a2 = rngGenerator.floatValue();
rngGenerator.init(4);
a3 = rngGenerator.floatValue();
...
When I used the code above, the distribution started being fixed per pixel again, restoring the original behavior.alpistinho wrote: ↑Wed Apr 17, 2019 1:28 am I have absolutely no idea how mathematically sound this is but using the pixelIndex as the seed for the RNG seems to work...
Code: Select all
// Initialize rng0, rng1 and rngPass rngGenerator.init(pixelIndex % (0xFFFFFFFFu - 1u) + 1u); sobolSequence.rng0 = rngGenerator.floatValue(); sobolSequence.rng1 = rngGenerator.floatValue(); sobolSequence.rngPass = rngGenerator.uintValue();