Unity Terrain Streaming Performance Measurement and Debugging Guide

Measuring the terrain streaming performance.

What to Measure

The StreamedTerrainExtension’s performance can be measured using the Vortex profiler (see

Measuring Performance Using the Content Debugger and Profiler for more details on the Profiler). The timings for the streamed terrain can be found in the DynamicsEngine->ExtensionPostStep->VortexIntegration->Application Extension Handler->Steamed Terrain.

Setting up the Profiler

To use the profiler, the Vortex configuration file must be modified. The following extensions should be in the Vortex setup Document (.vxc file) used.

  • Profiler Page.

  • CSV Writer.

To do this, go to the Vortex tab in unity and click on Edit Setup / Create Setup next to the Play Mode Setup Document field. This will open the setup file in the Vortex Editor.

In the Vortex Editor, add the Profiler Page and CSV Writer extensions from the Toolbox.

Once this is done, build the unity project and run it.

When you run the simulation, a Vortex Studio Player window will appear where you will find the Profiler. In the profiler, you will find the timings for the streamed terrain in the DynamicsEngine->ExtensionPostStep->VortexIntegration->Application Extension Handler->Steamed Terrain.

If you want to record the performance measurements in a csv file to analyze it, click on Start Capture. This will record the timings for each time step and save it in a csv file in the Capture Folder which was set.

Performance Tuning

There are two Unity Terrain Settings on the Terrain’s GameObject that have a great impact on the Terrain’s Compute time: Heightmap Resolution and Control Texture Resolution.

Unity Terrain resolution settings

The Heightmap Resolution defines the pixel resolution of the Terrain’s heightmap. The values stored in the heightmap define the height of each point on the Terrain. The greater the value, the more the Terrain’s surface will be refined, and by extension the more compute and memory expensive it will be for Vortex.

The Control Texture Resolution controls the blending resolution of the different Terrain Textures. The higher the resolution, the more precise the material mapping will be when determining the Vortex Contact Materials.

These resolutions are relative to the Terrain’s Width and Length values. For example, a 1024x1024 Terrain with a Heightmap Resolution of 1025x1025 will have a cell size of 1 meters. Increasing the Heightmap Resolution to 2049x2049 decreases the cell size to 0.5 meters.

We recommend limiting the cell size to no less than 0.5 meters. Exceeding this resolution may lead to performance degradation. In addition, only one vehicle driving on the terrain is currently supported. Having multiple vehicles may also lead to performance degradation.