Performance Guidelines

All heavy, performance intensive tasks that can be done in the background are performed using burst-compiled jobs in Orbis. However, there are some aspects that simple cannot be moved from the main thread, such as drawing the terrain itself. In games where the camera only moves slow you can use more intensive mesh generation, as the job doesn't need to run often.

Mesh Generation

There are two ways to increase the terrain detail resolution. You can either increase the resolution per mesh/chunk, or increase the chunk count that is being used to draw the terrain by adjusting lod distances.

Increasing the mesh resolution (vertex count per mesh) will result in more detailed meshes, but also in more triangles that are drawn in total, resulting in more work on the GPU. Higher chunk resolution will also increase the time it takes for a single mesh generation job to finish, possible delaying the terrain loading.

Having smaller meshes, but more of them allows the jobs to finish faster, and the terrain to update more accuratly around the player. However, more smaller meshes also result in more draw calls that could also become a performance issue. For most projects you will have to find a good balance between detail per terrain chunk vs using additional chunks. This depends on your target hardware and whether you are CPU- or GPU limited.

Mesh Skirts

Generating mesh skirts can improve visual quality by eliminating possible small cracks on between meshes. Depending on your terrain configuration this may or may not be an issue. While generating the skirts does not require much computation time, it increases the triangle count by a bit, especially when using many smaller nodes.

Procedural Sampling computation costs

While procedurally generated heights to not required a pre-generated heightmap and can build detail without having to store large amounts of elevation data in memory, sampling noise values can be quite expensive, depending on the noise function used.

When generating heights using one or multiple fractal noise functions, avoid using too many octaves. Less than 10 octaves should be fast enough for most target devices.

LOD distances

Avoid using too high lod distances for higher lod levels, as that can heavily increase the computation time for the terrain as well as the triangle and draw call count.

LOD Transition Animations

Animation LOD transition using a shader that supports dithered fading helps hide lod changes and significantly improves visual quality during lod changes. However, this requires parts of the terrain to be drawn twice during the transition. To keep the performance overhead low, transitions are set to a fixed, limited time. Still, it will lead to a temporary increase of draw calls and triangles on screen. Depending on your target hardware and game type, you want want to disable lod transition animations.

Vegetation spawning

Spawning vegetation is done from a job using concurrent command buffers, so the spawning of the vegetation itself will not be a performance issue. However, large amounts of foliage can drastically increase the triangle count on screen. To keep performance high, ensure that foliage shaders have GPU Instancing enabled. Adding LOD groups with lower detailed models can also improve vegetation performance.