Case study on the need for optimization
Imagine you are developing a game for mobile devices, such as a 3D car racing game, with detailed graphics and impressive visual effects. The game scene contains a long and complex track with many objects, trees, buildings, traffic signs, lampposts, and animated spectators. However, when you test the game on a mobile device, you notice that the performance is extremely low, with a very low frame rate and constant stuttering.
In this case, optimization in Unity becomes crucial for the game to run smoothly and attractively on mobile devices. Some of the optimization techniques you could apply are as follows:
- Static batching: The game track probably has many static objects, such as buildings and rocks, that do not change position. By marking these objects as static, you can take advantage of baking lights to pre-calculate static lighting at design time. This will significantly reduce real-time lighting processing time during gameplay...