Open ligaofeng0901 opened 5 days ago
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.
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.
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.
It seems that if the renderer is WebGPURenderer, it doesn't work.