In the last three posts I explained how I have set up tools for performance measurements and have defined a process or recipe for getting fairly consistent and repeatable measurements. In this and the next series of posts, I will try performance improvements, one approach per post, and measure the extent to which it helped achieve the performance goals for Oculus.
As before, I am using the Hand-Painted Island Pack from the Unity Asset Store as the test case. This is one of the environments for my Sharkferno game, and I am working to improve the performance of this game.
For this and each post of this series, I will first describe the change I will make before actually trying it. I will speculate the type of performance improvements that I hope will be achieved. I will then run the change, measure the performance, and report the results. I will write posts like this until the performance goals are achieved within a comfortable margin, or I give up. Hopefully the latter will not happen. 🙂
This post will start with a very simple change. The island scene has many objects. I would like to remove the trees to give the island a less dense look and provide a better view to action that would otherwise be occluded by trees. I will also remove the plants; they are not critical for game play, and I had noticed in the previous posts that frames-per-second suffer when the camera is close to plants.
These changes are easily made by disabling the Trees and Plants parent objects in the Hierarchy.
My hope is that disabling the Trees and Plants will reduce the numbers of triangles, vertices, and draw calls.
I tried this using the process described in the previous post. Here are the results:
Frames per Second | CPU time | GPU time | draw calls / frame | triangles / frame | vertices / frame | dropped frames | |
---|---|---|---|---|---|---|---|
Goal | 90 consistently | at most 11 ms | at most 11 ms | 50 - 100 | 1-2M | 1-2M | rare, maybe a few at scene transitions |
Baseline | 90 but with downward spikes | 11.11 ms | 7.48 ms | 5619 | 1.6M | 1.8M | some during spikes |
Fewer Objects | 90 but with downward spikes | 11.12 ms | 7.89 ms | 4353 | 1.1M | 1.2M | some during spikes |
As expected, this did reduce the numbers of triangles, vertices, and draw calls, although not as drastically as I had hoped. So, this is one step in the right direction, but more improvements will be needed. I repeated the test three times, and each had similar results. One detail that I noticed, which I had been incorrect about, is that the plants on the ground are part of the terrain, not the plant objects. (The latter are actually on top of the high cliffs.) This may partially explain the only modest gains by disabling the Tree and Plant objects.
The good news is that we have a process in place for trying a change and easily measuring its effect on performance. In the next post I will try some changes to quality settings.