Texture atlas
In realtime computer graphics, a texture atlas (also called a tile map, tile engine, or sprite sheet) is a large image containing a collection, or "atlas", of sub-images, each of which is a texture map for some part of a 2D or 3D model. The sub-textures can be rendered by modifying the texture coordinates of the object's uvmap on the atlas, essentially telling it which part of the image its texture is in. In an application where many small textures are used frequently, it is often more efficient to store the textures in a texture atlas which is treated as a single unit by the graphics hardware. This saves memory and because there are less rendering state changes by binding once, it can be faster to bind one large texture once than to bind many smaller textures as they are drawn. Careful alignment may be needed to avoid bleeding between sub textures when used with mipmapping, and artefacts between tiles for texture compression.
Atlases can consist of uniformly-sized sub-textures, or they can consist of textures of varying sizes (usually restricted to powers of two). In the latter case, the program must usually arrange the textures in an efficient manner before sending the textures to hardware. Manual arrangement of texture atlases is possible, and sometimes preferable, but can be tedious. If using mipmaps, care must be taken to arrange the textures in such a manner as to avoid sub-images being "polluted" by their neighbours.
Tile-based games are particularly suited to the use of texture atlases.
See also
External links
- A thousand ways to pack the bin - Review and benchmark of the different packing algorithms
- Sprite Sheets - Essential Facts Every Game Developer Should Know - Funny video explaining the benefits of using sprite sheets
- Texture Atlas Whitepaper - A whitepaper by NVIDIA which explains the technique.
- TexturePacker - Commercial texture atlas creator for game developers.
- LibGDX texture packer - Open source texture packer utility from libGDX
- Texture Atlas Maker - Open source texture atlas utility for 2D OpenGL games.
- Practical Texture Atlases - A guide on using a texture atlas (and the pros and cons).
- SpriteMapper - Open source texture atlas (sprite map) utility including an Apache Ant task.