Planar rendering + Simulation — dogfood gaps
Fast integration labs
Orthographic 2D lives in `Novolis.Rendering.Planar`. Hosts tessellate the scene and submit through `Novolis.Silk`. Simulation stays BCL `Vector3` / `Quaternion` on the XZ plane (Y = 0). Do not add Vector2, suffix-3 types, or Planar types to Math or Physics.
Dogfood apps (new)
| App | Stack | Purpose |
|---|---|---|
labs/rendering/PlanarHello | Rendering.Planar + Silk | Collision, platforms, HUD, menus — no Simulation |
labs/simulation/PlatformerPlanar | Simulation.Kinematics + World + Rendering.Planar | Same tile demo as PlatformerHop, planar XZ via PlanarAgent |
labs/simulation/RtsLitePlanar | Shared RTS sim + Rendering.Planar | Top-down orthographic RTS (Raylib RtsLite = pseudo-3D + PNG billboards) |
Run:
dotnet run --project labs/rendering/PlanarHello
dotnet run --project labs/simulation/PlatformerPlanar
dotnet run --project labs/simulation/RtsLitePlanar| Raylib (3D-style) | Planar (orthographic) |
|---|---|
PlatformerHop | PlatformerPlanar |
RtsLite | RtsLitePlanar |
Shared helpers: Novolis.Game.Scenes (DenseGridPlatforms, OrthoPanCamera).
Side-view vs planar XZ
| Convention | Horizontal | Vertical | Depth |
|---|---|---|---|
Raylib PlatformerHop | Vector3.X | Vector3.Y | Z ≈ 0 |
| Simulation + Planar | Vector3.X | Vector3.Z | Y = 0 |
Bridge at the app layer only (no Simulation → Rendering package reference):
// Side-view position (Raylib) → planar (Simulation / Planar)
static Vector3 SideToPlanar(Vector3 side) => new(side.X, 0f, side.Y);PlanarHopPlayer uses PlanarAgent.Move + SideLevel grid where grid row y maps to world Z.
Simulation: what exists vs gaps
Already aligned (XZ, BCL)
| Package | API | Role for 2D |
|---|---|---|
Novolis.Simulation.Kinematics | PlanarAgent.Move | Grid + optional BVH sweep on XZ |
Novolis.Simulation.World | PlanarOccupancy | Circle vs DenseGrid<byte> |
Novolis.Simulation.View | ViewPose, orbit/free rigs | 3D cameras — not orthographic 2D |
Gaps (no new Math/Physics types)
- No side-view camera in Simulation.View —
ViewPosetargets perspective 3D. Orthographic 2D usesPlanarViewportin Rendering at compose time. Optional future: document-only “side rig” recipe in dogfood, not a new Simulation type. - Duplicate collision paths —
PlanarOccupancy(Simulation) vsPlanarCollisionWorld(Rendering). Apps should pick one per game: PlatformerPlanar uses Simulation for motion; PlanarHello uses Rendering collision only. - No Simulation → Planar scene builder — tile grids are app-wired (
AddPlatformper cell). A shared dogfood helper (not a platform package) could emit platforms fromDenseGrid<byte>if more 2D apps appear. - ViewPose bridge — still app-only for path tracing (simulation-viewpose-to-rendering-bridge); irrelevant for orthographic Planar.
- NeuralRacing / headless sims — no visualization; 2D would be a new app if needed.
- RtsLite / top-down —
RtsLitePlanardogfoods orthographic RTS; PNG billboards still Raylib-only inRtsLite. - Assets — no committed PNGs under lab for
SilkPlanarPngLoader; polygon/HUD dogfood works without art.
Explicit non-goals
Vector2,Vector3d, or planar types in Math/PhysicsNovolis.Simulation.*referencingNovolis.Rendering.*Quaternionhelpers for 2D (Y-axis spin only if ever needed — use BCLQuaternionin apps)
Avalonia hosts
Package `Novolis.Avalonia.Rendering` (novolis-avalonia):
| Control | Renders |
|---|---|
PlanarSceneControl | PlanarScene tessellated through Novolis.Silk.Runtime |
Rgba32FrameControl | CPU Rgba32 frames (IFramePresenter) — path trace preview |
Sample: novolis-lab/labs/avalonia/RenderingAvalonia. PackageReference Novolis.Avalonia.Rendering (no cross-repo ProjectReference).
Dropped: TerraFX
Low-level GPU interop (VMA, D3D12) was considered and not adopted — OpenGL/Vulkan presenters live in `novolis-silk`.
Rendering gaps (for follow-up)
- Raylib Planar backend — not planned; Silk-only host for
Rendering.Planar - Procedural / solid-color sprites without PNG — today use
PlanarStaticPolygonor register a 1×1 texture - PlatformerHop axis — migrating the Raylib app would require coordinate remap or a documented side-view profile