-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Description
Description
It's not always possible to know how much memory is required for a scene up front and you may need to expand the buffer geometry attributes to store more data (or shrink them). Similar to #29463, this could relevant for games, simulation visualizations, editors, or 3d tiles rendering.
Solution
Add support for a "resizeGeometry" and "resizeInstances" functions that takes a new index size, attribute size, and instance count. Passing any of them in as "null" or "-1" results in no changes to the sizes:
BatchedMesh.resizeGeometry( vertexCount = - 1, indexCount = - 1 );
BatchedMesh.resizeInstances( instanceCount );
Additionally we'd want functions or members indicating how "full" the capacity is so user code can determine whether and how much the BatchedMesh instances need to be adjusted.
cc @Mugen87
Alternatives
Similar to #29463, there aren't any great alternatives to this. Though a user could instead choose to create a new BatchedMesh instance and use both in the scene if this kind of expansion is needed, though it's not ideal.
Additional context
No response