render-three-hostOfficial · by Shadererathree.js on the host GPU
three.js WebGPURenderer on host.gpu, deterministic: node clock set to t (never the wall clock), HDR scene tone-mapped and sRGB-encoded into the frame, handed to the host as a GPU texture layer with no copy; works in Node and the browser.
“Use the shaderera-plugins skill to add render-three-host to this film and wire it in, then run check and show me a still.”
- Type
- component · Rendering
- Version
- 0.1.1 · published
- Licence
- MIT
- Built on
- No other plugins
- npm
- three 0.186.1
- @types/three 0.186.0
- Copies
- Tags
- three.js, webgpu, 3d, renderer, scene, render target, tone mapping, deterministic, node
How to
use it.
three.js on the host's GPU, deterministic, in Node and the browser: render a scene at t and return it as a layer.
import * as THREE from 'three/webgpu'import { createThreeHost, threeCamera } from './three/host.ts'// in openconst three = await createThreeHost(host) // { toneMapping, exposure, samples, output }const scene = new THREE.Scene()const box = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshBasicNodeMaterial())scene.add(box)const camera = threeCamera(W / H) // WebGPU clip spacecamera.position.set(0, 0, 3)camera.lookAt(0, 0, 0)// in render(t, options)box.rotation.y = treturn three.render(scene, camera, t, options) // a layer; return an array to add morecamera-keyframes can drive the camera: applyToThree(cameraTrack(keys)(t, W / H), camera, W / H).
Colours come out as written by default (no tone mapping): a paper #F7F5F0 stays that colour and artwork keeps its own. A lit 3D scene with bright lights wants toneMapping: THREE.ACESFilmicToneMapping (or Neutral); ACES greys a white background.
It closes the traps of three in a frame-by-frame renderer: three's node clock runs from its own requestAnimationFrame and adds the wall-clock time between renders (stopped here; set to t), WebGPURenderer does not tone-map or sRGB-encode into a target (an output pass does), and MSAA with blending is not deterministic on Dawn/D3D12 (samples 0 by default). The frame goes to the host as a GPU texture with no copy; output: 'bytes' reads it back instead. Installs three 0.186.1.
Edges step without MSAA. samples: 4 smooths them when nothing in the scene blends: opaque materials only (no transparent, alpha-mapped cards or reflections). Run shaderera check after turning it on: it renders the same t in two orders and fails if the pixels differ.
More in Rendering
render-gaussian-splatsOfficial · by ShadereraGaussian splats3D Gaussian splats (.splat and 3DGS .ply) rendered on host.gpu with EWA splatting, sorted back to front deterministically every frame, the frame as a premultiplied GPU texture layer; raw WebGPU, no packages.render-image-texturesOfficial · by ShadereraImage texturesArtwork and photos as three.js textures decoded identically in Node and the browser (pure-JS PNG and JPEG), an atlas of many images for instanced cards, and a tool that converts WebP, AVIF, GIF or video frames to PNG once.