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

[sppm] arena branch panics with test scene

wahn opened this issue · comments

$ git branch
* arena
...
$ git describe --tags
v0.8.2-74-g4314204
$ cd /home/jan/Graphics/Rendering/PBRT/pbrt-v3-scenes/caustic-glass
$ ~/git/github/rs_pbrt/target/release/rs_pbrt f16-9a.pbrt
...
thread '<unnamed>' panicked at 'index out of bounds: the len is 2 but the index is 242', src/integrators/sppm.rs:872:19

The master branch renders fine, but still shows some differences to the C++ version:

diff

$ git checkout master
$ git describe --tags
v0.8.2-62-gf2cd4ae
$ make
$ cd /home/jan/Graphics/Rendering/PBRT/pbrt-v3-scenes/caustic-glass
$ ~/git/github/rs_pbrt/target/release/rs_pbrt f16-9a.pbrt
Copyright (c) 2016-2020 Jan Douglas Bert Walter.
Rust code based on C++ code by Matt Pharr, Greg Humphreys, and Wenzel Jakob.
Film "image"
  "string filename" ["f16-9a.exr"]
  "integer xresolution" [700]
  "integer yresolution" [1000]
  "float scale" [1.5]
Integrator "sppm"
  "integer numiterations" [2]
  "float radius" [0.025]
Rendering with 28 thread(s) ...
2 / 2 [===============================================================================] 100.00 % 1.45/s 
Writing image "pbrt.png" with bounds Bounds2i { p_min: Point2i { x: 0, y: 0 }, p_max: Point2i { x: 700, y: 1000 } }
$ imf_diff pbrt_cpp.png pbrt.png 
differing pixels:	 10.314% (72201 of 700000)
average difference:	 24.644%
maximum difference:	 86.603%
Summary: Many pixels differ strongly.
== "pbrt_cpp.png" and "pbrt.png" are different

After commit e2ad633 we match the C++ code (in the master branch):

$ imf_diff pbrt_cpp.png pbrt.png 
pbrt_cpp.png pbrt.png: no differences.
== "pbrt_cpp.png" and "pbrt.png" are identical

The arena branch still panics.

Commit e53708a ( and 421460a) fix the issue. C++ and the arena branch render the same:

$ imf_diff pbrt.png pbrt_cpp.png
pbrt.png pbrt_cpp.png: no differences.
== "pbrt.png" and "pbrt_cpp.png" are identical