Implementation of Peter Shirley's Ray Tracing in One Weekend book in the Zig programming language.
Tested on Zig version 0.9.1.
Clone the repo and jump into it:
git clone git@github.com:jackdbd/path-tracer.git
cd path-tracer
In order to use this library and run the examples you will need zig version 0.9.1. You can get it using zigup:
zigup fetch 0.9.1
zigup 0.9.1
Build and run the executable in debug mode.
zig build run
Build the executable in release-fast mode, then run it.
zig build -Drelease-fast --verbose
# run it
./zig-out/bin/ray-tracing-in-one-weekend-zig
Run all tests:
zig build test
Otherwise, run all tests defined in a single file:
zig test src/material.zig
zig test src/utils.zig
zig test src/render_targets/ppm_image.zig --main-pkg-path ./src
Format all zig code
zig fmt src
- implement example with async and await
- implement more scenes
- improve documentation about Monte Carlo path tracing algorithm and global illumination model
- generate docs with
zig test src/utils.zig -femit-docs=./docs
or similar command - fix issues with zig-clap