Commit Graph

13 Commits

Author SHA1 Message Date
42eda24514 Sobol sampler: get rid of unused alternative direction numbers. 2021-01-25 21:50:31 +09:00
45241784fb Code tidying on the Sobol sampler.
Also swapped the sample index and dimension paramater in the function
signature.  This feels more intuitive.
2020-04-30 22:46:47 +09:00
72adbedbb4 Accelerate the Sobol sampler with SIMD on x86_64. 2020-04-24 23:32:43 +09:00
0dfe916523 Preparing for SIMD accelerated Sobol sampling.
This implements the 4-wide API, and moves the renderer over to it.
But the actual implementation is still scalar.
2020-04-24 21:05:29 +09:00
aecff883ab Misc optimizations on the Sobol sampler.
The biggest one is avoiding a bunch of bit reversals by keeping
numbers in bit-reversed form for as long as we can.

Also reduced the hashing rounds: just 2 rounds seems to be enough
for a reasonable amount of statistical independence on both the
scrambling and shuffling.  I tested both independently, keeping
the other with no scrambling/shuffling respectively.  This makes
sense because in normal contexts 3 is enough, but in this case
both act as input to yet another hash which is effectively doing
more rounds.
2020-04-22 16:21:50 +09:00
e46fc5a4d6 Cleaning up Sobol sampling code.
In particular, removing some things I tried when the golden ratio
sampling was causing problems, but that are now no longer needed.
2020-03-21 09:00:43 +09:00
3916043f33 Removed golden ratio sampling.
Turns out it causes interference with the Sobol sampler.

Also tweaked some other things about sampling after removing
golden ratio sampling, to make things better.
2020-03-19 19:49:45 +09:00
7daa133e15 Only use 16 bit integers for generating Sobol samples.
This limits the number of samples per dimension to 2^16, but that
should be more than enough for any rendering situation.  And this
reduces the direction numbers table size by a factor of 4.

This commit also takes advantage of the reduced bit space to
provide even better Owen scrambling, by utilizing the unused
16 bits for better mixing.
2020-03-19 08:58:42 +09:00
9e14e164e7 More improvements to Sobol sampling.
- Added an additional scramble round to the Owen scrambling, with
  new optimized constants.
- Reordered the dimensions of the direction numbers to improve 2d
  projections between adjecent dimensions.  Only did this for
  dimensions under ~40.
2020-03-18 12:05:42 +09:00
e3152e6f9c Add alternative Sobol direction numbers to the repo.
Also switching to one of the alternates, as it seems to give
better results than the one I was using before.
2020-03-17 16:49:19 +09:00
04a5dbff43 Generate sobol direction numbers from text file.
This way the numbers aren't cluttering up the source file, and
this also makes it easier to play with other direction numbers.
2020-03-17 15:21:15 +09:00
420e078b70 Some cleanup of the comments in the last commit. 2020-03-15 22:37:34 +09:00
047e66d9aa Reworked Sobol sampler implementation.
This produces identical results, but generates the direction
vectors from the original sources at build time.  This makes
the source code quite a bit leaner, and will also make it easier
to play with other direction vectors in the future if the
opportunity arises.
2020-03-15 22:01:06 +09:00