This is a CPU-based path tracing renderer focused on rendering SDFs, specifically fractals. It was originally based on the book "Ray tracing in one weekend" by Peter Shirley, which I heartily recommend, though it has now evolved into a structure of my own design, taking hints from that, pbrt
, which is also an excellent reference, and research from NVIDIA on wavefront pathtracing for taking advantage of SIMD.
ultraviolet
, and in the future perhaps 256 or 512 as well.sdfu
All demo images in this repository are licensed under the CC BY-NC-ND license which essentially means you are free to use them for non-commercial purposes so long as you:
1. Credit me (my name, Gray Olson, and a link to my website, https://grayolson.me/)
2. Do not modify them
If you wish to use them for commercial purposes, contact me and we can work out a license.
Full 8k resolution image of this render available here.
First, install Rust. Then, clone or download this repo (green "Code" button on GitHub). Finally, open a shell prompt and change to this repository's directory (if you're not sure how to do this, see this article). Then, run
$ cargo run --release
This will render an image and place it in a folder called renders
inside the folder this repo is in.
With your favorite code editor (I recommend VSCode with the rust-analyzer
plugin), open the src/setup.rs
file.
Here you can change many settings including the resolution of the output image, the number of indirect lighting bounces, the number of raymarching steps
on each path, the number of total samples to take, and the setup of the whole scene. Feel free to play with all these numbers and see what they do. Just
run cargo run --release
each time you make a change to render a new image. There are some comments in that file to help you get started on things you
can play around with.