You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebGPU is not baseline on major browsers yet, but Three.js WebGpuRenderer can (supposedly) fall back to WebGL if WebGPU is not supported. At some point we will want to switch to WebGPU. In particular, it opens up the possibility of using Three Shader Language for custom shaders, automatically generating GLSL or WGSL as appropriate.
WebGPU is supported now — landed in #53 (and ported to the Solid 2.x line in #56).
Rather than depending on three/webgpu ourselves, the gl prop and useThree().gl were widened to a structural Renderer union (WebGLRenderer | WebGPURenderer | RendererLike). Any renderer matching the shape works — WebGPURenderer, the DOM renderers (SVGRenderer, CSS2DRenderer, CSS3DRenderer), or your own.
Usage
import{WebGPURenderer}from"three/webgpu"<Canvasgl={canvas=>newWebGPURenderer({ canvas })}>{/* scene */}</Canvas>
solid-three awaits renderer.init() automatically before the first frame, so the async WebGPU setup just works — no manual await needed. It also skips init() when hasInitialized() is already true, so a pre-initialized renderer is fine too. WebGL-only config (toneMapping, outputEncoding, the flat gl={{ ... }} object form) is guarded so it does not get applied to a non-WebGL renderer.
Typing it project-wide
By default gl is the open Renderer union. If your whole app is WebGPU, declare it once and the type narrows everywhere:
After that, useThree().gl.init() is typed with no narrowing, and passing a WebGLRenderer to <Canvas gl> becomes a type error.
Re: TSL — since you bring your own WebGPURenderer instance, Three Shader Language works exactly as it does in plain three; nothing extra on the solid-three side. Docs are in the README under Custom renderers.
Closing as resolved by #53 / #56 — shout if anything is missing.
Activity
bigmistqke commentedon Jun 5, 2026
WebGPU is supported now — landed in #53 (and ported to the Solid 2.x line in #56).
Rather than depending on
three/webgpuourselves, theglprop anduseThree().glwere widened to a structuralRendererunion (WebGLRenderer | WebGPURenderer | RendererLike). Any renderer matching the shape works —WebGPURenderer, the DOM renderers (SVGRenderer,CSS2DRenderer,CSS3DRenderer), or your own.Usage
solid-three awaits
renderer.init()automatically before the first frame, so the async WebGPU setup just works — no manualawaitneeded. It also skipsinit()whenhasInitialized()is already true, so a pre-initialized renderer is fine too. WebGL-only config (toneMapping,outputEncoding, the flatgl={{ ... }}object form) is guarded so it does not get applied to a non-WebGL renderer.Typing it project-wide
By default
glis the openRendererunion. If your whole app is WebGPU, declare it once and the type narrows everywhere:After that,
useThree().gl.init()is typed with no narrowing, and passing aWebGLRendererto<Canvas gl>becomes a type error.Re: TSL — since you bring your own
WebGPURendererinstance, Three Shader Language works exactly as it does in plain three; nothing extra on the solid-three side. Docs are in the README under Custom renderers.Closing as resolved by #53 / #56 — shout if anything is missing.