Instanced Group Mesh support for three.js
Three.js supports instancedMesh
which is a high performance way to render a large number of meshes with the same geometry and material.
But sometimes the model which needed to be instanced can be a complex group rather than a single mesh. This plugin can helps you easily instancing a complex group of meshes.
NOTE: Object type other than Mesh
(like Light
, Camera
, etc) in the given group will be ignored when instancing
Compatible with three.js with instancedMesh
supports, aka r110
and above
$ npm install three-instanced-group-mesh
Just like THREE.instancedMesh
import InstancedGroupMesh from "three-instanced-group-mesh";
const instancedGroupMesh = new InstancedGroupMesh(group, count);
instancedGroupMesh.setMatrixAt(index, matrix)
<script src="https://unpkg.com/three/build/three.js"></script>
<script src="https://unpkg.com/three-instanced-group-mesh/dist/THREE.InstancedGroupMesh.min.js"></script>
<script>
const instancedGroupMesh = new THREE.InstancedGroupMesh(group, count);
instancedGroupMesh.setMatrixAt(index, matrix)
</script>
MIT