OHAO · Implementation Monograph

Monograph · 01 · Architecture

01

Foundations · deep dive

Architecture

Chapter contract

The wide-angle map: how a request becomes pixels, which modules own which phase, and the non-negotiable invariants. Deep module chapters hang off this spine.

Conceptual dual pipeline
Plate ARCH-C1

Conceptual illustration — not engine output Teaching sketch of two formations on one spine.

End-to-end request path

Typical example binary
  1. Parse CLI (model path, spp, mode, denoise)
  2. Construct Scene; load assets into actors/components
  3. VulkanRenderer(w,h).initialize() — full GPU cold start (Ch. 03)
  4. setScene(scene) — upload meshes, materials, lights, BLAS/TLAS
  5. Place camera; optional env map
  6. setRenderMode(Deferred | RTOffline | …) — RT modes call ensureRTRenderer lazily
  7. Loop or single shot: render()
  8. Read getPixels() / write PNG / present GLFW
  9. Optional: denoise offline still via OIDN path inside PT

Nothing in that list requires an editor. The engine is a library with a fat GPU core.

Mode matrix

ModeWho drawsAS?Readback
ForwardLegacy rasternostaging
DeferredDeferredRenderer graphoptional hybridstaging
RTRealtimePathTracer (PCG, few bounces)requiredstaging + denoise opts
RTOfflinePathTracer (Sobol, OIDN path)requiredHDR accum → beauty

Invariants (break these → silent wrong pixels)

Must hold across modulesalways
  • One scene language for deferred and PT (materials, lights, transforms)
  • TLAS instance order locked to material table order
  • Bindless indices valid or 0xFFFFFFFF “no texture”
  • NRD packing uses YCoCg + norm hit-dist when NRD is on
  • Frame ring: never read staging without waiting on that slot’s fence
  • PathTracer profiles lazy — do not dual-allocate at 4K

Layer cake

LayerOwnsDeep chapter
SceneActors, components, loaders, physics world handle02
GPU hostDevice, upload, AS, ring, dispatch03
Materials languagePBR + pack04
Deferred formationGBuffer → light → post05
PT formationIntegrator + AOVs06–07
Hybrid injectRT shadow/GI into deferred08
DenoiseOIDN/NRD/DLSS contracts09
Audio / PhysicsSim & sound facades10–11

How to go deeper

  1. Want “what happens when I press run?” → Ch. 03 GPU init + this request path
  2. Want “why is my metal black?” → Ch. 04 + 05 IBL limits
  3. Want “why is noise structured like that?” → Ch. 06–07 NEE/MIS
  4. Want “why magenta after denoise?” → Ch. 09

Hover dotted terms (GGX, TLAS, …) or open the Glossary.

Design units in this module

Each card is a focused design page (what / how / why + sources). Full tree: Sitemap.