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

BufferGeometryUtils: Add "deinterleaveAttribute", "deinterleaveGeometry" functions #23814

Merged
merged 3 commits into from
Apr 1, 2022

Conversation

gkjohnson
Copy link
Collaborator

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.

@Mugen87 Mugen87 added this to the r140 milestone Mar 31, 2022
@mrdoob mrdoob merged commit 65c16d1 into mrdoob:dev Apr 1, 2022
@mrdoob
Copy link
Owner

mrdoob commented Apr 1, 2022

Thanks!

@gkjohnson gkjohnson deleted the deinterleave-geometry branch April 1, 2022 16:58
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
…ry" functions (mrdoob#23814)

* Add "deinterleaveAttribute", "deinterleaveGeometry" functions

* add morph targets to deinterleaveGeometry function

* ensure we don't create duplicate attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants