nanoraster
v0.4.1
Published
Tiny headless WebGPU glTF renderer for deterministic PNG, WebP, JPEG, and raw RGBA output.
Maintainers
Readme
Tiny headless WebGPU glTF renderer for deterministic PNG, WebP, JPEG, and raw RGBA output. Runs on a native binary in Node.js and on WebGPU in the browser, from one Rust render core.
Try the live demo, then read the docs: quick start, guides and the API reference, also served as Markdown for agents at nanoraster.xyz/llms.txt.
Install
npm install nanorasterQuick start
import { renderImage } from 'nanoraster';
import { readFile, writeFile } from 'node:fs/promises';
const glb = Uint8Array.from(await readFile('model.glb'));
const image = await renderImage(glb, {
format: 'webp',
width: 512,
height: 512,
});
await writeFile(image.name, image.bytes);Same request, same pixels: the camera, lighting and encoder are fixed for a
given request, so a render can serve as evidence. format: 'raw' returns the
RGBA frame instead of a file, for pixel diffs, video frames and textures
(Work with raw pixels).
Continue with the tutorial and guides.
Reuse the renderer
The one-shot calls share one renderer per process, so only the first call pays
the GPU bring-up; create your own to control its lifetime or power preference.
When you know the full set of outputs, declare them in one renderImages call
with per-view overrides, about three times faster than separate renders:
import { createRenderer } from 'nanoraster';
using renderer = await createRenderer({ powerPreference: 'low-power' });
const [card, og] = await renderer.renderImages(glb, {
format: 'webp',
views: [
{ id: 'card', phi: 60, theta: -45, width: 768, height: 576 },
{ id: 'og', phi: 60, theta: -45, width: 1536, height: 804, format: 'png' },
],
});See Reuse the renderer.
Compatibility
See compatibility.md. Every check mark in that table maps
to a named job in .github/workflows/ci.yml.
Versioning and stability
Versions follow Semantic Versioning. Before 1.0, a minor release may contain a breaking API change; each major line records those changes in BREAKING_CHANGES.md.
Security and provenance
Report vulnerabilities through GitHub private vulnerability reporting. Verify
registry signatures with npm audit signatures.
Links
Changelog · Issues · Contributing · Maintaining
License
Apache-2.0. See license and NOTICE for bundled materials.
Part of the Tau ecosystem.

