Adds docs/ — a navigation layer on top of AGENTS.md for future coding agents working on the Seele engine and the MeshShadingDemo harness. - docs/README.md: index + 30-second orientation + how-to-use workflow. - docs/cross-repo.md: the engine<->demo contract (2-symbol ABI, the ComponentSystem<...> demo pattern with the FlyCamSystem example, the CMake in-tree vs install(EXPORT) split, a where-to-look task map). - docs/subsystems/*.md: 16 per-subsystem deep-dives (scene/ECS, systems, game-interface, window, graphics backends, render graph, materials, physics, UI, assets, platform, core utils). Each maps public types to their defining headers and gives file:line pointers + gotchas. All cross-links verified resolving. This is documentation only — no source changes.
7.9 KiB
Seele — Engine Documentation (for coding agents)
Start here if you are a coding agent (or a human new to the repo) and need to navigate the Seele engine and the MeshShadingDemo test harness. This
docs/tree is the per-subsystem navigation layer. It complements — it does not replace — the engine-rootAGENTS.md, which is the map + the hard rules. Read that first; use this tree to drill into a specific area.
0. What this repository is (30-second orientation)
Seeleis a C++ game engine. It lives in this submodule (external/Seeleinside the parent monorepo). It has a Vulkan and Metal backend, an ECS (entt-based), a render graph, a Slang-based material/shader system, a Jolt-based physics layer, a full flexbox UI, and an asset pipeline. ~320 source files undersrc/Engine/.MeshShadingDemois a test game built against Seele. It is not the product; it is the integration harness. The engine is the product. The demo shows how a real consumer composes a game (scene, systems, materials, render-graph overrides) against the engine.- The engine↔demo boundary is a strict ABI: the engine's per-OS
GameInterfacedlopen/LoadLibrary-loads the demo's shared library and resolves exactly two C symbols (createInstance/destroyInstance). Seecross-repo.mdfor the full contract.
The single best first read is ../AGENTS.md (engine root):
the memory model, the update/GPU phase split, the Jolt ground rules, the
culling note, and a subsystem map. Everything below is the per-subsystem drill-
down it points into.
1. The cross-repo contract (read before touching either repo)
📄 cross-repo.md — the orientation doc for working across
both repos. It covers:
- The repo relationship (engine = submodule, demo = harness).
- The engine↔demo ABI — the two-C-symbol contract (
createInstance/destroyInstance), how the per-OSGameInterfaceloads the demo's shared lib, and the shader-copy-on-reload gotcha. - The demo-side
ComponentSystem<...>pattern (the only pattern you need for per-frame demo logic), with the canonicalFlyCamSystemexample. - The CMake contract — in-tree
add_subdirectory(what the demo does) vs. the engine's out-of-treeinstall(EXPORT)/FILE_SET HEADERSpath. - A practical "where do I look" task map and the three invariants that save hours.
Rule of thumb: engine changes go in the submodule (commit inside
external/Seele, then re-record the submodule pointer in the parent). The demo never edits engine code.
2. Per-subsystem deep dives
Each doc follows the same shape: key types & where they live (a per-type table mapping each public type to its defining header), data flow / lifecycle, where to look (file:line pointers), and gotchas & sharp edges. Links below are to the real files.
Core engine
| Area | Doc | What it covers |
|---|---|---|
| Scene / ECS / Components / Actors | scene-ecs | The entt registry, Actor, Component model, how the demo composes a scene in setupScene. The foundation everything else builds on. |
| Component Systems & the Update Loop | systems | System, SystemGraph, ComponentSystem, the per-frame tick order, the CPU/GPU phase split. |
| Game Interface & Frame Loop | game-interface | Game (abstract), GameView, the render/update protocol (beginUpdate/update/commitUpdate/prepareRender/render), the frame loop. |
| Window & view layer | window | Window, WindowManager, View, GameView — the OS window, the render/update protocol, the frame loop wiring. |
Graphics (GPU)
| Area | Doc | What it covers |
|---|---|---|
| Graphics Abstract Backend | graphics-backend | Gfx::Graphics — the backend-agnostic API (buffers, textures, pipelines, descriptors, render passes). The layer you write against. |
| Render Graph & Render Passes | render-graph | The auto-invalidated render graph, render passes, dependencies, meshlet layout, and the ray-tracing paths. |
| GPU Resources | graphics-resources | Buffers, textures, shaders, pipelines, descriptor sets in the abstract layer — and how they map to the backends. |
| Vulkan Backend | vulkan | Vulkan::Graphics — the concrete Vulkan implementation, its gotchas, and the RT path. |
| Metal Backend | metal | Metal::Graphics — the concrete Metal implementation, its gotchas, and the RT path. |
| Materials & Shader Graphs | materials | ShaderExpression — the Slang-based material/shader-graph system, parameter binding, and how the demo overrides the render graph. |
Simulation & content
| Area | Doc | What it covers |
|---|---|---|
| Physics (Jolt) | physics | The Jolt wrapper, PhysicsSystem, CollisionSystem, BVH broadphase, witness-based narrowphase. |
| UI (flexbox) | ui | The full flexbox layout engine (two-phase measure/place), the element tree, widgets, theming/styles, the UIRender quad pipeline. A separate render path from the 3D scene. |
| Asset Pipeline | assets | AssetManager, loaders, storage — how assets are loaded, cached, and streamed. |
Platform & core
| Area | Doc | What it covers |
|---|---|---|
| Platform / OS abstraction | platform | Per-OS GameInterface (Windows/Linux/Mac), dynamic library loading (dlopen/LoadLibrary/NSCreateObject), input enums, and the shader-copy-on-reload mechanism. This is where the engine↔demo boundary is physically enforced. |
| Core Utilities | core-utils | Math, containers, log, time, memory, reflection, serialization — the cross-cutting utilities every other subsystem uses. |
3. How to use this tree (agent workflow)
- Orient — read
../AGENTS.md(rules) +cross-repo.md(the contract). Ten minutes, saves hours. - Locate — use the table above (or
cross-repo.md§5's task map) to find the subsystem doc for your task. - Navigate — the subsystem doc's key-types table tells you which header defines each type; where-to-look gives file:line pointers into the actual source. Go to the source — this tree is a map, not the source of truth for implementation detail.
- Respect the rules — the memory model (
DEFINE_REF/DECLARE_REF,RefPtr/OwningPtr/UniquePtr), the CPU/GPU phase split, and the Jolt ground rules fromAGENTS.mdapply everywhere. When a doc andAGENTS.mddisagree,AGENTS.mdwins.
If a subsystem doc is missing or wrong (the engine moves fast), update it
here — the format is simple and consistent (key types → data flow → where to
look → gotchas). Keep AGENTS.md for cross-cutting rules and this tree for
per-subsystem navigation.
4. Pointers to the rest of the repo
../AGENTS.md— the rules + map (start here).../README.md— the human-facing engine README (build instructions, features).../OPTIMIZATIONS.md— the optimization notes (meshlet/culling strategy).../Culling.md— the culling design note (referenced by the render-graph and physics docs).../CMakeLists.txt— the engine build (install/export path; seecross-repo.md§4.2).src/Engine/— the source tree, ~320 files, ~20 subsystems (the per-subsystem docs above map onto it directory-by-directory).