Skip to content

Latest commit

 

History

History
64 lines (57 loc) · 4.47 KB

README.md

File metadata and controls

64 lines (57 loc) · 4.47 KB

Raytracer

This is a simple raytracer developed as a final project for the course "GFX - Foundations of Computer Graphics" at the University of Vienna. The objectives of this task was to understand the conepts of raytracing and create a raytracer which renders a scene based on a given XML file following a specific file specification. It currently supports all the effects listed on the course site including supersampling, rendering julia sets and the kd-tree acceleration structure using N log N building algorithm. Please note that the project will only run with Rust 1.17 due to OnceLock. Per default multithreading is on (specify the number of threads num_threads you want to activate in the toml file) and kdtree off (set in the toml file kdtree = true to activate).

Usage

cd into src directory and run: cargo run --release <path to XML> <path to toml file (optional)>

Example: cargo run --release ../scenes/example1.xml

To use the toml file the command will look like this: cargo run --release ../scenes/chess.xml ../scenes/chess.toml

A list of commands to render some of the scenes:

cargo run --release ../scenes/example4-area.xml ../scenes/cook.toml
cargo run --release ../scenes/example6.xml ../scenes/anim.toml
cargo run --release ../scenes/example6-anti.xml ../scenes/anti.toml
cargo run --release ../scenes/example6-fresnel.xml ../scenes/fresnel.toml
cargo run --release ../scenes/example6-julia.xml ../scenes/julia-dof-cook.toml
cargo run --release ../scenes/example7-dof.xml ../scenes/dof.toml
cargo run --release ../scenes/example9-normal.xml ../scenes/normal.toml
cargo run --release ../scenes/spotlight.xml

To use supersampling append ../scenes/supersampling.toml to the command. Only one toml file can be added at a time, to have multiple effects or trying them out, write your own toml files. There are some already specified.

Example Output

1 2
3 4
5
6

Resources