Calculate per-triangle IMT's from per-texel data. This function is similar to UVAtlasComputeIMTFromTexture, but can calculate higher dimensional values than 4.

HRESULT UVAtlasComputeIMTFromPerTexelSignal(
    _In_reads_(nVerts) const XMFLOAT3* positions,
    _In_reads_(nVerts) const XMFLOAT2* texcoords,
    _In_ size_t nVerts,
    _When_(indexFormat == DXGI_FORMAT_R16_UINT,
    _When_(indexFormat != DXGI_FORMAT_R16_UINT,
        _In_reads_bytes_(nFaces*sizeof(uint32_t))) const void* indices,
    _In_ DXGI_FORMAT indexFormat, _In_ size_t nFaces,
    _In_reads_(width*height*nComponents) const float *pTexelSignal,
    _In_ size_t width, _In_ size_t height,
    _In_ size_t signalDimension, _In_ size_t nComponents,
    _In_  DWORD options,
    _In_opt_ std::function<HRESULT(float percentComplete)> statusCallBack,
    _Out_writes_(nFaces * 3) float* pIMTArray);


pTexelSignal: A float array of width * height * nComponents in size.

signalDimension: How many floats per texel to use in calculating the IMT.

options: A combination of UVATLAS_IMT flags
  • UVATLAS_IMT_DEFAULT - The default is no wrapping in either U or V.
  • UVATLAS_IMT_WRAP_U - Wrap in the U dimension
  • UVATLAS_IMT_WRAP_V - Wrap in the V dimension
  • UVATLAS_IMT_WRAP_UV - Wrap in both the U and V dimensions.
pIMTArray: The resulting IMT data which is passed to UVAtlasCreate or UVAtlasPack which is an array of 3 float values per face.

Last edited Oct 31, 2014 at 6:40 PM by walbourn, version 3