FTextureLayout3d

An incremental texture space allocator.

Choose your operating system:

Windows

macOS

Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/TextureLayout3d.h

Include

#include "TextureLayout3d.h"

Syntax

class FTextureLayout3d

Remarks

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

Constructors

Name Description

Public function

FTextureLayout3d

(
    uint32 InMinSizeX,
    uint32 InMinSizeY,
    uint32 InMinSizeZ,
    uint32 MaxSizeX,
    uint32 MaxSizeY,
    uint32 MaxSizeZ,
    bool bInPowerOfTwoSize,
    bool bInAlignByFour,
    bool bInAllowShrink
)

Minimal initialization constructor.

Functions

Name Description

Public function

bool

 

AddElement

(
    uint32& OutBaseX,
    uint32& OutBaseY,
    uint32& OutBaseZ,
    uint32 ElementSizeX,
    uint32 ElementSizeY,
    uint32 ElementSizeZ
)

Finds a free area in the texture large enough to contain a surface with the given size.

Public function Const

uint32

 

GetMaxSizeX()

Public function Const

uint32

 

GetMaxSizeY()

Public function Const

uint32

 

GetMaxSizeZ()

Public function Const

FIntVector

 

GetSize()

Public function Const

uint32

 

GetSizeX()

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

Public function Const

uint32

 

GetSizeY()

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

Public function Const

uint32

 

GetSizeZ()

Public function

bool

 

RemoveElement

(
    uint32 ElementBaseX,
    uint32 ElementBaseY,
    uint32 ElementBaseZ,
    uint32 ElementSizeX,
    uint32 ElementSizeY,
    uint32 ElementSizeZ
)

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.