Luminance to Scalar

From Terragen Documentation from Planetside Software
Jump to navigation Jump to search
Luminance to Scalar
Luminance to Scalar


Overview

The Luminance to scalar node calculates the luminance of the color values from the shader or function nodes assigned to the Main Input, then outputs the luminance as a scalar value.

The math for this is:

    luminance = 0.2125 * r + 0.7152 * g + 0.0724 * b


In the image below, an image map's colour values are converted to scalar based on each colour's luminance value.

An example of a texture’s colour values converted to scalar values based on each colour’s luminance value.
An example of a texture’s colour values converted to scalar values based on each colour’s luminance value.


In following example, a Painted shader supplies three colour values, which are then used to displace the terrain surface according to the conversion formula, illustrating how much each colour contributes to the luminous value.

An example showing how much each colour component contributes to the luminance value. Displacement is based on the luminance value.
An example showing how much each colour component contributes to the luminance value. Displacement is based on the luminance value.
The Node Network view using a Painted Shader to displace the terrain based on each colour’s luminance value.
The Node Network view using a Painted Shader to displace the terrain based on each colour’s luminance value.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Luminance to Scalar nodes in a project.
  • Enable: When checked, the node is active and the conversion operation will take place. When unchecked the values assigned to its Main Input, if any, are passed through, otherwise a value of 0 is passed through.