Wednesday, May 7, 2014

Texturing and Altases

We have begun thinking about the aesthetics of the game.
First on the list: Textures.

We have decided to use batches of textures, one batch per levels.
They will be batched into what is called atlases. It is essentially large images with different sub-images built in.
The layout needs to be like this.


The UV's of the meshes we use to generate the levels will be made to match the different squares in this image. 1 - 4 will be different kinds of walls; Walls with neighbours on one side, left side, right side or both sides.
5 - 9 will contain the floor tiles. The tiles will be, in order:
No wall neighbours, one wall neighbour, two wall neighbours on a corner, two wall neighbours on opposite sides and three wall neighbours.
The floor tiles textures will be rotated to match the positioning in the levels. This saves us from making 4 different floor tiles with one wall neighbour, 6 different with two and 4 different with three.

The reason we use atlases is performance. It lets the geometry of an entire level use one texture, saving us a large amount of what is called "Draw calls". A "Draw call" is an instruction sent to the graphics card to draw something on the screen. Every draw call has a large amount of overhead for the CPU, so reducing draw calls frees up the CPU to do other things.

No comments:

Post a Comment