wahn / rs_pbrt

Rust crate to implement a counterpart to the PBRT book's (3rd edition) C++ code. See also https://www.rs-pbrt.org/about ...
https://www.rs-pbrt.org
Other
809 stars 59 forks source link

Implement CreateMaxMinDistSampler #121

Closed wahn closed 4 years ago

wahn commented 4 years ago

On the C++ side:


> rg -tcpp CreateMaxMinDistSampler
core/api.cpp
827:        sampler = CreateMaxMinDistSampler(paramSet);

samplers/maxmin.h
85:MaxMinDistSampler *CreateMaxMinDistSampler(const ParamSet &params);

samplers/maxmin.cpp
73:MaxMinDistSampler *CreateMaxMinDistSampler(const ParamSet &params) {

TODO: Rust counterpart ...

wahn commented 4 years ago

Commit 31f74d7e97753204c66bd99fddacb9f36448fed8 implements the MaxMinDistSampler, but the result differs from the C++ versions:

diff

> imf_diff -d -f pbrt.exr pbrt_rust.exr diff.jpg
differing pixels:    83.680% (209199 of 250000)
average difference:   6.693%
maximum difference:  80.439%
Summary: Many pixels differ strongly.
== "pbrt.exr" and "pbrt_rust.exr" are different
wahn commented 4 years ago

Commit 2b34e5d2066c2d51bbe9657fe746cd24365f294e fixes the problem and the issue can be closed ...

> imf_diff pbrt.exr pbrt_rust.exr 
pbrt.exr pbrt_rust.exr: no differences.
== "pbrt.exr" and "pbrt_rust.exr" are identical