Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with WebGPURenderer? #40

Open
ligaofeng0901 opened this issue Nov 18, 2024 · 3 comments
Open

Incompatible with WebGPURenderer? #40

ligaofeng0901 opened this issue Nov 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ligaofeng0901
Copy link

It seems that if the renderer is WebGPURenderer, it doesn't work.

@agargaro
Copy link
Owner

It is currently only compatible with WebGLRenderer.

I still have to study how WebGPURenderer works, but I think many things will be done differently.
For example, frustum culling without BVH will be performed on GPU instead of CPU.

I would be happy if someone experienced would like to contribute.

@agargaro agargaro added the enhancement New feature or request label Nov 18, 2024
@ligaofeng0901
Copy link
Author

It is currently only compatible with WebGLRenderer.

I still have to study how WebGPURenderer works, but I think many things will be done differently. For example, frustum culling without BVH will be performed on GPU instead of CPU.

I would be happy if someone experienced would like to contribute.

Thanks! If we only consider make it compatible with WebGPURenderer , it will not cost too much time. But If we want optimize it with some features of WebGPU, I think some modules need refactor.

@agargaro
Copy link
Owner

agargaro commented Nov 19, 2024

Having a working basic version would be great. :D

I think the main things to change are:

  1. do not modify the shader using Material.onBeforeCompile. We have to use an alternative method to be able to read instanceId from a texture.

  2. don't use GLInstancedBufferAttribute and figure out how to modify an attribute inside onBeforeRender. I had to use GLInstancedBufferAttribute because otherwise the attribute update would run the next frame, causing incorrect frustum culling.

  3. Figure out how to get setUniformAt to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants