UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FUVPacker Class Reference

#include <UVPacking.h>

Classes

struct  IUVMeshView
 

Public Member Functions

GEOMETRYCORE_API bool StandardPack (IUVMeshView *Mesh, int NumIslands, TFunctionRef< void(int, TArray< int32 > &)> CopyIsland)
 
bool StandardPack (IUVMeshView *Mesh, const TArray< TArray< int > > &UVIslands)
 Version of StandardPack that takes an array of arrays instead of a TFunctionRef, for convenience.
 
GEOMETRYCORE_API bool StackPack (IUVMeshView *Mesh, int NumIslands, TFunctionRef< void(int, TArray< int32 > &)> CopyIsland)
 
bool StackPack (IUVMeshView *Mesh, const TArray< TArray< int > > &UVIslands)
 Version of StackPack that takes an array of arrays instead of a TFunctionRef, for convenience.
 

Public Attributes

int32 TextureResolution = 512
 
float GutterSize = 1.0
 
bool bPreserveScale = false
 
bool bPreserveRotation = false
 
bool bAllowFlips = false
 
bool bScaleIslandsByWorldSpaceTexelRatio = false
 

Protected Member Functions

GEOMETRYCORE_API void GetIslandStats (IUVMeshView *Mesh, const TArray< int32 > &Island, FAxisAlignedBox2d &IslandBoundsOut, double &IslandScaleFactorOut, double &UVAreaOut)
 

Detailed Description

FUVPacker implements various strategies for packing UV islands in a generic mesh class. The UV islands must already be identified, this class simply scales/rotates/translates the islands to fit.

Member Function Documentation

◆ GetIslandStats()

void FUVPacker::GetIslandStats ( IUVMeshView Mesh,
const TArray< int32 > &  Island,
FAxisAlignedBox2d IslandBoundsOut,
double IslandScaleFactorOut,
double UVAreaOut 
)
protected

Compute common stats used by the packing algorithms to transform UV islands

◆ StackPack() [1/2]

bool UE::Geometry::FUVPacker::StackPack ( IUVMeshView Mesh,
const TArray< TArray< int > > &  UVIslands 
)
inline

Version of StackPack that takes an array of arrays instead of a TFunctionRef, for convenience.

◆ StackPack() [2/2]

bool FUVPacker::StackPack ( IUVMeshView Mesh,
int  NumIslands,
TFunctionRef< void(int, TArray< int32 > &)>  CopyIsland 
)

Uniformly scale all UV islands so that the largest fits in positive-unit-square, and translate each islands separately so that it's bbox-min is at the origin. So the islands are "stacked" and all fit in the unit box.

◆ StandardPack() [1/2]

bool UE::Geometry::FUVPacker::StandardPack ( IUVMeshView Mesh,
const TArray< TArray< int > > &  UVIslands 
)
inline

Version of StandardPack that takes an array of arrays instead of a TFunctionRef, for convenience.

◆ StandardPack() [2/2]

bool FUVPacker::StandardPack ( IUVMeshView Mesh,
int  NumIslands,
TFunctionRef< void(int, TArray< int32 > &)>  CopyIsland 
)

Standard UE UV layout, similar to that used for Lightmap UVs. All UV islands are packed into standard positive-unit-square. Only supports single-pixel border size.

Member Data Documentation

◆ bAllowFlips

bool UE::Geometry::FUVPacker::bAllowFlips = false

If true, islands can be flipped in addition to rotate/translate/scale

◆ bPreserveRotation

bool UE::Geometry::FUVPacker::bPreserveRotation = false

If true, original island rotation is maintained during any packing process. Automatically prevents bAllowFlips from applying, if set.

◆ bPreserveScale

bool UE::Geometry::FUVPacker::bPreserveScale = false

If true, original island scale is maintained during any packing process.

◆ bScaleIslandsByWorldSpaceTexelRatio

bool UE::Geometry::FUVPacker::bScaleIslandsByWorldSpaceTexelRatio = false

Attempt to rescale islands to match texel-to-world-space ratio across islands, based on ratio of World- and UV-space edge lengths

◆ GutterSize

float UE::Geometry::FUVPacker::GutterSize = 1.0

Thickness of gutter/border in pixel dimensions. Not supported by all packing methods

◆ TextureResolution

int32 UE::Geometry::FUVPacker::TextureResolution = 512

Resolution of the target texture. This is used to convert pixel gutter/border thickness to UV space


The documentation for this class was generated from the following files: