diff --git a/CLAUDE.md b/CLAUDE.md index 88aec9b..e54d0fb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -72,6 +72,34 @@ ourselves". `PrepareMeshDataAsync(id, isSetup)` to fire the background decode. Result auto-enqueues to `_stagedMeshData` which `Tick()` drains. `WbMeshAdapter` does this for you on first registration. +- **N.5 modern dispatch** (`docs/superpowers/specs/2026-05-08-phase-n5-modern-rendering-design.md`) + uses bindless textures + multi-draw indirect on top of N.4's grouped + pipeline. Per frame: three SSBO uploads (`_instanceSsbo` mat4 per + instance @ binding=0; `_batchSsbo` `(uvec2 textureHandle, uint layer, + uint flags)` per group @ binding=1; `_indirectBuffer` + `DrawElementsIndirectCommand[]` opaque-section + transparent-section). + Two `glMultiDrawElementsIndirect` calls per frame, one per pass. + Total ~12-15 GL calls per frame for entity rendering regardless of + scene complexity. +- **`TextureCache` requires `BindlessSupport`** for the WB modern path. + Three `Bindless`-suffixed `GetOrUpload*` methods return 64-bit handles + made resident at upload time, backed by parallel Texture2DArray uploads + (`UploadRgba8AsLayer1Array`). The legacy `uint`-returning methods stay + for Sky / Terrain / Debug / particle paths that still sample via + `sampler2D`. After N.6 retires legacy renderers, the legacy upload path + + caches can be deleted. +- **Translucency model is two-pass alpha-test** (matches WB), not + per-blend-mode subpasses. Opaque pass discards `α<0.95`; transparent + pass discards `α≥0.95` AND `α<0.05`. Native `Additive` blend renders + as alpha-blend on GfxObj surfaces — falsifiable; if a magic-content + regression shows up, add a third indirect call with + `glBlendFunc(SrcAlpha, One)` per spec §6 fallback (~30 min change). +- **Per-instance highlight (selection blink) is reserved.** `mesh_modern.vert`'s + `InstanceData` struct has a documented hook for `vec4 highlightColor` + — Phase B.4 follow-up adds the field + plumbs server-side selection + state. Stride grows from 64 → 80 bytes when added; shader updates + trivially (read the field from `Instances[instanceIndex]` + mix into + fragment color). **Execution phases:** R1→R8 in the architecture doc. Each phase has clear goals, test criteria, and builds on the previous. Don't skip phases.