asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.33k stars 110 forks source link

InstancedMesh Individual Animations #457

Closed thatcomputerguy0101 closed 5 months ago

thatcomputerguy0101 commented 6 months ago

I'm interested in having many copies of the same mesh, but with individual transformation animations applied to each one. Is this possible with the current implementation of InstancedMesh without taking a big performance hit (e.g. by reassigning the instance transformations each loop), or would it be better to just copy the mesh and animate each individual model independently?

thatcomputerguy0101 commented 6 months ago

Apparently my geometry is complex enough that the performance using duplicated regular Meshes was poor even without animations, so I'm moving forward using InstancedMesh and figuring out what I'm doing for animations later.

asny commented 5 months ago

I think using an InstancedMesh and updating the transformation for each instance each frame should perform well. Unless you have a crazy amount of instances of course.