Rune Engine
Rune Engine is the animation-first 2D rendering core behind Story. It exposes a managed .NET SDK over an explicit C ABI, commits immutable snapshots, and replays them on a native render thread for windowed, offscreen, preview, and export workflows.
Animation is data, not a tick loop
RuneValueresolves from analytical spring, bezier, physics, and expression descriptors at frame time- one monotonic clock drives preview, capture, and export with the same curve math
- settle metadata keeps seeking, waiting, and deterministic rendering grounded in the same animation descriptors
Mutable nodes, immutable snapshots
- managed callers record onto mutable
RuneNodeauthoring state node.Commit()publishes an immutable snapshot treeRuneContext.Submit(snapshot)chooses what aSurfacerenders- automatic/manual runtimes and window/offscreen surfaces share the same replay model
Current capability surface
- drawing — rects, rounded rects, double-rounded rects, ellipses, arcs, paths, trimmed strokes, gradients, image brushes, nine-slice, box shadows, and shader programs
- compositing — child snapshot replay, group opacity, clips, motion blur, planar Layer 3D, and explicit whole-target clear plus full-root replay
- text and resources — native text shaping with managed line layout, shared image/font/shaped-text/nine-slice/shader resources, and slot-backed retained brush/path realizations
Managed ↔ native boundary
RuneEngine,Surface,RuneContext,RuneNode, andSnapshotstay as thin .NET wrappers over acdeclnative ABI- offscreen readback and D3D11 image export support deterministic capture and media pipelines
- the current audited backend is Direct2D on Windows with RID-specific native assets
Story relationship
Story bakes script actions into snapshot-backed playback, then reuses the same seek-and-render core for preview, frame export, cue export, live presentation, and MP4 export.
Understand the Engine systems
Read these chapters in order for the complete mental model:
- Architecture and runtime — Engine, Surface, Context, Node, runtime modes, and frame flow.
- Snapshots, commit, and replay — mutable authoring state becoming immutable render data.
- Animation and derived values — RuneValue, analytical curves, repeat, expressions, path sampling, settle, and seek.
- Drawing commands and paths — command/data recording, brushes, transforms, paths, clips, and replay.
- Resources and lifetime — global resources, snapshot ownership, slots, and cleanup.
- Compositing, layers, and effects — child boundaries, opacity, motion blur, Layer 3D, and current full replay.
- Text shaping and layout — native shaping, managed layout, metrics, and current public boundaries.
- Interop and capture — managed/native ownership, manual rendering, readback, and frame export.
Current maturity
Rune.Enginepackage version0.1.0-beta.1- packaged native assets for
win-x64andwin-arm64 - public beta is Windows-first and spec-driven; the current audited backend is Direct2D
Go deeper
- Engine and Story Specs for exact contracts and edge cases
- Engine-powered examples
- See Story on top of Engine
- View source on GitHub