How to make a texture atlas template the smart way

Using a texture atlas is a smart way to improve the performance of your game and minimize the number of textures you need to keep track of. A texture atlas is basically a square image you split into smaller squares with the same size. For example, this is how Minecraft's texture atlas looked like in 2011:

The boring part is to make the template. I used to create a texture with the size I want the texture atlas to be, like 2048x2048. If I wanted to split it into 8x8 sections, I made a new texture with the size 256x256 with the color black. And then I copied the 256x256 texture into the texture atlas to create a chess pattern. But what if I wanted the texture atlas to be 4096x4096? Then I would have to redo it again!

A better way is to first create a tiny image with the size 8x8 (I'm using Paint.Net). Then you use the Pencil tool with a black color to create a chess pattern:

Then you scale the tiny image to the size you want the texture atlas to have: Image → Resize. Set the size to 2048x2048 and the Resampling to "Nearest Neighbor" - and you get a texture atlas with size 2048x2048 split into 256x256 squares with sharp edges!    

Comments