Skip to content

UVAtlasComputeIMTFromPerVertexSignal

Chuck Walbourn edited this page Aug 16, 2025 · 5 revisions
UVAtlas

Calculate per-triangle IMT's from per-vertex data, to be used as input to UVAtlasCreate or UVAtlasPartition. This function allows you to calculate the IMT based off of any value in a mesh (color, normal, etc.).

HRESULT UVAtlasComputeIMTFromPerVertexSignal(
    const XMFLOAT3* positions, size_t nVerts,
    const void* indices, DXGI_FORMAT indexFormat, size_t nFaces,
    const float *pVertexSignal,
    size_t signalDimension, size_t signalStride,
    std::function<HRESULT(float percentComplete)> statusCallBack,
    float* pIMTArray);

Parameters

pVertexSignal: A float array of size signalStride * nVerts.

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

signalStride: The number of bytes per vertex in the vertex signal array. This must be a multiple of sizeof(float).

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

Returns

This function will succeed with an S_OK or will return an HRESULT error code (E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, E_POINTER, E_UNEXPECTED, or HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)).

If statusCallBack returns false, this function will return E_ABORT.

Exceptions

This function does not throw C++ exceptions, but is not marked noexcept because statusCallBack could generate one.

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Xbox One
  • Xbox Series X|S
  • Windows Subsystem for Linux

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v20
  • GCC 10.5, 11.4, 12.3, 13.3, 14.2
  • MinGW 12.2, 13.2
  • CMake 3.21

Related Projects

A python wrapper of UVAtlasTool

DirectXMesh

DirectXTex

DirectXMath

Tools

Test Suite

Content Exporter

DxCapsViewer

Clone this wiki locally