WebGPU support#131
Conversation
| */ | ||
| public onFrustumEnter: OnFrustumEnterCallback = null; | ||
| /** @internal */ _renderer: WebGLRenderer = null; | ||
| /** @internal */ _renderer: WebGLRenderer | WebGPURenderer = null; |
There was a problem hiding this comment.
Maybe we can use just Renderer type
There was a problem hiding this comment.
Possibly can leave this file untouched if the separate InstancedMeshGPU module works
There was a problem hiding this comment.
WebGLRenderer and WebGPURenderer do not inherit from a shared Renderer base class, so there are unfortunately many issues when I tried to use Renderer here
| this.uniformsTexture?.update(renderer); | ||
| this.boneTexture?.update(renderer); | ||
| // TODO convert also morph texture to squared texture to use partial update | ||
| if (renderer instanceof WebGLRenderer) { |
There was a problem hiding this comment.
I'd prefer to have separate files for webgl and webgpu for better tree shaking, as I did in this repository
|
Thanks! I would be curious to see the tsl part, after which we can proceed with refactoring. |
|
I included some basic TSL for the shaders. Also I guess the new InstancedMeshGPU class would be better as a subclass or separate interface instead of duplicating code |
There was a problem hiding this comment.
ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
|
Thanks for starting this PR! I also really want to use InstancedMesh2 for a WebGPU project. Anything I could do to help move this forward? Happy to try to contribute. 😄 |
|
My WIP adding WebGPU support: #154 |




Support for ThreeJS WebGPURenderer
getBoneMatrixgetInstancedMatrixgetColorTexture.fragmentNodeand.colorNodeTodo:
SquareDataTextureGPUInstancedBufferAttributefor texture data?