Building renderer Data


I’m currently writing an engine, and wanted to have Collada as my asset format. One of the problems I’m presently facing is the way the buffers (positions, normals, texcoords) are encoded. Other threads like this one refer to the same problem: I want to build a vertex buffer and an index buffer for my polygons, but the way the data in represented in collada (there is no unified indexation like in DirectX or OpenGL: index 0 pointing to Position0, Normal0, Texcoord0…) prevents me to do that.

I had a look at the deindexer conditioner code in the refinery (which looks a lot like CrtScene::BuildRenderData in Collada RT), but something’s bothering me:
For a triangle-based mesh, this function seems to create N*3 vertices where N is the number of triangles in the mesh. Is it really the case ? I believe it would be more efficient to duplicate vertices with different attributes
(For example same position, but different normals and texcoords) and keep an indexed primitive.



I had a look at

Looks like I didnt’ look at the code well enough.

Sorry about that.


You can also look at the ‘COLLADA for XNA’ C# source code that includes the conditioner to create DirectX from COLLADA <mesh>.