R3F WebGPU, WebGL2 Fallback, Tree Shaking

Hi,

R3F docs state how to use WebGPU (v9 Migration Guide - React Three Fiber). Is it still the official way to use it?

If WebGPU isn’t available I assume I have to check it myself before creating the renderer?

What is the recommended way to tree shake this situation? I really don’t want to import the whole three/webgpu package or is it necessary?

Best

THREE.WebGPURenderer does not require WebGPU support — it includes a fallback to WebGL2 for standard features. You’d need to avoid certain WebGPU features (like compute) if you require the WebGL2 fallback.

1 Like