Difference between revisions of "Luminance to Scalar"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(jrfconvert import)
 
(Updated descriptions and added example images.)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:IMPORT]]
+
<div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Convert</categorytree></div>
='''Luminance to Scalar'''=
 
  
[[Image:drex_module_102_image_0.png|485pxpx|Luminance to Scalar]]
+
[[File:LuminanceToScalar_00_GUI.png|none|470px|Luminance to Scalar]]
__NOTOC__
+
 
<!-- imported from file: module_102.html-->
+
 
 +
== 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:
 +
<ul>
 +
luminance = 0.2125 * r + 0.7152 * g + 0.0724 * b
 +
</ul>
 +
 
 +
 
 +
In the image below, an image map's colour values are converted to scalar based on each colour's luminance value.
 +
 
 +
[[File:Luminous2Scalar_01_ImageMap.jpg|none|800px|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.
 +
{|
 +
|-
 +
| [[File:Luminous2Scalar_02_PaintedShaderDisplacement.JPG|none|800px|An example showing how much each colour component contributes to the luminance value. Displacement is based on the luminance value.]]
 +
|-
 +
| [[File:Luminous2Scalar_03_PaintedShaderNodeNetwork.JPG|none|800px|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.
 +
 
 +
 
 +
<br /n>
 +
 
 +
 
 +
[[Category:Convert]]

Latest revision as of 23:14, 15 March 2022

Luminance to Scalar


Overview[edit]

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.


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.
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.



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

This is essentially the brightness of the colour. Terragen converts RGB colours to greyscale by taking the luminance of the colour.

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.

Literally, to change the position of something. In graphics terminology to displace a surface is to modify its geometric (3D) structure using reference data of some kind. For example, a grayscale image might be taken as input, with black areas indicating no displacement of the surface, and white indicating maximum displacement. In Terragen 2 displacement is used to create all terrain by taking heightfield or procedural data as input and using it to displace the normally flat sphere of the planet.

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.