WebGPU compute-shader starfield (1M particles)
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
> **Skills:** WGSL compute shaders · Three.js WebGPU renderer · R3F integration
> **Time:** ~24 hours
> **Good for:** GPU-curious devs · perf engineers · folks bored of WebGL
> **Difficulty:** Advanced
---
## Context
The current `Starfield` component uses a 9k-point InstancedMesh on
``. Browsers with WebGPU support (Chrome 113+, Safari 18+, Edge) can
run compute shaders that handle 1M+ particles at 60fps with smooth motion
integration on the GPU.
## Goal
Replace the WebGL2 path with a WebGPU compute-shader starfield that simulates
~1M stars on supported browsers. Fall back to current InstancedMesh for
WebGL2-only devices.
## Where to start
- Three.js r170 has a WebGPU renderer (`three/webgpu`)
- R3F v9 supports the WebGPU renderer via a custom Canvas
- WGSL compute shader integrates per-particle position via deterministic
noise; render via TSL or raw WGSL fragment shader
- `components/Starfield.tsx` — branch on WebGPU availability
## Acceptance criteria
- 60fps with 1M particles on a recent Mac
- Graceful fallback to 9k InstancedMesh on Firefox / older browsers
- Mobile gets a moderate 20k particle WebGPU path (tuned for thermal)
- No regressions in the WebGL2 path
## Reference
https://threejs.org/docs/#manual/en/introduction/WebGPU
Contributor guide
Assessment
This issue has not been assessed yet.