Surface Textures - Gameslinx/Tessellation GitHub Wiki

Surface Textures

This section refers to the albedo / diffuse maps. These are what gives colour to the planet surfaces. There are four surface textures for each planet:

  • Low, Mid and High - These are assigned based on a height range provided in your config.
  • Steep - This texture is assigned to slopes, such as mountains. You can adjust the influence of this texture in your config.

Channels

The surface textures are simple - The physical colour of the texture is stored in the RGB channels. Specular highlight information is stored in the alpha channel - this determines how light interacts with the texture when viewed from certain directions. If reflections are enabled, the alpha channel is also used to determine which parts of a texture are reflective.

Specular Highlights

Specular highlights are spots on a texture that brighten or darken based on the view direction and light direction. They are an approximation of how light interacts with a surface.

  • The specular strength can be increased by changing the 'smoothness' value in the config. A higher value will reflect more light.
  • The specular colour can be changed by setting 'tintColor' in the config.

Reflections

Reflections also use the alpha channel of the surface textures. Reflections are expensive, so be careful when making planets with high scene complexity. The shader accepts reflections in the form of a cubemap. A reflection probe is created at the camera location. Relative to the planet, it will follow the camera on the X and Z coordinates, but its Y coordinate is flipped. A cubemap is rendered by this probe every frame unless specified by the user to update less frequently.

The shader will sample this cubemap based on the reflection of the view direction and normal map vector.

The strength of the reflection is determined by the alpha channel of the surface texture. The specular colour and strength is added to this. An alpha of 1 will produce a perfect reflection. An alpha value of 0 will reflect no light at all.

Reflections can also be controlled by a Reflection Mask:

  • A reflection mask controls which textures are reflective.

An example of a reflection mask would be '1, 0, 0, 1'. This corresponds to Low/Mid/High/Steep. This mask tells the shader to use reflections for the low and steep textures, but only use specular highlights for the mid and high textures.