Red to Scalar

From Terragen Documentation from Planetside Software
Jump to: navigation, search
Red to Scalar



Overview[edit]

The Red/Green/Blue to scalar nodes all take a colour as input and output the respective colour component as a scalar. For example, the Red to scalar node will output the red value of the input colour.


In this example, the Red/Green/Blue to scalar nodes are used to create masks based on a painted shader.  The mask created by the Red to scalar node is then used to control the density of a population.
The Node network view showing how each of the red, green, and blue channels can be isolated from the Painted shader, and then used as masks.


This node has no other settings apart from the Input node.

Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Red 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.


Fun with Red to Scalar[edit]

In the example below, a simple image is used to define areas for population of crops and irrigation canals. By extracting the colour channels via the Red/Green/Blue to scalar nodes, and then combining them with other function nodes, like Add scalar and Subtract scalar, mattes can be derived to help control population density or shader influence.

The source image and red, green, and blue channels used to extract mattes for the agricultural and irrigation areas in the render below.
Render using Red/Green/Blue to scalar nodes to extract mattes from an image to be used for populations of agriculture plants and surface shader for irrigation water.
Node network view showing use of Red/Green/Blue to scalar nodes to extract mattes from an image to be used for populations of agriculture plants and surface shader for irrigation water.



A scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.

A single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene.

A shader is a program or set of instructions used in 3D computer graphics to determine the final surface properties of an object or image. This can include arbitrarily complex descriptions of light absorption and diffusion, texture mapping, reflection and refraction, shadowing, surface displacement and post-processing effects. In Terragen 2 shaders are used to construct and modify almost every element of a scene.