- Based on: Ray Tracing in One Weekend
- Expanded on in the UU Advanced Graphics course
cargo run --release -- scenes/weekend-final.json # Or another json scene
cargo run --release -- scenes/dragon_recon/dragon_vrip_res4.ply --format ply # Or another ply scene
This will load a scene from a file and render it to the output
folder.
cargo run --release --
This will generate a new scene based on the code in main.rs
(e.g. let (world, filename) = scenes::simple_fuzzy_metal();
)
It will write the scene as json to the scenes
folder. (and also render to the output
folder)
There are various possible options, most importantly, the algorithm for acceleration can be specified using
--algorithm <ALGORITHM>
. Possible values are naive
, bvh
or grid
.
More options can be added using the -o <OPTION>
flag.
For example -o draw-boxes
draws the BVH bounding boxes.
Furthermore, --grid-size n
can be used to specify the grid size for the grid algorithm.
cargo run --release -- --help # For a list of all options
cargo test --release
This will run a set of scenes from the scenes
folder with different algorithms and options.
The simple scenes will be ran using the naive and BVH algorithms, more complex scenes will
not be run using the naive algorithm. For the BVH algorithm three different SAH settings will
be tested.
Any time a image is generated using any of the above commands, statistics are collected to output/stats.csv
.
- All features from Ray Tracing in One Weekend
- Triangle geometry and intersection based on this tutorial
- Importing PLY files, for example the Stanford Models
- BVH using SAH, based on slides from Advanced Graphics
- Grid acceleration, based on Amanatides, Woo, et al.
This repository includes some ply
models from the Stanford Models.
Specifically:
- Dragon:
- Source: Stanford University Computer Graphics Laboratory
- Scanner: Cyberware 3030 MS + spacetime analysis