Commit Graph

15 Commits

Author SHA1 Message Date
ffc77ee1d5 Implement optimization for sobol sampler.
This significantly increases the sobol sampler's speed, especially
for higher sample counts.
2020-03-15 18:05:39 +09:00
9b4781c81d Multiple improvements to sampling.
1. Use better constants for the hash-based Owen scrambling.
2. Use golden ratio sampling for the wavelength dimension.

On the use of golden ratio sampling:
Since hero wavelength sampling uses multiple equally-spaced
wavelengths, and most samplers only consider the spacing of
individual samples, those samplers weren't actually doing a
good job of distributing all the wavelengths evenly.  Golden
ratio sampling, on the other hand, does this effortlessly by
its nature, and the resulting reduction of color noise is huge.
2020-03-15 14:47:40 +09:00
a3ea90afdc Fixed broken Owen scrambling.
The previous implementation was fundamentally broken because it
was mixing the bits in the wrong direction.  This fixes that.

The constants have also been updated.  I created a (temporary)
implementation of slow but full owen scrambling to test against,
and these constants appear to give results consistent with that
on all the test scenes I rendered on.  It is still, of course,
possible that my full implementation was flawed, so more validation
in the future would be a good idea.
2020-03-12 20:20:56 +09:00
9ba51cd43a Improvments to the owen scrambling. 2020-03-11 23:22:07 +09:00
db9efc6a55 Removed unsafe code from sobol sampler and improved its documentation. 2020-03-11 21:30:14 +09:00
b081424ba6 Implemented Owen scrambling for the Sobol sampler.
This gives better variance than random digit scrambling, at a
very tiny runtime cost (so tiny it's lost in the noise of the
rest of the rendering process).
2020-03-11 18:29:46 +09:00
4a6284be40 Switch to sobol sampler.
The important thing here is that I figured out how to use the
scrambling parameter properly to decorrelate pixels.  Using the
same approach as with halton (just adding an offset into the sequence)
is very slow with sobol, since moving into the higher samples is
more computationally expensive.  So using the scrambling parameter
instead was important.
2020-02-22 09:18:45 +09:00
508cda6021 Better path usage and "extern crate" removal in sub-crates. 2018-12-16 13:14:06 -08:00
5fb349cc49 Second step transitioning to Rust 2018. 2018-12-16 12:07:11 -08:00
8deb1e87bb First step transitioning to Rust 2018. 2018-12-16 12:02:20 -08:00
e9b495e729 Silence some clippy warnings on generated code and large preformatted data. 2018-12-08 13:21:41 -08:00
97d3304149 Run new rustfmt on codebase. 2018-03-04 13:00:55 -08:00
b5f2237676 Reformatted sub-crates with new rustfmt as well. 2017-06-15 22:21:25 -07:00
5ab1a51f4c Avoid bounds checking in the Sobol code. 2017-05-12 00:34:03 -07:00
04e8a6ca73 Added a Rust port of Leonhard Grünschloß's Sobol sampler.
The Halton sampler appears to be better, but it was fun to add
this anyway!
2017-05-11 23:56:12 -07:00