8 FinalizeVBAndPointReps
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:34:24 -08:00
DirectXMesh

Finishes mesh optimization by reordering vertices and/or adding duplicated vertices for the vertex buffer, and the point representatives.

HRESULT FinalizeVBAndPointReps(
   const void* vbin, size_t stride, size_t nVerts, const uint32_t* prin,
   const uint32_t* dupVerts, _In_ size_t nDupVerts,
   const uint32_t* vertexRemap,
   void* vbout, uint32_t* prout );

HRESULT FinalizeVBAndPointReps(
   void* vb, size_t stride, size_t nVerts, uint32_t* pointRep,
   const uint32_t* vertexRemap );

Parameters

The vbin buffer (or vb for in-place finalize) must be nVerts*stride bytes.

The prin buffer (or the pointRep for in-place finalize) must have nVerts elements.

The vbout buffer must be (nVerts+nDupVerts)*stride bytes.

The prout buffer must have nVerts+nDupVerts entries.

A vertexRemap is an array with nVerts+nDupVerts elements that describes how to reorder the vertices of the original mesh: oldLoc = vertexRemap[newLoc]. See OptimizeVertices. It can be nullptr for an 'identity' remap when just performing duplication.

dupVerts contains nDupVerts elements indicating vertices that need duplicating. Each entry indicates the index of the original vbin vertex buffer to duplicate. The vertexRemap array also indicates reorder information for the duplicated vertices (where oldLoc is greater than nVerts). dupVerts can be nullptr if nDupVerts is 0.

Remark

This version is used to maintain the point reps array after a vertex remap. If the point reps are not needed, use FinalizeVB instead.