BufferGeometryUtils: Add "deinterleaveAttribute", "deinterleaveGeometry" functions #23814
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue: --
Description
Adds two functions to produce deinterleaved attributes and deinterleave all attributes on a particular geometry in place. This is useful because there are some scenarios where working with interleaved attributes can be a bit of a pain. Specifically "mergeBufferGeometries" does not support interleaved attributes (though maybe that could be updated) and it's risky to transfer an interleaved attribute buffer to a webworker since it may wind up neutering other interleaved attribute buffer arrays which is otherwise not super traceable.
Both uses cases are what I'm concerned with for the current path tracing work since buffer geometries must be merged and the index and position attribute arrays are transferred to a web worker to be used for generating a BVH.