protected string GetGeometryFormatString( SubMeshLodGeometryLink geom )
{
// Formulate an identifying string for the geometry format
// Must take into account the vertex declaration and the index type
// Format is (all lines separated by '|'):
// Index type
// Vertex element (repeating)
// source
// semantic
// type
string str = string.Format( "{0}|", geom.indexData.indexBuffer.Type );
for ( int i = 0; i < geom.vertexData.vertexDeclaration.ElementCount; ++i )
{
VertexElement elem = geom.vertexData.vertexDeclaration.GetElement( i );
str += string.Format( "{0}|{0}|{1}|{2}|", elem.Source, elem.Semantic, elem.Type );
}
return str;
}