1
\$\begingroup\$

I am trying to build content(a text file contains list of triangles vertices) for an XNA application through a custom pipeline importer. It works ok. But when number of triangles gets near 1m(in this case 946612 triangle & 303112 unique vertex) I get this error:

"XNA Framework HiDef profile supports a maximum VertexBuffer size of 67108863, but this VertexBuffer is 68847328."

1- Is this number in bytes or just the number of vertices? I assume bytes which would make it ~1.3m vertex.

2- The VertexBuffer size, Does it refer to the MeshContent Position collection or the GeometryContent VertexContent or the Model.Meshes[i].MeshParts[i].VertexBuffer.VertexCount?

The reason is that the MeshContent Position collection holds unique vertices whereas the other, all of the triangles vertices which might have duplicates. ex. For a simple cube, the Position collection holds 8 vertex and the VertexContent have 36(12 tri*3) vertex which have duplicates. Once the MeshBuilder.FinishMesh() method is called it reduces to 24 vertex. Why 24? And this is exactly the number that Model.Meshes[i].MeshParts[i].VertexBuffer.VertexCount shows at the runtime.

3- Also, does this error regards only one mesh exceeding certain limit in vertex size or the whole Model.Meshes, or could be both?

Any help to understand how these things work is appreciated.

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .