Finishes mesh optimization by updating an index buffer based on a vertex remap.

HRESULT FinalizeIB(
   _In_reads_(nFaces*3) const uint16_t* ibin, _In_ size_t nFaces,
   _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts,
   _Out_writes_(nFaces*3) uint16_t* ibout );

HRESULT FinalizeIB(
   _Inout_updates_all_(nFaces*3) uint16_t* ib, _In_ size_t nFaces,
   _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts );

HRESULT FinalizeIB(
   _In_reads_(nFaces*3) const uint32_t* ibin, _In_ size_t nFaces,
   _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts,
   _Out_writes_(nFaces*3) uint32_t* ibout );

HRESULT FinalizeIB(
   _Inout_updates_all_(nFaces*3) uint32_t* ib, _In_ size_t nFaces,
   _In_reads_(nVerts) const uint32_t* vertexRemap, _In_ size_t nVerts );

Parameters

A vertexRemap is an array with nVerts elements that describes how to reorder the vertices of the original mesh. This maps the original vertex location to the optimized location. See OptimizeVertices.

Remarks

This should be done after all required face reordering. See ReorderIB and ReorderIBAndAdjacency.

This is the pseudo-code for how to apply a vertex remap to an index buffer:

for each i in (nFaces *3 )
   newIndices[ i ] = vertexRemap[ indices[ i ] ]

Last edited Jun 14, 2014 at 1:39 AM by walbourn, version 6