Skip to content

docs(examples): immediate-mode rendering example + guide (A5)#159

Merged
Exoridus merged 1 commit into
mainfrom
feat/v0.14-a5-immediate-render
Jun 22, 2026
Merged

docs(examples): immediate-mode rendering example + guide (A5)#159
Exoridus merged 1 commit into
mainfrom
feat/v0.14-a5-immediate-render

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

What

Adds the missing Immediate-Render example + guide for v0.14 Phase 4D (PR-3 / Backlog A5). The drawGeometry / RenderBatch + drawBatch API shipped in #150/#151 but had no example or guide page; this closes that gap.

Example — geometry-graphics/immediate-mode-rendering

A node-free, procedural scene:

  • drawGeometry — 14 procedural gears (regular polygons built as interleaved position + color geometry), each drawn individually with its own raw world Matrix and tint. One draw call each.
  • RenderBatch + drawBatch — a field of 2,400 sparks of one shared static geometry, rebuilt each frame and submitted as a single instanced draw call.
  • Live overlay (mountControls) shows context.stats.drawCalls, and a mountControlPanel toggle flips the spark field between the instanced batch and one drawGeometry per spark, so the draw-call count visibly jumps from a handful to thousands — proving the batch is one draw call.

Guide — rendering/immediate-mode.mdx

New advanced chapter in the Rendering part: when to use immediate mode vs. the retained scene graph, building standard-layout geometry, drawGeometry, RenderBatch/drawBatch, and reading RenderStats.drawCalls. Embeds the example via <ExamplePreview>. Registered in guide-structure.ts with examples + apiLinks (rendering-context, render-batch, geometry, matrix, color).

Verification (all green locally)

  • pnpm typecheck:examples
  • pnpm typecheck:guides
  • pnpm lint ✅ (0 errors; 4 pre-existing warnings in input/keyboard.js)
  • pnpm format:check
  • guide-structure / example-search / guide-prose-links / playground-nav tests ✅ (65 tests)
  • examples:sync-generated .js committed; examples.json entry added by hand
  • Construction sanity-checked against real source (RenderBatch static-geometry guard, add/clear/count, polygon build) via throwaway vitest (removed)

Notes

  • No src/ changes — examples + docs only.
  • backend: "core" (uses the backend-agnostic RenderingContext immediate path).

@Exoridus Exoridus merged commit 912c19e into main Jun 22, 2026
12 checks passed
@Exoridus Exoridus deleted the feat/v0.14-a5-immediate-render branch June 22, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant