OHAO · Implementation Monograph

Monograph · 12 · Build & run

12

Systems · full depth

Build & run

Chapter contract

From empty build dir to verified pixels and a published monograph: CMake options, targets, shader compile, examples, goldens, Pages workflow.

Configure & build

shell
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

OptionDefaultEffect
OHAO_NRDONNRD integration; OFF → empty stubs
OHAO_DLSSif NGX lib presentDLSS-RR; OFF → no NGX link
BUILD_*_TESTSvariousengine/physics/audio/renderer tests
BUILD_PYTHON_BINDINGSOFFoptional 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)

BinaryWhat it proves
cornell_boxPT still / deferred hybrid smoke; goldens
model_viewerGLB/FBX + spp + mode; default 1080p
env_demoHDRI + OIDN path
interactiveGLFW live; --denoise=nrd
turntableFrame sequences
examples
./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

shell
python3 site/tests/test_monograph_structure.py