Large fixes to pdf_value and random functions and the dispatch table in Hitable
Before:
Benchmark 1: ./target/release/clovers-cli -w 512 -h 256 -s 100 -q -i scenes/cornell.json -o temp.png
Time (mean ± σ): 336.5 ms ± 4.3 ms [User: 17087.1 ms, System: 2971.6 ms]
Range (min … max): 329.4 ms … 342.0 ms 10 runs
Benchmark 1: ./target/release/clovers-cli -w 512 -h 256 -s 100 -q -i scenes/scene.json -o temp.png
Time (mean ± σ): 2.922 s ± 0.012 s [User: 144.223 s, System: 0.514 s]
Range (min … max): 2.894 s … 2.935 s 10 runs
After:
Benchmark 1: ./target/release/clovers-cli -w 512 -h 256 -s 100 -q -i scenes/cornell.json -o temp.png
Time (mean ± σ): 654.2 ms ± 7.3 ms [User: 39139.4 ms, System: 1024.2 ms]
Range (min … max): 642.0 ms … 669.5 ms 10 runs
Benchmark 1: ./target/release/clovers-cli -w 512 -h 256 -s 100 -q -i scenes/scene.json -o temp.png
Time (mean ± σ): 3.989 s ± 0.013 s [User: 211.914 s, System: 0.618 s]
Range (min … max): 3.966 s … 4.007 s 10 runs
Both the cornell scene and the dragon-teapot-bunny scene regress in speed moderately, BUT the visual improvements from faster convergence due to fixing the priority sampling make it well worth it. Much fewer samples per pixel are required now for a decent picture quality!
Cargo.toml
optimizationspdf_value
andrandom
functions and the dispatch table inHitable
Before:
After:
Both the cornell scene and the dragon-teapot-bunny scene regress in speed moderately, BUT the visual improvements from faster convergence due to fixing the priority sampling make it well worth it. Much fewer samples per pixel are required now for a decent picture quality!
Before, 1 spp
After, 1 spp
Before, 10 spp
After, 10 spp
![1654505672](https://user-images.githubusercontent.com/2943750/172133508-158b81c0-344c-4c44-b324-49b8b1454687.png)