TextureAtlasUtility Class Reference

Description

Utility class used for texture atlas layouts.

Static methods

static Vector< PagecreateAtlasLayout (Vector< Element > &elements, UINT32 width, UINT32 height, UINT32 maxWidth, UINT32 maxHeight, bool pow2=false)
 Creates an optimal texture layout by packing texture elements in order to end up with as little empty space as possible. More...
 

Method documentation

static Vector<Page> createAtlasLayout ( Vector< Element > &  elements,
UINT32  width,
UINT32  height,
UINT32  maxWidth,
UINT32  maxHeight,
bool  pow2 = false 
)
static

Creates an optimal texture layout by packing texture elements in order to end up with as little empty space as possible.

Algorithm will split elements over multiple textures if they don't fit in a single texture.

Parameters
[in]elementsElements to process. They need to have their input structures filled in, and this method will fill output when it returns.
[in]widthInitial width of the atlas texture.
[in]heightInitial height of the atlas texture.
[in]maxWidthMaximum width the atlas texture is allowed to grow to, when elements don't fit.
[in]maxHeightMaximum height the atlas texture is allowed to grow to, when elements don't fit.
[in]pow2When true the resulting atlas size will always be a power of two.
Returns
One or more descriptors that determine the size of the final atlas textures. Texture elements will reference these pages with their output.page parameter.