Skip to content

MPanknin/kiln-render

Repository files navigation

Kiln

A WebGPU-native out-of-core volume rendering system for large virtualized volumetric datasets.

Kiln streams multi-gigabyte volumes over HTTP, rendering them at interactive framerates using a bounded GPU residency/atlas cache and virtual-texture indirection. It handles single-channel and multichannel OME-Zarr datasets (up to 4 channels).

v0.4.1 — Multichannel rendering is in beta; see Multichannel for details and known limitations.

Documentation: New to Kiln? Start with the Guide, or browse the full docs index.


Chameleon CT scan — 2160 MB, 1024 × 1024 × 1080 @ 16-bit

Chameleon CT scan — 2160 MB, 1024 × 1024 × 1080 @ 16-bit · Live demo → · Gallery →

Install

npm install kiln-render

Ships as an ES module with bundled dependencies and TypeScript types (including @webgpu/types) — no peer packages to install.

Usage

<canvas></canvas>
<p id="status"></p>
import { KilnViewer } from 'kiln-render';

const canvas = document.querySelector('canvas');
const status = document.querySelector('#status');

try {
  const viewer = await KilnViewer.create(
    canvas,
    'https://ome-zarr-scivis.s3.us-east-1.amazonaws.com/v0.5/96x2/beechnut.ome.zarr',
  );
  status.textContent = `rendering — mode: ${viewer.mode}`;
  window.viewer = viewer;
} catch (err) {
  status.textContent = `failed: ${err.message}`;
  console.error(err);
}

KilnViewer.create() initialises WebGPU, sets up streaming, and starts the render loop; it rejects with a descriptive error if WebGPU is unavailable (hence the try/catch). See the Quick start for ViewerOptions, viewer properties, state serialisation, and cleanup.

Features

  • Out-of-core streaming — Fixed VRAM footprint, SSE-based LOD selection, LRU brick cache
  • Multichannel rendering — Up to 4 channels with per-channel colour, windowing, and visibility controls (details)
  • OME-Zarr & Kiln binary — Stream from S3, CDN, or load local files (OME-Zarr v0.4/v0.5, uint8/uint16/float32)
  • Local filesystem — Load local .zarr / .ome.zarr directories via the File System Access API (Chrome/Edge)
  • uint8, uint16 & float32 inputuint16 and float32 are converted to r16float for GPU storage, with window/level controls
  • Compute shader raymarching — Brick-aware DVR (with density scale), MIP, isosurface, and slice plane rendering

Developing from source

Clone the repo and install dev dependencies (this is for working on Kiln itself — consumers only need npm install kiln-render, above):

# Install dependencies
npm install

# Start development server (single-channel demo)
npm run dev

# Start multichannel demo
npm run dev:multichannel

# Build demo for production
npm run build

# Build the library (outputs to lib/)
npm run build:lib

The demo loads a sample dataset from S3. To load custom datasets, see Loading data.

Browser Requirements

Kiln requires WebGPU support:

  • Chrome/Edge 113+
  • Safari 26+
  • Firefox 141+

Make sure hardware acceleration is enabled in your browser settings.

License

Apache 2.0


About

A WebGPU-native out-of-core rendering system for large virtualized volumetric data.

Topics

Resources

License

Stars

59 stars

Watchers

1 watching

Forks

Contributors