Files
yawn/docs/index.md
T

1.7 KiB

layout, hero, features
layout hero features
home
name text tagline actions
Yawn Render graphs over shared data. A small Rust/WASM core with optional conventional TypeScript handles.
theme text link
brand Start the tutorial /guide/getting-started
theme text link
alt Open playground /playground
title details
Hot state stays shared Transform, material, light, and camera changes are direct SharedArrayBuffer writes from any thread.
title details
Graph-authored GPU work WGSL, pipelines, compute, HDR, and post effects live in one externally supplied DAG loadout.
title details
Conventional when wanted The handles addon supplies Scene, Mesh, materials, lights, glTF import, and BVH picking without adding core semantics.

The shortest useful scene

import { Mesh, PBRMaterial, Scene } from "@yawn/handles";

const scene = new Scene(document.querySelector("canvas"), { hdr: true });
await scene.ready;

const material = new PBRMaterial(scene, { baseColor: [0.2, 0.7, 1, 1] });
await material.ready;
const mesh = new Mesh(scene, {
  material,
  vertexData: {
    positions: [-0.7, -0.6, 0, 0.7, -0.6, 0, 0, 0.7, 0],
    indices: [0, 1, 2],
  },
});
await mesh.ready;

mesh.position.x = 0.25; // direct SAB mutation

Scene installs one HDR clustered-forward loadout. Adding compute, custom shaders, textures, or post effects rebuilds that same loadout; changing values already present in shared rows does not send a message.

handles ──▶ graph AST ──▶ S-expression ──▶ core worker ──▶ Rust/WebGPU
any JS thread ─────────────── direct SAB row writes ────────────────┘