Glass Shader

From Terragen Documentation from Planetside Software
Revision as of 00:17, 4 March 2020 by Matt (talk | contribs)
Jump to: navigation, search

LuYu glass.jpg

An imported OBJ object with the Glass Shader (default settings), rendered by the Path Tracer.

The Glass Shader is similar to the Water Shader, but it simplifies the UI by removing some water-specific features and it includes extra settings which are often needed for objects made of glass or other materials with a glass-like appearance.

The Glass Shader can render subsurface scattering (SSS) which makes it useful for a wide range of materials that have this effect. Ice, smoky glass, ceramic and skin are examples of materials which have SSS. When using SSS, the results are best when rendering with Path Tracing.

Main Tab

Glass Shader


  • Double-sided / Thin-walled: This is intended to be used on open objects that don't have a far side to close the volume. For example, if you are rendering a window that is represented by a single surface, not two, you should turn this ON. It has the name "double-sided" because it renders thin surfaces as though they are both sides of the object. It prevents refraction (it causes light to pass through the glass in a straight line) and it prevents distance-based absorption and subsurface scattering.
  • Reflectivity: The ability of the surface to reflect light at glancing angles when roughness is low. At glancing angles this proportion is also removed from the transmitted (refracted) light so that it respects laws of energy conservation. In other words, reflectivity controls the blend between reflections and refractions at glancing angles when roughness is low.
  • Reflection tint: A multiplier for the light that is reflected after reflectivity has been calculated. It does not affect the blend between reflections and transmissions, it simply changes the brightness or colour of the reflections as though there is an absorbent material on the surface.
  • Index of refraction: This is a physical property of the surface that affects how reflectivity is calculated, not just refraction. Index of refraction (IOR) affects the reflectivity at perpendicular angles or on rough surfaces. It also affects how much the light is refracted (bent) when it is transmitted into the object. IOR should be at least 1. When the IOR is 1, no reflection occurs and light is fully transmitted into the object without being refracted. The higher the IOR, the more light is reflected, the less light is transmitted and the more refraction occurs on the transmitted light. For water this should be about 1.33 and for glass it should be between 1.45 and 1.9 (usually around 1.5). IOR is rarely higher than 4.0 in real materials. However, you might want to go higher than this to simulate metals. A higher index of refraction can be used to produce higher reflectivity at perpendicular angles, but this is essentially just a cheat and is not a physically-based way to render metal.

Sub-surface Tab

Glass Shader on the Sub-surface tab


  • Decay distance: Light traveling through the glass is absorbed using an exponential decay. "Decay distance" is how far (in metres) the light will travel before about 37% of its energy remains (if "Decay tint" is pure white). At twice the decay distance, only 14% of the light remains. Only 5% of the energy makes it to three times the decay distance. If "Decay tint" is anything other than pure white, light is absorbed at shorter distances than this.
  • Decay tint: An RGB multiplier for the Decay distance. Mathematically it works by multiplying the decay distance separately for the red, green and blue components of the light, but the results are much more interesting. Intuitively you might think of it as the colour of the light that reaches the decay distance, but it can produce an interesting range of hues and saturations that depend on how far the light travels. For realistic results you might want to use pale colours because they automatically become richer where the light travels further than the decay distance.


Examples of "Decay distance" and "Decay tint". "Decay tint" is set to a pale red colour, the same colour in each example.

  • Volume density
  • Volume colour
  • Volume density function
  • Volume colour function
  • Evaluate colour function volumetrically (without UVs)
  • Lighting method in Std
  • Lighting method in PT

See the Subsurface Scattering Guide.