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

Create a UV atlas for a mesh, which is then followed by a call to UVAtlasPack.

HRESULT UVAtlasPartition(
    const XMFLOAT3* positions, size_t nVerts,
    const void* indices, DXGI_FORMAT indexFormat, size_t nFaces,
    size_t maxChartNumber, float maxStretch,
    const uint32_t *adjacency, const uint32_t *falseEdgeAdjacency,
    const float *pIMTArray,
    std::function<HRESULT(float percentComplete)> statusCallBack,
    float callbackFrequency,
    UVATLAS options,
    std::vector<UVAtlasVertex>& vMeshOutVertexBuffer,
    std::vector<uint8_t>& vMeshOutIndexBuffer,
    std::vector<uint32_t>* pvFacePartitioning,
    std::vector<uint32_t>* pvVertexRemapArray,
    std::vector<uint32_t>& vPartitionResultAdjacency,
    float *maxStretchOut = nullptr, size_t *numChartsOut = nullptr);

Parameters

See UVAtlasCreate which details the majority of the parameters to this function.

vPartitionResultAdjacency: Contains three values per face. This is used as input to the UVAtlasPack.

Remarks

UVAtlas can partition mesh geometry two ways:

  • Based on the number of charts
  • Based on the maximum allowed stretch. If the maximum allowed stretch is 0, each triangle will likely be in its own chart