My issues are:
When this is the signature of the constructor:
new BABYLON.SubMesh(materialID, verticesStart, verticesCount, indexStart, indexCount, mesh);
I don’t fully know what to put in the indexStart and indexCount parameters. Is it the index for the vertex (like: Hey SubMesh, you start from the fourth vertex to the sixteenth therefore indexStart = 4 and indexCount = 12) or is it the real buffer values, which the would be the values x 3 because e.g. the positions buffer is three times the vertices count.
To be honest, for me it doesn’t look that complicated, but i am getting strange results (take a look at the playground) and therefore i am confused. An example why i am also confused: In this playground multimaterial example the sphere is divided in three submeshes. How can it come that the last submeshes’ index starts at 1800 and has the size of 2088 but the vertices count is 703 and therefore the maximum buffer size should be 703*3 = 2109?!
(This is only an observation, not really hindering me from texturing my lovely wall)
By creating a SubMesh with new SubMesh, it is pushed into mesh.subMeshes internally, which cannot be seen from the programmers perspective. If you console.log(sphere.subMeshes); in the multimaterial example, you’ll see that the subMeshes array is twice the size of the createdSubmeshes.
Thanks for any hint and/or enlightenment.
Have a nice weekend!