google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
7.01k stars 826 forks source link

[WIP] switch to WebGPU #4939

Open elalish opened 1 week ago

elalish commented 1 week ago

Now that Three.js supports WebGPU, and better yet, WebGPURenderer automatically falls back to WebGL2Renderer on unsupported platforms, it's probably about time we started migrating. Amazingly, it sort of already works! Main problems I've noticed so far are with our custom shaders:

1) custom blur shader for the generated environment. I think we can delete all this code and start using getTextureLevel instead, but that means we'll also have to transition from scene.environment to scene.environmentNode`.

2) custom shadow shader. Just rewrite this in TSL - shouldn't be too complex.

We'll see how the rest goes... FYI @mrdoob.