Book Image

Learning NGUI for Unity

By : Charles Bernardoff (EURO)
Book Image

Learning NGUI for Unity

By: Charles Bernardoff (EURO)

Overview of this book

Table of Contents (17 chapters)
Learning NGUI for Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Texture atlas


A texture atlas is a large image containing a collection of sub-images. These sub-images are the actual textures for your 2D or 3D objects and can be rendered by editing the object's texture coordinates, telling which part of the texture atlas should be used.

The goal here is performance; storing 20 frequently used textures in a large one will require only one large texture to be treated by the Graphics Processing Unit (GPU), which is faster than treating these 20 textures separately. This method ensures that even for 20 different textures, rendering them will only require one single draw call.

These textures can have variable sizes, but keep in mind that using textures with the power of two sizes is easier for the GPU to process: 16 x 16, 32 x 32, 64 x 64, and so on. That's because the textures have to be arranged in a specific order before being sent to the GPU.

Unity's largest texture size is 4096 x 4096, thus the maximum size for an atlas with NGUI is 4096 x 4096 pixels. It...