Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
December 5, 2020
arrowPress Releases







If you enjoy reading this site, you might also want to check out these UBM Tech sites:


 

Use Texture Atlases in Unity to Improve Performance

by Carleton DiLeo on 10/21/15 02:08:00 pm   Featured Blogs

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.

 

Originally posted on Pixleshot Games Dev Blog

Wordsum is a fun free mobile game that combine Scrabble and Tetris together in a unique way. It's available right now on IOS and Android.

Performance is always on the top of every game developers Todo list. It can be the make or break for how player's respond to your game. Wordsum was a mobile game so that meant I had less power to work with if I wanted to reach the mass market.

Lowering draw calls are a simple way to improve the performance of your game. It's simple, if the game performs less draw calls, it has less to do. So your first question might be, "How do I know how many draw calls my game is making". Unity provides a great tool for this called the Rendering Statistics Window. The best part is it's available in the free version of Unity. To open the window, click the tab in the editor viewport.

 

 

When you run your game you will get live statistics. The thing we are interested in is the Set Pass Call number.
 


Getting this number as low as possible helps save of CPU/GPU cycles. We will be using Texture Atlases to accomplish this.

There are some good paid tools out there to help us create the Texture Atlas. One of these is the highly regarded 2D Toolkit. Since I had a tight budget I ended up going with Simple Sprite Packer which gets the job done.

First thing you will need to do is import the Simple Sprite Packer package into your project. This adds a new context menu to the Unity editor. Find a place where you want to create your Atlas. Right (or command click for mac users) and select  Create -> Sprite Packer.
 


Name it something appropriate and save. This will create two objects in your folder. The first is the Simple Sprite Packer object you will use to create the Atlas. The second is the image file that will be the actual Atlas.
 


Select the Sprite Packer object. The inspector will display the options you have for creating the Atlas. You can leave most of these unchanged for now and start creating your Atlas. You can either drag your images one by one into the green area or for speed use the Sprite Packer -> Drag and Drop Window located in the Unity toolbar.
 

 

Note: Make sure the sprites you are adding to the atlas are uncompressed or Simple Sprite Packer will complain.

Once you have added all your sprites, select Rebuild Atlas. You have now created a Texture Atlas. Congrats! The only thing left is to swap out references to the individual sprites to your Atlas. Once your done, rerun your game and you should see a big drop in draw calls and hopefully improved FPS.


Related Jobs

Airship Syndicate
Airship Syndicate — Austin, Texas, United States
[12.04.20]

Junior to Mid Programmer
New Moon Production
New Moon Production — Hamburg, Germany
[12.04.20]

Technical Artist (all genders)
Wooga GmbH
Wooga GmbH — Berlin, Germany
[12.03.20]

(Senior) QA Automation Engineer
Disbelief
Disbelief — Chicago, Illinois, United States
[12.02.20]

Junior Programmer, Chicago





Loading Comments

loader image