cientos
cientos copied to clipboard
Add mergeGeometries as a component
Description
As a developer using TresJS I would like to be able to use the mergeGeometries function that is in the three.js examples dir, so I can optimize performance in case I have many geometries that have the same material and don't need to move independent of each other.
Suggested solution
Be able to do the following:
<TresMesh>
<MergeGeometries>
<TresBoxGeometry :args=[1,4,1] />
<TresBoxGeometry :args=[4,1,1] />
</MergeGeometries>
<TresStandardMaterial>
</TresMesh>
Where the boxes are possibly generated from a v-for loop. The component would merge the geometries in the slot, and basically function as a single geometry as far as the mesh is concerned
Alternative
No response
Additional context
I have a branch with a solution ready for review. This requirement has emerged from a migration from a trois js project
Validations
- [x] I agree to follow this project's Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.