Skip to content

UVAtlasPack

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

Pack mesh partitioning data into an atlas from the partition created by UVAtlasPartition

HRESULT UVAtlasPack(
    std::vector<UVAtlasVertex>& vMeshVertexBuffer,
    std::vector<uint8_t>& vMeshIndexBuffer, DXGI_FORMAT indexFormat,
    size_t width, size_t height,
    float gutter,
    const std::vector<uint32_t>& vPartitionResultAdjacency,
    std::function<HRESULT(float percentComplete)> statusCallBack,
    float callbackFrequency);

Parameters

vMeshVertexBuffer, vMeshIndexBuffer, pPartitionResultAdjacency: Mesh data returned from UVAtlasPartition

width, height: The width and height of the texture the atlas will be used on.

gutter: The minimum distance, in texels between two charts on the atlas. This gets scaled by the width, so if gutter is 2.5, and it is used on a 512x512 texture, then the minimum distance will be 2.5 / 512 in u-v space.

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, HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), or HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)).

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