Skinned meshes with BufferGeometry and multiple materials

THREE.SkinnedMesh currently does not work with THREE.BufferGeometry geometries. In THREE.SkinnedMesh.prototype.pose, the mesh assumes geometry.skinIndices exists and goes on normalizing elements of that array. Skipping this part if there is no such array (assuming buffer geometry skinning data is already normalized) makes SkinnedMesh work with BufferGeometry.

However, there is a problem if the skinned mesh consists of multiple materials: THREE.BufferGeometry does not work with THREE.MeshFaceMaterial. One could

  • Split the original mesh into multiple meshes, each with its own BufferGeometry. However, each mesh would then have to duplicate the skeleton bones and play back its own animation.
  • Make THREE.BufferGeometry somehow work with THREE.MeshFaceMaterial, maybe with each chunk having its own material. I have no idea how to do this.
  • Move the skeleton/bones code from SkinnedMesh into a separate THREE.Skeleton class and share that skeleton among meshes. I would prefer this, but maybe it’s too complex to use.

Are there any plans for or opinions on one of the above ideas?

Author: Fantashit

1 thought on “Skinned meshes with BufferGeometry and multiple materials

Comments are closed.