Naive CPU Ray tracer implemented in Rust.
- multi-thread ray tracing
- loading
gltf
andobj
models - using Javascript to describe the scene
- supporting microfacet brdf
You can manually build or use Docker.
- Install Rust toolchain
- Compile the project
cargo build -p toy_ray_tracer --release
- Running
mkdir -p output/cg
./target/release/toy_ray_tracer render --project-file=./assets/projects/cg/cornell_box.js -vvv
- Output
The output image is located in
- Run following command
docker buildx build . -t icstp-ray-tracer:v1
- Run the image
mkdir -p output/cg
docker run -v $(shell pwd)/output:/app/output icstp-ray-tracer:v1 render -vvv --project-file=assets/projects/cg/cornell_box.js
Example scene files are located in dir assets/projects/cg/**
Rendered images will be put into output
dir
# -vvv to show the progress
mkdir -p output/cg
./target/release/toy_ray_tracer render --project-file=<scene-file> -vvv
Thanks to the following projects