Difference between revisions of "Divide Scalar"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Updated descriptions and added example images.)
 
Line 1: Line 1:
[[Image:drex_module_78_image_0.png|485pxpx|Divide Scalar]]
+
<div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Divide</categorytree></div>
  
'''Node Description & Purpose: '''<br /> The Divide family of nodes allows you to divide the colour/scalar/vector coming into the Input by the color/scalar/vector coming into Input 2. The division is component-wise, for example with a colour:<br /><br /> Input.red '''divided by''' Input 2.red<br /> Input.green '''divided by''' Input 2.green<br /> Input.blue '''divided by''' Input 2.blue<br /><br /> Division by zero, which is an invalid operation and causes problems for computers, is handled safely by the nodes. In the case of division by zero the node will divide the value by epsilon, which is a very small number greater than zero. If you don't know what this means, basically you will get a very large valid number output from the node which ensures that your network will continue to work. If this was not done you could get either an invalid number which would cause problems in the rest of your network, or the application might even crash.<br /><br />'''Node Type: ''' Function<br /><br />'''Settings: '''<br /> All nodes in this family have just the one setting, which lets you choose a node for Input 2.
+
[[File:DivideScalar_00_GUI.png|none|470px|Divide Scalar]]
 +
 
 +
 
 +
== Overview ==
 +
The Divide family of nodes allows you to divide the colour/scalar/vector coming into the Main Input by the color/scalar/vector coming into Input 2. The division is component-wise, for example with a colour:
 +
<ul>
 +
Input.red divided by Input 2.red <br /n>
 +
Input.green divided by Input 2.green <br /n>
 +
Input.blue divided by Input 2.blue <br /n>
 +
</ul>
 +
 
 +
 
 +
The Divide family of nodes safely handles “division by zero”, which is an invalid operation. In the case of division by zero the node will divide the value by epsilon, which is a very small number greater than zero. This results in a very large valid number output from the node and ensures that your node network will continue to work. If this was not handled by the nodes, the result might be an invalid number, causing problems in the rest of the node network, or the application might even crash.
 +
 
 +
 
 +
In the graphs below, you can see the mathematical effect of the Divide family of nodes on a given value from the Main Input. When the value assigned to Input 2 is:
 +
<ul>
 +
* -1.0, the value of the node’s output is the inverse, or mirror, of the Main Input values.
 +
* 0.5, the value of the nodes output is twice as great as the Main Input values.
 +
* 1.0, the value of the node’s output is the same as that of the Main Input values.
 +
* 2.0, the value of the node’s output is half that of the Main Input values.
 +
</ul>
 +
 
 +
[[File:DivideFamily_00_Chart.jpg|none|800px|A comparison of the Divide family of node’s output to that of the Main Input, as the value of Input 2 is changed.]]
 +
 
 +
 
 +
In the following images, the Divide Scalar node is used to manipulate the displacement height the terrain.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:DivideScalar_02_Terrain_NodeNetwork.jpg|none|800px|Node network view, using the Divide scalar node to adjust the height of the Terrain.]]
 +
|-
 +
| [[File:DivideScalar_01_Terrain.jpg|none|800px|Comparison of how the terrain can be raised or lowered using a Scalar Displacement node and varying the value of the shader or function nodes assigned to Input 2.]]
 +
|}
 +
</ul>
 +
 
 +
 
 +
If a shader or function nodes are not connected to Input 2, the Main Input passes through to the Output.
 +
<ul>
 +
[[File:DivideScalar_03_Terrain_MainInputOnly.jpg|none|800px|When Input 2 is disconnected, the Main Input is passed through the node.]]
 +
</ul>
 +
 
 +
 
 +
All nodes in this family have only one setting, which lets you assign a shader or function nodes for Input 2.
 +
 
 +
 
 +
'''Settings:'''
 +
 
 +
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Divide Scalar nodes in a project.
 +
*'''Enable:''' When checked, the node is active and the division 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.
 +
*'''Input 2:''' The values from the shader or function nodes assigned to this setting are used as the divisor to the Main Input values. When nothing is assigned, the Main Input values, if any,  are passed through.  If the Main Input is unassigned, the output from the node is 0.
 +
 
 +
 
 +
<br /n>
  
<!-- imported from file: module_78.html-->
 
  
 
[[Category:Divide]]
 
[[Category:Divide]]

Latest revision as of 00:54, 8 February 2022

Divide Scalar


Overview[edit]

The Divide family of nodes allows you to divide the colour/scalar/vector coming into the Main Input by the color/scalar/vector coming into Input 2. The division is component-wise, for example with a colour:

    Input.red divided by Input 2.red
    Input.green divided by Input 2.green
    Input.blue divided by Input 2.blue


The Divide family of nodes safely handles “division by zero”, which is an invalid operation. In the case of division by zero the node will divide the value by epsilon, which is a very small number greater than zero. This results in a very large valid number output from the node and ensures that your node network will continue to work. If this was not handled by the nodes, the result might be an invalid number, causing problems in the rest of the node network, or the application might even crash.


In the graphs below, you can see the mathematical effect of the Divide family of nodes on a given value from the Main Input. When the value assigned to Input 2 is:

    • -1.0, the value of the node’s output is the inverse, or mirror, of the Main Input values.
    • 0.5, the value of the nodes output is twice as great as the Main Input values.
    • 1.0, the value of the node’s output is the same as that of the Main Input values.
    • 2.0, the value of the node’s output is half that of the Main Input values.
A comparison of the Divide family of node’s output to that of the Main Input, as the value of Input 2 is changed.


In the following images, the Divide Scalar node is used to manipulate the displacement height the terrain.

    Node network view, using the Divide scalar node to adjust the height of the Terrain.
    Comparison of how the terrain can be raised or lowered using a Scalar Displacement node and varying the value of the shader or function nodes assigned to Input 2.


If a shader or function nodes are not connected to Input 2, the Main Input passes through to the Output.

    When Input 2 is disconnected, the Main Input is passed through the node.


All nodes in this family have only one setting, which lets you assign a shader or function nodes for Input 2.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Divide Scalar nodes in a project.
  • Enable: When checked, the node is active and the division 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.
  • Input 2: The values from the shader or function nodes assigned to this setting are used as the divisor to the Main Input values. When nothing is assigned, the Main Input values, if any, are passed through. If the Main Input is unassigned, the output from the node is 0.



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

A vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.

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.

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