Multiple hkxIndexBuffer objects to 1 hkxVertexBuffer question

Multiple hkxIndexBuffer objects to 1 hkxVertexBuffer question


I've managed to loop through each animationcontainer->mesh->meshsection and grab the vertices for each section, dump those into my own VertexBuffer and render the HavokGirl in the OpenGL pipeline. I can make out the 3d model but it is quite clear that various triangles are missing from the model.

The next step for me was to get at the IndexBuffer for each MeshSection and then draw an element array as opposed to a normal vertex array.

My main issue is that there seems to be multiple hkxIndexBuffer containers in each MeshSection. This is kind of confusing for me as I'm used to 1 vertex buffer being related to 1 index buffer.

I tried a BaseVertex draw method but that just came out really strange so thats obviously not how it was intended to be approached.

 So, in practice, how do I use/concatenate these multiple havok index buffers in each mesh section?

More importantly - why are there multiple index buffers to 1 vertex buffer?



4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi Dan,

The reason a vertex buffer can have more than one associated index buffer is to support UV sets. A UV set refers to a particular mapping of texture UVs to verts. Havok supports up to two UV sets per mesh section. For more info on UV sets, check out this Maya tutorial:

Josh S. Havok Developer Support Engineer

Hi Josh,

Thanks for the prompt reply. Thats good to know and thanks for the multiple UV sets link.

If I'm just aiming to render and animate the default example HavokGirl then could I just use the 1st IndexBuffer element in each hkxIndexBuffers (i.e. ignore the others for now?)

That's probably a good place to start. The important takeaway is that the index buffers are independent, so just picking one to use by itself should provide reasonable results.

Josh S. Havok Developer Support Engineer

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!