This project has moved and is read-only. For the latest updates, please go here.
Calculates per-triangle IMT's from a custom application-specified signal that varies over the surface of the mesh (generally at a higher frequency than vertex data), to be used as input to UVAtlasCreate or UVAtlasPartition. The signal is evaluated via a user-specified callback function.

HRESULT UVAtlasComputeIMTFromSignal(
    _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_ size_t signalDimension, _In_ float maxUVDistance,
    _In_ std::function
        <HRESULT(const DirectX::XMFLOAT2 *uv, size_t primitiveID,
            size_t signalDimension, void* userData, float* signalOut)>
    _In_opt_ void *userData,
    _In_opt_ std::function<HRESULT(float percentComplete)> statusCallBack,
    _Out_writes_(nFaces * 3) float* pIMTArray);


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

maxUVDistance: The subdivision will continue until the distance between all vertices is at most this value.

signalCallback: Callback to use to get the signal. It is given the uv coordinates of a vertex, a face id, the number of floats to generate, and an optional userData pointer.

pIMTArray: The resulting IMT data which is passed to UVAtlasCreate or UVAtlasPack which is an array of 3 float values per face.


This function requires that the input mesh contain a signal-to-mesh texture mapping (i.e.. texture coordinates). It allows the user to define a signal arbitrarily over the surface of the mesh.

Last edited Oct 31, 2014 at 7:39 PM by walbourn, version 6