Our partners at Arm have put together a series of in-depth guides to help technical artists and game developers optimize their game art and improve performance when building for varied mobile hardware.
Technical artists face the challenge of wanting to build stunning mobile games while keeping assets in line with mobile hardware limitations and performance needs. If you’re coming from other platforms (such as PC or console), it can be hard to find good resources that give you the information and guidance you need to create assets for mobile platforms.
That’s why our partners at leading mobile chip design company Arm have created a comprehensive guide to optimizing and improving performance for geometry, texturing, materials, and shaders, geared towards technical artists. We’ve chosen four of their tips to share on this blog, and you can find the full guide free to download here.
Getting your mobile title to run on the large array of mobile devices can be challenging, and it’s important to keep a tight budget for the memory resources you have to work with. When you’re creating an asset, keep in mind its visual size, or how many pixels it takes up on the screen. The bigger it is, the more texture space you can allow it – you don’t want to waste a lot of visual size on a game asset that will only take up a few pixels in the background.
In our example below, you can see a game where two armies are going into battle. The soldiers’ textures are kept quite small since each one only takes up a few pixels on the screen. This serves a couple of purposes. First, keeping the texture small reduces memory overhead. Second, well-sized textures enable you to add them to an atlas – you can read more about the benefits of an atlas in the Texturing section of the real-time art best practices.
This concept also carries over to the soldiers’ mesh. You can see the triangles of the soldiers below. Similar to texturing, low triangle counts are helpful to keep the overhead down since the GPU has to process objects’ vertices. This tactic also avoids what is known as a micro triangle problem: when a mesh has a lot of triangles – and therefore a lot of vertices – the GPU has to render them all. This holds even when an object is too small or far away in the scene – the triangles still require a lot of GPU processing power, even though they’re only a few pixels in size.
Compression type matters
When artists are creating a texture, it’s common for them to export it as a PNG, JPG, or TGA file. However, when the game runs, these files are converted to specialized formats that are faster and smaller in memory.
When picking a compression type, it’s important to use a format that will perform well to support the artistic vision for the project. Our recommendation is to use ASTC because it offers you the option to control the quality of the compression. Setting it to 5×5 or 6×6 is a great starting point for most assets. You can also try 8×8 or even 10×10 for smaller assets, as these will only take a few pixels on the screen. We’d also recommend experimenting with the different settings to find what works best for your project.
Level of Detail (LOD) & Mip Maps
As mentioned above, the fewer vertices an object has, the faster the GPU can compute it. At times, this can be at odds with a project’s artistic goals, which can aspire to have an object look as good from far away as it does up-close. This is where a Level of Detail (LOD) system comes in.
A LOD system uses a lower-poly version of the model as an object moves further away from the camera. These models are made by the artist, and the distance at which they change out is controllable. This strategy keeps the vertices count down and helps to tackle the micro triangle problem discussed above while giving you performance when the object is far away and detail when the object is in the foreground.
To make LODs even more efficient while supporting the visual quality of your app, the resolution of textures should scale up and down as you change between LODs. In Unity, this tactic is made easier using Mip Maps.
Mip Maps are copies of the texture that are saved at smaller resolutions. When an object is further away from the camera, it will use the lower-resolution version to prevent unneeded “crunchy-ness” in your textures. Given how Mips work, they are best used on objects that will not be a fixed distance from the camera. Combining Mips with LODs can really help speed up a scene.
Only use transparency when it’s absolutely necessary
While transparency is expensive to render on all platforms, it is excessively so on mobile because of what is called “overdraw.” Overdraw happens when the GPU has to render a pixel multiple times. Each pixel that a transparent object overlaps has to be rerendered, which greatly affects the game’s performance. However, if you do need to use transparency in your game, you should know about the different options available to you.
Alpha blend is the recommended option for mobile since mobile GPUs have optimization features that help them to render alpha-blended objects. Alpha blend allows you to have a range of transparency options, rather than just turning it on or off like a cutout.
Alpha test transparency can make an object look totally opaque or transparent, but it allows nothing in between. This is often referred to as “cut out.” We strongly recommend avoiding cutouts on mobile because they disable several optimization features of the GPU.
For us, it was very hard to choose the top takeaways from the real-time 3D art best practices – there is so much useful information and guidance there. If you’re a beginner, the guides provide tips that will be useful in your day-to-day work. If you’re already a pro, share this with your team. Game development is great because it’s a community effort – we all win when game experiences get better!