Post tutorial RSS For Modders: Overview of Planet Shader (v1.00+)

An explanation of the new texture format required for the Sins: Remastered planet shader and explanation of the mechancis of the the new features.

Posted by on - Intermediate Textures

Mesh Requirements

The Sins: Remastered planet shader requires that a planet’s mesh object be an a perfect sphererical object. The resolution of the mesh object is not critical as the shader generates a perfect sphere based on the boundaries of the object rather than rendering tessellated faces. The planet shaders use a mathematically perfect equirectangular calculation of the UV space so all textures should be in that format.

EquirectangularProjectionExample

An equirectangular UV unwrapped sphere


Mode Control

Mode is control by the mesh Specular alpha value. All mesh variables are in AARRGGBB format.

ARGBPairs

Hexadecimal ARGB Pairs


Specular AA:

  • 00 = No Atmosphere mode
  • 40 = Volcanic mode
  • 80 = Gas Giant mode
  • C0 = Greenhouse mode
  • FF = Ocean/Normal mode (default mode)

While it is possible to achieve similar effects using more than one mode, it is important to remember that the specialized modes are designed to improve performance when running a planet of the relevant type. It is highly recommended that you use the specialized mode for the type of planet you are setting up.

Calculation Size

Sizing for calculation purposes irrespective of the actual planet mesh size is controlled by the mesh Glossiness value. Each side of the decimal divider functions as an independent variable.

  • Integer Portion = Planet radius (in KM) for Rayleigh Mie calculations (Standard size is 6000, roughly Earth's radius).
  • Decimal Portion = Atmosphere thickness

Larger planets will have lower mountain peaks and lower cloud layers than smaller planets, as an implementation of hydrostatic equilibrium has been included.

Fog and lightning color is controlled by the Raleigh scattering value of the atmosphere.

Ocean/Normal Planets


Terran Planet

The Sins: Remastered Terran Planet


Specular AA = FF

Ocean mode is the standard planet mode

Texture channels:

  • DiffuseTextureFileName
    • RGB = Basecolor
    • A = Specular
  • SelfIlluminationTextureFileName
    • RGB = Emissive
    • A = Roughness
  • NormalTextureFileName
    • R = Subsurface Scattering
    • G = Normal Y
    • B = Metalness
    • A = Normal X
  • TeamColorTextureFileName
    • RGB = Optional Emissive tiler pattern. Leave black to use CL basecolor.
    • A = Height map

Mesh variables:

  • Diffuse
    • AA = Atmosphere Density
    • RRGGBB = Rayleigh scattering
  • Ambient
    • AA = Lightning frequency
    • RRGGBB = Water color
  • Specular
    • RR = Ocean height (relative to heightmap)
    • GG = Ocean opacity
    • BB = Fog density

For the best results for ocean areas, the underlying basecolor texture often works best when not the same color as the water. This, combined with height data on the ocean floor will generate underwater ocean details below the surface.

Greenhouse Mode

Greenhouse Planet

The Sins: Remastered Greenhouse Planet


Specular AA = C0

Greenhouse mode functions generally the same as Ocean mode only it does not support clouds or water.

Texture channels:

  • DiffuseTextureFileName
    • RGB = Basecolor
    • A = Specular
  • SelfIlluminationTextureFileName
    • RGB = Emissive
    • A = Roughness
  • NormalTextureFileName
    • R = Subsurface Scattering
    • G = Normal Y
    • B = Metalness
    • A = Normal X
  • TeamColorTextureFileName
    • RGB = Optional Emissive tiler pattern. Leave black to use CL basecolor.
    • A = Height map

Mesh variables:

  • Diffuse
    • AA = Atmosphere Density
    • RRGGBB = Rayleigh scattering
  • Ambient
    • AA = Lightning frequency
    • RRGGBB = Unused
  • Specular
    • RR = Unused
    • GG = Unused
    • BB = Fog density

In order for Greenhouse mode to function well, a high-quality height map should be used. The fog effect interacts with the height map to create fog-filled area and fog whose thickness is determined by the depth of the fog over the height of the surface.

Gas Giant

Gas Giant
The Sins: Remastered Gas Giant


Specular AA = 80

Gas Giant mode is a highly specialized mode that behaves very differently from other planet modes.

Texture Channels:

  • DiffuseTextureFileName
    • DXT5 format 2048x2048
  • RGB = Grayscale gas giant surface texture
  • A = Specular
  • SelfIlluminationTextureFileName
    • Unused but requires placeholder tiny black texture.
  • NormalTextureFileName
    • Look-up table (LUT texture)
      • 64x64 pixel Color palette sampler using uncompressed DDS.
    • TeamColorTextureFileName
      • DXT Uncompressed 512x512 RGB with no alpha
    • Flow map created using special tools. Determines the motion of gas on the surface.

Mesh variables:

  • Diffuse
    • AA = Atmosphere Density
    • RRGGBB = Rayleigh scattering
  • Ambient
    • Unused
  • Specular
    • RR = Gas displacement intensity
    • GG = Gas speed (animation speed)
    • BB = Unused

Given the highly specialized nature of the textures for Gas mode, it is intended that Gas Giants generally be modified by changing the LUT textures for color shifting and the gas control variables.

Volcanic Planet

Volcanic Planet

The Sins: Remastered Volcanic Planet


Specular AA = 40

Volcanic mode is another highly specialized mode that uses the TeamColorTexture file very differently than Ocean mode and requires some additional elements in its normal and emissive data. Volcano planets do not support water or city lights but do support animated lava and volcanic ash/cloud emittance.

Texture channels:

  • DiffuseTextureFileName
    • RGB = Basecolor
    • A = Specular
  • SelfIlluminationTextureFileName
    • RGB = Emissive
    • A = Roughness
  • NormalTextureFileName
    • R = Subsurface Scattering
    • G = Normal Y
    • B = Metalness
    • A = Normal X
  • TeamColorTextureFileName
    • R = Lava map
    • G = Smoke mask
    • B = Smoke texture
    • A = Height map

Mesh variables:

  • Diffuse
    • AA = Atmosphere Density
    • RRGGBB = Rayleigh scattering
  • Ambient
    • AA = Lightning frequency
  • Specular
    • Unused

In order for animated lava to work well, additional contrasting noise should be added to the emissive data for the lava as well as the normal data for the lava areas. The procedural animation uses the contrast in the normal data to generate the motion and the contrast in the emissive data will make the motion more visible.

The smoke texture channel is sampled as a square and not mapped to a sphere. If you texture is not square in format, it should be a square source stretched to the rectangular size of your texture file.

No Atmosphere Mode

Dwarf Planet

A Sins: Remastered Dwarf Planet


Specular AA = 00

This mode disables the cloud layer on the planet and does not have lightning strikes. Ideal for dwarf planets or other planetary bodies that do not have typical atmospheres. In addition, this mode also features mesh deformation based on the height map mask. In order for deformation to work well, a high triangle resolution mesh with evenly distributed face coverage should be used. If you wish to use this mode, it is recommended that you copy (and/or resize) the dwarf planet meshes included with Sins: Remastered v1.00 to avoid issues with UV/texture map and mesh surface misalignment.

Texture channels:

  • DiffuseTextureFileName
    • RGB = Basecolor
    • A = Specular
  • SelfIlluminationTextureFileName
    • RGB = Emissive
    • A = Roughness
  • NormalTextureFileName
    • R = Subsurface Scattering
    • G = Normal Y
    • B = Metalness
    • A = Normal X
  • TeamColorTextureFileName
    • RGB = Optional Emissive tiler pattern. Leave black to use CL basecolor.
    • A = Height map

Mesh variables:

  • Diffuse
    • AA = Atmosphere Density
    • RRGGBB = Rayleigh scattering
  • Ambient
    • AA = Unused
    • RRGGBB = Unused
  • Specular
    • RR = Unused
    • GG = Unused
    • BB = Fog density

Planetary Clouds

Sins: Remastered’s planet shader supports animated cloud textures using flowmaps.

Texture channels:

  • R = Noise texture (can reuse the provided default)
  • B = Flowmap R info
  • G = Cloudmap texture (black is transparent)
  • A = Flowmap G info (usually has to be inverted as well).

Additional control of the cloud texture has been implemented using the glowColor variable in the planet’s entity file:

glowColor cloud controls:

  • AA = Cloud map opacity
  • RR = Weight of the detail tiler
  • GG = Main cloud texture cutoff
  • BB = Cloud flowmap animation speed
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.