Tips & Issues & Plans

These are some tips for using this asset, known issues, and future plans.

Sky/Ocean Draw Order

The sky/atmosphere and ocean are both transparent effects, so their draw order is based on the distance to the camera. However, since they're both wrapped around the planet, they have the same distance to the camera. This is an issue, because the sky should always draw on top of the ocean.

To enforce this draw order, the SgtSky component has the CameraOffset setting, which defaults to 0.1. This offset works well in most scenarios, however, for large planets like the Earth sized example below, this 0.1 offset is lost due to floating point precision issues. To fix this, an even larger offset like 1.0 is required. If your camera can fly far from the planet, then you may need an even larger value like 10.0.

The CameraOffset will move the sky a little bit toward the camera, and change the way it looks slightly. Therefore, you shouldn't use values that are too high, especially if your planet is small.

SgtSky.CameraOffset = 0.1
SgtSky.CameraOffset = 1.0

Landscape Global Sizes

The SgtLandscapeDetail and SgtLandscapeBiome components when using Space = Global apply detail to the whole of your planet.

This detail is tiled using the GlobalSize setting. For example, if your detail layer has a GlobalSize = 1000, and your planet has a circumference of 5000, then that detail layer will tile 5 times around your planet.

Since planets can be massive, and the detail can tile with a high frequency, the detail UV coordinates need to be baked into the planet mesh. Planet Forge bakes 4 sets of UV coordinates into your planet mesh, which can be specified using the SgtSphereLandscape component's GlobalSizes setting.

By default, GlobalSizes is X = 1 Y = 100 Z = 10,000 Z = 1,000,000

However, since there are only 4 baked UV coordinates, this means that you can't use any GlobalSize value you like for your detail layers. Indeed, the GlobalSize setting is merely a hint at the size you want the detail to appear at. The actual size will be the nearest baked UV multiplied by an integer scale.

Additionally, the GlobalSizes you specify are also just hints, because the baked UV coordinates must tile around the planet at an integer value, so if your planet has a circumference of 5000 units and you specify a GlobalSizes.w value of 6000, then it will just round to 5000.

MSAA Cracks

If you enable MSAA (Multisample anti-aliasing e.g. Anti Aliasing = 2x Multi Sampling), then cracks can appear on the planet surface.

To avoid this I recommend using a post process AA solution instead like FXAA, SMAA, TAA, etc.

Built-in render pipeline ocean reflection/refraction.

The ocean system in Planet Forge supports reflection and refraction effects. This is a screen-space effect that uses the Opaque Texture, which is a special texture that Unity renders containing the opaque objects in your scene (e.g. landscape, spaceship, etc). By default HDRP renders this every frame, and in URP you can enable this in your renderer settings. However, the built-in rendering pipeline doesn't have this feature.

Planet Forge comes with the special CameraOpaqueTextureBIRP component, which you can add to your scene's Main Camera, and it will automatically generate this opaque texture for you.

This component only runs in the built-in render pipeline. You can still add it in your URP/HDRP projects, but it just won't do anything.

Last updated