Game Development Reference
In-Depth Information
The support for different screens and launch image sizes is
a complex topic. For more information, check out the official
Apple Developer website at https://developer.apple.
com/library/ios/documentation/userexperience/
conceptual/mobilehig/IconMatrix.html#//apple_
ref/doc/uid/TP40006556-CH27-SW1 .
Creating the texture atlases
Before we start creating a texture atlas, let's first find out what this technique is
actually good for. A texture atlas (also known as a sprite sheet ) is just an ordinary
image file that can be rendered to the screen like any other image. So what makes
it so special? It is used as a container image that holds several smaller subimages
arranged in such a way that they do not overlap each other and it still fits into the
size of the texture atlas. This way, we can greatly reduce the amount of textures
that are sent to the graphics processor, which will significantly improve the overall
render performance. The texture atlases are especially useful for games where a lot of
small and different images are rendered at once. The reason for this is that switching
between different textures is a very costly process. Each time you change textures
while rendering, new data needs to be sent to the video memory. If you use the same
texture for everything, this can be avoided.
The texture atlases will not only increase the frame rate of the game significantly,
but will also allow us to use subimages as Non-Power-Of-Two ( NPOT ) textures.
The reason why our subimages can be of arbitrary size is that the power-of-two rule
only applies to textures that are loaded into the video memory. Therefore, when we
actually render a subimage, we are still using the texture atlas, which is a power-of-
two texture as our pixel source; however, we will only use a certain part of it as our
final texture to draw something.
Due to the default support of OpenGL ES 2.0, LibGDX will support
NPOT textures or images; however, it will take more time to render than
a POT texture, depending on the underlying hardware. Nevertheless,
it is more efficient to store the subimages in a texture atlas, which is
treated as a single unit by the graphics hardware. Also, it can be faster
to bind one large texture once than to bind many smaller images.
 
Search WWH ::




Custom Search