Renderer/ray tracer test framework.
ℹ️ All commands in this readme assume CWD is the repository root.
You may need to install a bunch of packages for x11 and sdl2, e.g.:
sudo apt install xorg-dev libx11-dev libgl1-mesa-glx libsdl2-dev
# windows with visual studio:
meson setup build --backend vs
# everything else:
meson setup build
cd build && meson compile
rt
is a command-line application.
Usage: rt [--help] [--version] [--list] --scene <path> --renderer <name>
Renders a scene with a software renderer of your choosing.
Optional arguments:
-h, --help shows help message and exits
-v, --version prints version information and exits
-l, --list lists available renderers and exits
-s, --scene scene TOML file [nargs=0..1] [default: ""]
-r, --renderer renderer name [nargs=0..1] [default: "mg_ray_tracer"]
Available renderers are listed as part of the program's stdout during regular execution.
Downloading of the required subproject dependencies should happen for you automatically, but if it doesn't (or you wish to force a re-download/update):
meson subprojects download && meson subprojects update --reset
The default build config is Release (highly-optimized but poor debugging experience). If you wish to change to debug:
cd build && meson configure --buildtype debug
Renderers are intended to be self-contained in single .cpp
files in src/renderers/
. The general process for adding a new one is as follows:
- Create your new renderer
.cpp
file insrc/renderers/
(use one of the existing ones as a template if necessary) - Add the cpp file to the list in
src/renderers/meson.build
- Build and test
The struct-of-arrays types are generated using soagen. Their code files are already present in the repository so you won't need to do this, unless you wish to change them in some manner, in which case:
# initial soagen install
sudo pip3 install soagen
# regenerate files and update soagen.hpp
soagen src\soa.toml --install vendor