Closed wahn closed 4 years ago
After commit 1f805e793d5a393559f88bed209b8338a63b1a0b we get a 100% match to the C++ counterpart:
> imf_diff pbrt_rust.exr pbrt.exr
pbrt_rust.exr pbrt.exr: no differences.
== "pbrt_rust.exr" and "pbrt.exr" are identical
Still there are some bits and pieces missing:
impl StratifiedSampler {
...
pub fn start_pixel(&mut self, p: &Point2i) {
...
// generate arrays of stratified samples for the pixel
for i in 0..self.samples_1d_array_sizes.len() {
// for (int64_t j = 0; j < samplesPerPixel; ++j) {
// int count = samples1DArraySizes[i];
// stratified_sample_1d(&sampleArray1D[i][j * count], count, rng,
// self.jitter_samples);
// Shuffle(&sampleArray1D[i][j * count], count, 1, rng);
}
for i in 0..self.samples_2d_array_sizes.len() {
// for (int64_t j = 0; j < samplesPerPixel; ++j) {
// int count = samples2DArraySizes[i];
// LatinHypercube(&sampleArray2D[i][j * count].x, count, 2, rng);
}
...
}
...
}
After commit e057694f138658274d530ee1afc43b8a20b3bce6 the latin_hypercube(...)
method works as well (being used e.g. for ambientocclusion
):
> imf_diff pbrt.exr pbrt_rust.exr
pbrt.exr pbrt_rust.exr: no differences.
== "pbrt.exr" and "pbrt_rust.exr" are identical
Closing the issue for now.
On the C++ side:
TODO: Rust counterpart ...