Skip to content

ZenFG

Build rendering features, compose GPU systems, and understand every frame.

ZenFG coordinates rendering and compute through an explicit FrameGraph. Build domain-specific features with WebGPU or wgpu, connect existing engines, and compose their work in one frame. You control scenes, materials, pipelines, and rendering policy; ZenFG coordinates declared dependencies, execution order, transient resource lifetimes, and diagnostics. Idiomatic TypeScript and Rust runtimes share semantics and portable Snapshots, with an embeddable Inspector.

Why ZenFG

  • Build independently — Use native GPU APIs or compatible libraries while keeping your own renderer architecture.
  • Compose existing work — Combine external engines with graph-native rendering and compute modules through explicit shared resources and execution boundaries.
  • Understand actual frames — Inspect graphs, resources, and optional CPU/GPU timings. Export Snapshots alongside code for human or AI-assisted analysis, then capture again to verify changes.
  • Coordinate dependencies and resources — Retain required work, cull unused work, and manage transient allocation, lifetimes, aliasing, and pooling.

Three.js Co-rendering: two renderers share color and depth attachments, with mutual occlusion in one scene.

Also explore GPU culling and indirect drawing in the Reference Renderer, PlayCanvas Streaming GSplat (network required), and TypeGPU Slime Mold compute and render nodes. Each example documents its dependency versions and integration details.

Start here

Browse the documentation index for guides and reference material. Before changing public semantics, examples, or release artifacts, read Contributing.

Integration levels

Connect an engine that keeps its own submissions, or build modules that record work into the graph; both approaches can be combined. Technically, ZenFG offers the three integration depths below.

Interoperability requires a shared device and queue, compatible resource formats and usage contracts, and accurate access declarations. Import each shared native resource once per recording. External-engine passes stay opaque; GPU timing depends on device support and node coverage. Snapshots contain neither replayable commands nor resource contents.

The application controls rendering policy and chooses how deeply each subsystem integrates with the graph. ZenFG coordinates the work; scenes, materials, and renderer architecture remain with the application.

ZenFG ownsThe application owns
Graph-visible dependencies and execution orderScenes, materials, cameras, and renderer architecture
Retention roots and dead-work cullingPipelines, bind groups, samplers, and draw/dispatch policy
Transient lifetimes, aliasing, and poolingDevices, queues, surfaces, presentation, and device-loss policy
Validation, reports, Snapshot projection, and inspectionLong-lived resources, resource contents, and application state

Three integration levels can be mixed in the same frame:

  • Native render, compute, and copy nodes provide the richest validation and diagnostics.
  • Command integration lets a subsystem encode custom work into a FrameGraph-owned command encoder.
  • Opaque external submission lets an existing renderer keep its encoders and submission model while declaring an ordered graph boundary.

See Core concepts for the complete ownership, content, dependency, lifetime, and execution model.

Packages

PackagePurposePublished versionDocumentation
@zenfg/webgpuTypeScript/WebGPU FrameGraph runtimePublished packageGuide
@zenfg/snapshotSnapshot 1.2 types, codec, validation and specificationPublished packageGuide
@zenfg/inspectorEmbeddable DOM InspectorPublished packageGuide
zenfgRust/wgpu FrameGraph runtimePublished packageGuide
zenfg-snapshotRust Snapshot 1.2 codec, validation and migrationPublished packageGuide

Direction

We are exploring reusable GPU-driven mesh, particle, and post-processing modules, so independently built rendering features can come together in real applications.

Status

ZenFG 0.1.0 is the first non-prerelease version. Public APIs may change before 1.0; integrations should pin exact package versions and review migration notes.

TypeScript and Rust share semantics and portable diagnostics, not source-level API parity. Snapshot wire format versioning is independent from package versions; see the compatibility matrix and changelog.

License

ZenFG is available under the MIT License.

Open source / MIT licensed