Rust implementation for The Ray Tracer Challenge. Download the CLI from the release page.
There are some extra post processing effects available:
- Ordered Dithering
The Ray Tracer Challenge CLI
Usage: raytracer [OPTIONS] --scene <FILE>
Options:
--scene <FILE> A yaml description of the scene to render
--obj <FILE> Optional obj models to add to the scene
--ppm <FILE> Optional ppm textures to use as material
--dithering <PARAMS> Add dithering effect to the final image [possible values: bayer2, bayer4, bayer8, bayer16, bayer-color]
--out <OUT> Optional output ppm file, defaults to stdout
-h, --help Print help
See comments in yaml scene files for information about how to get all resources (obj models, ppm textures) used in the examples commands.
The rendered scenes can be piped directly to ImageMagick or outputted to a file.
raytracer --scene samples/scenes/basic_scene.yaml | magick display
raytracer --scene samples/scenes/cover.yaml --out cover.ppm
raytracer --scene samples/scenes/space_ship.yaml \
--obj samples/obj/space_ship.obj \
--out space_ship.ppm
Multiple obj
models can be added/combined in a scene.
raytracer --scene samples/scenes/space_teapot.yaml \
--obj samples/obj/space_ship.obj \
--obj samples/obj/teapot_low.obj \
--out space_teapot.ppm
raytracer --scene samples/scenes/csg.yaml --out csg.ppm
raytracer --scene samples/scenes/soft_shadows.yaml --out soft_shadows.ppm
Beware that rendering this scene will be quite long (about 45 minutes on my machine with 16 cores).
raytracer --scene samples/scenes/dragons.yaml \
--obj samples/obj/dragon.obj \
--out dragons.ppm
raytracer --scene samples/scenes/checkered_cube.yaml --out checkered_cube.ppm
raytracer --scene samples/scenes/earth.yaml \
--ppm samples/textures/earthmap1k.ppm \
--out earth.ppm
raytracer --scene samples/scenes/skybox.yaml \
--ppm samples/textures/negx.ppm \
--ppm samples/textures/negy.ppm \
--ppm samples/textures/negz.ppm \
--ppm samples/textures/posx.ppm \
--ppm samples/textures/posy.ppm \
--ppm samples/textures/posz.ppm \
--out skybox.ppm