4 UVAtlasApplyRemap
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:45:00 -08:00
UVAtlas

This function applies a vertex remap from UVAtlasCreate or UVAtlasPartition to a vertex buffer if data beyond the content of UVAtlasVertex is used.

The data from the uv texture coordinates in vMeshOutVertexBuffer must be merged into the final VB after applying the remap.

HRESULT UVAtlasApplyRemap(
    const void* vbin, size_t stride, size_t nVerts,
    size_t nNewVerts, const uint32_t* vertexRemap, void* vbout );

Remark

This is the pseudo-code for applying the UVAtlas vertex remap to a vertex buffer:

for each j in nTotalVerts
   oldIndex = vertexRemap[ j ];
   if (oldIndex != -1)
       assert( oldIndex < nVerts );
       memcpy( newVB + j * stride,
               oldVB + oldIndex * stride,
               stride )