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 ...

Home Page:https://www.rs-pbrt.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement CreateMaxMinDistSampler

wahn opened this issue · comments

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 ...

Commit 31f74d7 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

Commit 2b34e5d 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