Skip to content

DownDraft — TypeScript app engine for native WebGPU

Native engine. WebGPU rendering. TypeScript-first.

DownDraft is a TypeScript app engine that runs your code on a native runtime — winit + wgpu under Bun, Node, or Deno. Real desktop windows, not a browser. A typed-DI module system, a permission-tiered plugin/mod loader, and a built-in MCP server for AI-assisted development.

Quick Start

Scaffold a new app

Bootstrap a project with the DownDraft CLI — templates, configs, and dev server all set up for you.

bash
bunx @downdraft/cli new my-app
Bun winit WebGPU TypeScript Rapier3D

Capabilities

The core systems, wired together

ECS Architecture

Entity-component-system that scales from a few dozen to thousands of entities. Change detection, hierarchy, and event batching built in — so you focus on gameplay, not plumbing.

WebGPU Rendering

Deferred pipeline with shadows, post-processing, and a render graph with automatic resource aliasing. Ships with html-ui — Blitz HTML/CSS rasterized in a worker and composited in-process — plus an offscreen-rendered surface mode for world-space UI.

Mods & Plugins

User-authored plugins and mods load at runtime from plugins/ — worker-js, WASM, QuickJS, and asset-pack formats behind tiered permissions. Engine features compose separately through a typed-DI module system.

MCP Server

Built-in MCP server exposes scene editing, entity spawning, asset management, and debugging over JSON-RPC — usable by AI assistants or any MCP client.

Physics

Rapier3D-powered physics with character controllers, collision detection, and multi-realm support behind a backend-agnostic API surface.

Audio

Spatial audio powered by Kira (Rust FFI) with a full mixer, effects chain, and 3D listener tracking.

Architecture

Designed for performance

DownDraft pairs a deferred WebGPU render pipeline with a modular plugin ecosystem in a single native process — Bun, Node, or Deno for the JS runtime, winit for windowing, wgpu for the GPU. Zero-copy SharedArrayBuffer keeps data flowing between threads with no serialization overhead.

See the architecture docs →

Bun/Node/Deno + winit
WebGPU / WGPU
Worker-backed binary saves
Rapier3D physics
Kira audio (Rust FFI)
Blitz html-ui + devtools
MCP (JSON-RPC)

Runtime

Native all the way down

DownDraft apps run as a single process driving a real OS window and the GPU directly — Bun by default, with Node and Deno supported. The platform is a Rust library your code calls into, not a shell around it.

One process, direct calls

Windowing, rendering, assets, and the MCP server all live in one process. Talking to the platform is a plain function call — nothing crosses a process boundary, so nothing gets serialized, copied, or awaited on a channel.

Threads where they matter

The simulation runs in a dedicated worker thread with SharedArrayBuffer, so heavy app logic never blocks rendering. Workers can even share the GPU device and encode command buffers in parallel.

A fraction of the footprint

Apps ship as one executable plus a Rust library — tens of megabytes for Bun-compiled builds (Node-embedded builds are roughly double), with low baseline memory. What your GPU draws is exactly what your code asked for.

Render Pipeline

How a frame gets built

Everything — simulation, rendering, and UI — runs inside one native process. The host owns the window and GPU device; workers handle simulation over SharedArrayBuffer. Frames go straight to the screen.

01

Simulation

Single-threaded scheduling for the ECS in a dedicated worker thread, with multicore work dispatched over SharedArrayBuffer — no locks, no serialization.

02

Render graph

wgpu drives the scene — compute shaders, explicit resource binding, and a Bevy-style render graph with automatic resource aliasing. Translated to Vulkan, Metal, or D3D12 depending on platform.

03

UI — flat path

html-ui documents (Blitz HTML/CSS) rasterized in a dedicated worker and drawn straight onto the frame for HUDs, menus, panels, and the docked devtools UI.

04

UI — world-space path

Offscreen UI rendered to a GPU texture via the native-osr module, imported into the render graph and drawn as geometry — for panels that need to exist inside the 3D scene.

05

Composite

One frame, one process — simulation, scene, and interface presented together on the native window. Built-in devtools and tracing profile any of it.

Status

Early, and still moving

DownDraft grew out of the engine work for To The Ocean and is now being built as a standalone engine. Architecture decisions are still being made in the open — feedback shapes what ships.

In active development