A simple quasi-Monte-Carlo path tracer as described by Peter Shirley's Ray Tracing articles. For quasi-random sampling, I use the low-discrepancy sequence described here by Martin Roberts.
It's implemented in Ocaml and a little bit of Rust. It requires Ocaml version 5 because it uses the new shared-memory parallelism capabilities. On x86-64, the rust code uses AVX intrinsics to intersect a ray with four spheres at a time.
To build, run dune build --release
. To generate the above image, run dune exec --release shirley_spheres -- --dimension=600,300 --samples-per-pixel=32 --max-ray-bounces=8
. Increase --samples-per-pixel
and/or --max-ray-bounces
to render a higher quality image. Pass the --help
flag to see other options.