Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
Side note: When the instanced mesh only holds a small number of instances, |
|
@sunag What was the reason for using UBOs for |
AndreyPrakhov
left a comment
There was a problem hiding this comment.
Everything is great. It works as expected.
The idea was to eliminate some extra computations; the official WebGPU instancing example also uses a UBO, but the performance issue can be much broader, as the PR itself shows. I don’t think anything prevents us from using only attributes if that yields better results. |
|
In this case, I would say let's keep the status quo since the UBO usage only works with a small number of instances. There is probably no measurable performance difference in updating the entire small buffer or only a portion but loosing the optimization from #28726. If someone shows us the difference, we can of course always use attributes. |
Fixed #31814.
Description
The PR makes sure the internal attributes in
InstanceNodehonor the update ranges setup of the app level attributes.@AndreyPrakhov With this PR, the
bufferSubData()performance in your fiddle improves significantly. Do you mind testing if everything works on the functional side as expected?