SHADERERA®Video made in code · v0.1.2PluginsAgentsGitHub ↗
← PluginsRenderingcomponent · v0.1.1 · MIT
render-three-hostOfficial · by Shaderera

three.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.

Add it to a filmOr ask your agent
“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
Tags
three.js, webgpu, 3d, renderer, scene, render target, tone mapping, deterministic, node
Source on GitHub ↗
READMErender-three-host

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.

README.mdexample
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 more

camera-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 Rendering02 plugins

More in Rendering