Cycles: experimental correlated multi-jittered sampling pattern that can be used

instead of sobol. So far one doesn't seem to be consistently better or worse than
the other for the same number of samples but more testing is needed.

The random number generator itself is slower than sobol for most number of samples,
except 16, 64, 256, .. because they can be computed faster. This can probably be
optimized, but we can do that when/if this actually turns out to be useful.

Paper this implementation is based on:
http://graphics.pixar.com/library/MultiJitteredSampling/

Also includes some refactoring of RNG code, fixing a Sobol correlation issue with
the first BSDF and < 16 samples, skipping some unneeded RNG calls and using a
simpler unit square to unit disk function.
This commit is contained in:
Brecht Van Lommel
2013-06-07 16:06:22 +00:00
parent d835d2f4e6
commit b20a7e01d0
13 changed files with 417 additions and 110 deletions

View File

@@ -22,6 +22,7 @@
#include "buffers.h"
#include "camera.h"
#include "device.h"
#include "integrator.h"
#include "scene.h"
#include "session.h"
@@ -728,6 +729,18 @@ void Session::update_scene()
cam->tag_update();
}
/* number of samples is needed by multi jittered sampling pattern */
Integrator *integrator = scene->integrator;
if(integrator->sampling_pattern == SAMPLING_PATTERN_CMJ) {
int aa_samples = tile_manager.num_samples;
if(aa_samples != integrator->aa_samples) {
integrator->aa_samples = aa_samples;
integrator->tag_update(scene);
}
}
/* update scene */
if(scene->need_update()) {
progress.set_status("Updating Scene");