Optimizations

Planet Forge comes with a number of options to balance quality and performance.

Planet Surface

The planet surface has a number of settings that can adjust the generation and rendering performance.

1

Find the SgtSphereLandscape component in your scene

This will be in a child GameObject of your planet.

2

Adjust the Detail setting

This will change the overall amount of triangles in your mesh based on camera distance.

Detail = 1
Detail = 2
Detail = 4
3

Adjust the MinimumTriangleSize setting

This controls how deep the LOD can generate. Even with a low Detail setting, you can still get to a deep LOD if the camera gets close enough to the surface.

4

Adjust the LodBudget setting

This approximately controls how many seconds per frame can be spent on updating the LOD. By default this is 0.001 (1ms), but you can decrease this if needed. LOD will take time when moving fast relative to the camera distance to the planet, and if the LOD updating takes longer than the budget, then any remaining LOD calculations will be done in the next frame.

5

Adjust the LodSteps setting

This approximately controls how many LOD chunks can be created per LOD update. By default this is 30, but you can decrease this if needed. LOD chunks will be created when you approach the planet, especially when near the surface. LOD chunks are partially generated on the GPU which has some overhead, so you may encounter some slowdown with a higher LodSteps setting.

Lower LodBudget and LodSteps settings will increase and/or stabilize performance, but they will also cause the LOD to update more slowly. To make this less apparent, it's a good idea to design your project so that the camera speed is inversely proportional to the planet distance, so the LOD generation demands remain consistent. If you use low values and suddenly teleport the camera from deep space to the surface of a planet, it will take time for the LOD to update to full detail.

Landscape Bundle Sharing

The planet surface is textured using the SgtSphereLandscape component's Bundle setting (SgtLandscapeBundle component), which contains all textures used to generate the planet.

To simplify the Planet Forge demo scenes, each planet has its own SgtLandcapeBundle component attached to the SgtSphereLandscape GameObject. This bundle contains the textures used to make that planet. However, if you duplicate this planet then you will now have two identical planets with their own bundles. This means you will have twice the bundle memory usage.

For example, the Alythar demo scene has a bundle that uses 512 megabytes of memory.

In this scenario, it would be possible to halve this memory usage by making a prefab of the bundle, and making both planets use the same bundle.

If you have a more complex scenario, like multiple planets that use different textures, then you would need to create one bundle that contains all of the shared textures.

Landscape Bundle Memory

The planet surface is textured using the SgtSphereLandscape component's Bundle setting (SgtLandscapeBundle component), which contains all textures used to generate the planet.

All of the height textures that come with Planet Forge that are used in the HeightTextures list of the bundle are 4096x4096 resolution with the R16 bit format.

If your project doesn't need such high precision textures, then you can change the texture import settings of the height textures to use Format = R 8. This will halve the memory usage of the bundle.

If your planet doesn't need such detailed textures, then you can change the texture import settings of the height textures to use Max Size = 2048 or 1024. If you go from 4096 to 2048, then the memory usage of the bundle will be quartered.

Render Resolution

The planet sky and cloud render resolution can be adjusted.

1

Find the SgtVolumeManager component in your scene

This will usually be in a root GameObject in your scene, or a child of the Demo GameObject if you're using one of the demo scenes as a base.

2

Adjust the Downscale setting

A setting of 1 means full resolution.

A setting of 2 means half width/height or ¼ the pixels and therefore 4x performance.

A setting of 3 means third width/height or â…‘ the pixels and therefore 9x performance.

etc.

Keep in mind higher Downscale values will change the visual quality of the sky and clouds, for example:

Downscale = 2
Downscale = 4
Downscale = 8

Cloud Resolution

Another optimization is the resolution of the cloud texture.

1

Find the SgtCloud component in your scene

This will be in a child GameObject of your planet.

2

Adjust the Resolution setting

A setting of 1024 means the cloud texture will be 1024x1024 pixels.

You can make this 2048 for higher detail, or 512 for lower.

Sky Detail

Another optimization is the ray marching density of the sky and clouds.

1

Find the SgtSky component in your scene

This will be in a child GameObject of your planet.

2

Adjust the Detail setting

The default setting is 2.

If you set this to 1, then the amount of rays will be halved, and the sky will render with around 2x performance.

If you set Detail too low, then you will end up with a grainy/noisy sky, so carefully test any changes.

Last updated