I’ve found an other thing that is problematic. You have the following statement in setAnimUV()
:
anim.meshGroup.children[spriteIndex].geometry.elementsNeedUpdate = true;
It’s important to know that objects of type Geometry
are internally converted to BufferGeometry
. The mentioned line of code will trigger a conversion each frame which is of course unfavorable. If you only update uv coordinates, you can remove this line. uvsNeedUpdate
should be sufficient.
Also consider to develop directly with BufferGeometry
to avoid any conversion overhead.