Monograph · 12 · Build & run
Systems · full depth
Build & run
From empty build dir to verified pixels and a published monograph: CMake options, targets, shader compile, examples, goldens, Pages workflow.
Configure & build
cmake -B build -S . -DFETCHCONTENT_UPDATES_DISCONNECTED=ON cmake --build build -j$(nproc) cmake --build build --target shaders # optional ctest --test-dir build --output-on-failure
Requires: CMake ≥3.20, C++20 compiler, Vulkan SDK, GPU driver with RT for path tracing. FetchContent pulls gtest, stb, and other deps on first configure.
CMake options
| Option | Default | Effect |
|---|---|---|
OHAO_NRD | ON | NRD integration; OFF → empty stubs |
OHAO_DLSS | if NGX lib present | DLSS-RR; OFF → no NGX link |
BUILD_*_TESTS | various | engine/physics/audio/renderer tests |
BUILD_PYTHON_BINDINGS | OFF | optional physics python |
Target / lib graph
Mental model: ohao_core ← scene / physics / audio; GPU + renderer libs link Vulkan + RT/deferred; examples link the stack into cornell_box, model_viewer, env_demo, interactive, turntable, … Artifacts land in build/ (Debug often *d suffixes).
Shaders
shaders/ CMake + compile_shaders.sh produce SPIR-V under build/shaders / bin/shaders. PathTracer searches several relative paths for SPVs at runtime. Sampler type is a raygen specialization constant at pipeline create.
Examples (the exercises)
| Binary | What it proves |
|---|---|
cornell_box | PT still / deferred hybrid smoke; goldens |
model_viewer | GLB/FBX + spp + mode; default 1080p |
env_demo | HDRI + OIDN path |
interactive | GLFW live; --denoise=nrd |
turntable | Frame sequences |
./build/cornell_box out.png 1024 ./build/cornell_box out.png 1 deferred ./build/model_viewer model.glb out.png 256 ./build/env_demo model.glb env.hdr out.png 256 ./build/interactive model.glb env.hdr --denoise=nrd
Tests & goldens
Unit/integration: engine, physics, audio, renderer. Goldens: tests/golden/ cornell + metal_rough_spheres; pre-push hook when enabled. STATUS.md is the evidence matrix — update with pixels, not hope.
GitHub Pages
Workflow .github/workflows/pages.yml stages site/, resolves media symlinks, excludes inverse research media, fails if inverse product strings appear in HTML, deploys with Actions. Enable: Settings → Pages → GitHub Actions. Local: cd site && python3 -m http.server 8765. Details: site/DEPLOY.md.
Monograph self-check
python3 site/tests/test_monograph_structure.py