I am writing implementation of custom model importer, processor all the way to my own custom model class.
Using MeshBuilder class , I am creating a set of positions followed by iteration of all faces (separated by calls to SetMaterial)
My geometry is composed of a single set of positions (corresponding to a single vertexbuffer) and a set of faces ( which all are indexing the same set of positions)
Sort of like:
Positions:
Position 1
Position 2
Position 3
Faces (material A)
Face1 index1, index2, index3
Face2 index4, index5 index6
Faces ( material B)
Face1 index7, index8, index9
Face2 index10, index11 index12
This results in multiple sets of GeometryContent objects corresponding to the number of SetMaterial calls ( in this case material A and material B)
The only problem is that each of these GeometryContent objects gets its own VertexContent/IndexCollection, which is not what I want in this case.
In other words, what I get is something like
GeometryContent - material A
VertexContent
IndexCollection - indexes from 0
GeometryContent - material B
VertexContent
IndexCollection - indexes from 0
In effect, what happens is that my original single vertex buffer/ multiple index buffers geometry gets split into two GeometryContent objects which have their own set of vertex/index buffers.
The question is, how do I proceed to end up with single VertexContent containing all my positions data and a separate set of IndexCollections , all indexing into the same VertexContent.
In other words, how does one implement a single vertexbuffer, multiple index buffers within the MeshBuilder/content pipeline framework.