Walther / clovers

Ray Tracing in Rust
https://walther.github.io/clovers/clovers/
13 stars 1 forks source link

feat: typed colors in scene format #198

Closed Walther closed 7 months ago

Walther commented 7 months ago

Featire: typed colors in scene format, fixes #68


Slight performance improvement seen, probably due to fewer conversions needed in colorize for each sample, as everything gets converted into Xyz<E> at scene initialization time.

hyperfine --parameter-list branch 2024-02-major-color-refactor,main --command-name {branch} --setup "git switch {branch} && cargo build --release" "cargo run --bin clovers-cli --release -- --input scenes/cornell.json -o renders/temp.png"

Benchmark 1: 2024-02-major-color-refactor (branch = 2024-02-major-color-refactor)
  Time (mean ± σ):     39.790 s ±  0.604 s    [User: 282.476 s, System: 1.038 s]
  Range (min … max):   38.949 s … 41.021 s    10 runs

Benchmark 2: main (branch = main)
  Time (mean ± σ):     41.241 s ±  0.583 s    [User: 289.653 s, System: 1.288 s]
  Range (min … max):   40.564 s … 42.408 s    10 runs

Summary
  2024-02-major-color-refactor (branch = 2024-02-major-color-refactor) ran
    1.04 ± 0.02 times faster than main (branch = main)