← Writing

· updated

When should you use Rust wgpu WASM instead of Three.js?

Use Three.js or R3F for marketing heroes and scroll storytelling; reserve Rust wgpu WASM for compute-heavy labs where a shared native/web engine matters.

By Théo Marini · rust, wgpu, webgpu, wasm

When should you use Rust wgpu WASM instead of Three.js?

Use Rust wgpu compiled to WASM when you need compute shaders, shared native/web engines, or low-GC simulation loops. Keep Three.js / React Three Fiber for immersive marketing heroes where design iteration speed and GSAP scroll tooling dominate.

Why not stream a remote GPU?

Remote GPU streaming (Shadow, Pixel Streaming) maps one visitor to one GPU session, adds latency, and breaks SEO. For a public portfolio with tens of daily users, client WebGL/WebGPU is the state of the art.

What does a healthy split look like?

Homepage hero: R3F + Lenis + GSAP. /labs/wgpu-engine: Rust crate → wasm-pack → WebGPU canvas. Author heavy meshes on a GPU workstation; serve compressed assets from your VPS.

FAQ

Is WebGPU universal? No. Ship WebGL or poster fallbacks. Target experienced users and recent phones, but never assume 100% support.

Does WASM make scenes automatically faster? Not for simple GLB display. Gains appear in custom engines and compute workloads.