UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTextureLayout3d Class Reference

#include <TextureLayout3d.h>

Public Member Functions

 FTextureLayout3d (uint32 InMinSizeX, uint32 InMinSizeY, uint32 InMinSizeZ, uint32 MaxSizeX, uint32 MaxSizeY, uint32 MaxSizeZ, bool bInPowerOfTwoSize=false, bool bInAlignByFour=true, bool bInAllowShrink=true)
 
bool AddElement (uint32 &OutBaseX, uint32 &OutBaseY, uint32 &OutBaseZ, uint32 ElementSizeX, uint32 ElementSizeY, uint32 ElementSizeZ)
 
bool RemoveElement (uint32 ElementBaseX, uint32 ElementBaseY, uint32 ElementBaseZ, uint32 ElementSizeX, uint32 ElementSizeY, uint32 ElementSizeZ)
 
uint32 GetSizeX () const
 
uint32 GetSizeY () const
 
uint32 GetSizeZ () const
 
FIntVector GetSize () const
 
uint32 GetMaxSizeX () const
 
uint32 GetMaxSizeY () const
 
uint32 GetMaxSizeZ () const
 

Detailed Description

An incremental texture space allocator. For best results, add the elements ordered descending in size.

Constructor & Destructor Documentation

◆ FTextureLayout3d()

FTextureLayout3d::FTextureLayout3d ( uint32  InMinSizeX,
uint32  InMinSizeY,
uint32  InMinSizeZ,
uint32  MaxSizeX,
uint32  MaxSizeY,
uint32  MaxSizeZ,
bool  bInPowerOfTwoSize = false,
bool  bInAlignByFour = true,
bool  bInAllowShrink = true 
)
inline

Minimal initialization constructor.

Parameters
MinSizeX- The minimum width of the texture.
MinSizeY- The minimum height of the texture.
MaxSizeX- The maximum width of the texture.
MaxSizeY- The maximum height of the texture.
InPowerOfTwoSize- True if the texture size must be a power of two.

Member Function Documentation

◆ AddElement()

bool FTextureLayout3d::AddElement ( uint32 OutBaseX,
uint32 OutBaseY,
uint32 OutBaseZ,
uint32  ElementSizeX,
uint32  ElementSizeY,
uint32  ElementSizeZ 
)
inline

Finds a free area in the texture large enough to contain a surface with the given size. If a large enough area is found, it is marked as in use, the output parameters OutBaseX and OutBaseY are set to the coordinates of the upper left corner of the free area and the function return true. Otherwise, the function returns false and OutBaseX and OutBaseY remain uninitialized.

Parameters
OutBaseX- If the function succeeds, contains the X coordinate of the upper left corner of the free area on return.
OutBaseY- If the function succeeds, contains the Y coordinate of the upper left corner of the free area on return.
ElementSizeX- The size of the surface to allocate in horizontal pixels.
ElementSizeY- The size of the surface to allocate in vertical pixels.
Returns
True if succeeded, false otherwise.

◆ GetMaxSizeX()

uint32 FTextureLayout3d::GetMaxSizeX ( ) const
inline

◆ GetMaxSizeY()

uint32 FTextureLayout3d::GetMaxSizeY ( ) const
inline

◆ GetMaxSizeZ()

uint32 FTextureLayout3d::GetMaxSizeZ ( ) const
inline

◆ GetSize()

FIntVector FTextureLayout3d::GetSize ( ) const
inline

◆ GetSizeX()

uint32 FTextureLayout3d::GetSizeX ( ) const
inline

Returns the minimum texture width which will contain the allocated surfaces.

◆ GetSizeY()

uint32 FTextureLayout3d::GetSizeY ( ) const
inline

Returns the minimum texture height which will contain the allocated surfaces.

◆ GetSizeZ()

uint32 FTextureLayout3d::GetSizeZ ( ) const
inline

◆ RemoveElement()

bool FTextureLayout3d::RemoveElement ( uint32  ElementBaseX,
uint32  ElementBaseY,
uint32  ElementBaseZ,
uint32  ElementSizeX,
uint32  ElementSizeY,
uint32  ElementSizeZ 
)
inline

Removes a previously allocated element from the layout and collapses the tree as much as possible, In order to create the largest free block possible and return the tree to its state before the element was added.

Returns
True if the element specified by the input parameters existed in the layout.

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