You need to create a InstancedBufferGeometry using the original buffer attributes of your model and add a offset and orientation InstancedBufferAttribute in order to use instancing, in addition you need to patch your shader, here is a example pen that also makes shadows work with instances.
You can only make instances per geometry, so you’ll either have to make a instancing batch for each part of your model or merge it into one. If you use different materials and textures that will be an issue, if you’re interested, i’ve made a merging solution for this that allows to merge a model with multiple geometries, materials and textures into one, specifically made for instancing.
Thanks @Fyrestar, and yes our models have different material and texture so i guess this is going to be complicated than it should be. I will check your merging solution and get back for any doubts that may arise.
Whats the case with multiple materials and textures on 1 geometry ?
is this a problem? should it be 1 geo, 1 material, 1 texture or can you have more materials and textures? so long as its only applied to 1 geo?
it’s react, but if you want to have this in vanilla, it’s based on @donmccurdy’s gltf-transform dedupe. after that it’s really just traversing and finding the pairs, and then forming as many THREE.InstancedMesh as pairs you found.