Difference between revisions of "Hard Step Scalar"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Updated descriptions and added example images.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:IMPORT]]
+
<div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Step</categorytree></div>
='''Hard Step Scalar'''=
 
  
[[Image:drex_module_130_image_0.png|485pxpx|Hard Step Scalar]]
+
[[File:HardStepScalar_00_GUI.png|none|470px|Hard Step Scalar]]
  
'''Node Description & Purpose: '''<br /> The Hard step scalar node is a function node which outputs either 1 or 0 depending on the input values. It can be used like a switch. The calculation the node performs is very simple, and looks like this :<br /><br />'''Input''' >= '''Step value'''<br /><br /> If '''Input''' has a value greater than or equal to '''Step value''', then the node outputs 1. If '''Input''' is not greater than or equal to '''Step value''' then the node outputs 0.<br /><br /> The Hard step scalar node can be very useful, but you need to be aware that it creates a hard transition between the two values. This can lead to visual artifacts in procedural textures. Often it is a better idea to use the [[Smooth Step Scalar|Smooth step scalar node]], which creates smooth transitions, if that can be worked into the network instead.<br /><br />'''Node Type: '''Function<br /><br />'''Settings: '''<br />
 
  
* '''Step value: '''The value corresponding to '''Step value''' in the description above. Version 2.4.5.0 and later: if there is no '''Step value''' then a value of 0 is used for the '''Step value'''.
+
==Overview==
  
<br />'''Error conditions:'''<br />
+
The Hard step scalar node is a function node which outputs either 1 or 0 depending on the input values. It can be used like a switch. The calculation the node performs is very simple:
 +
<ul>
 +
Main Input >= Step value
 +
</ul>
  
 +
 +
If the value from the Main Input is greater than or equal to Step value, then the node outputs 1.  If the value is less than the Step value, then the node outputs 0.
 +
[[File:HardStepScalar_04_Chart.JPG|none|800px|Graphed output from the Hard step scalar node.]]
 +
 +
 +
Note that this node creates a hard transition between the two values.  This can lead to visual artifacts in procedural textures, and often it is better to use the Smooth step scalar node, which creates smooth transitions.
 +
{|
 +
|-
 +
| [[File:HardStepScalar_01_Examples.JPG|none|800px|The Hard step scalar node can be used as a mask to create terraces and roads with hard transitions between altitudes.]]
 +
|-
 +
| [[File:HardStepScalar_02_NodeNetwork.JPG|none|800px|Node network example using two Hard step scalar nodes to define two masks based on different altitudes, then subtracting one mask from the other to define a road that conforms to the terrain.]]
 +
|}
 +
 +
 +
'''Settings:'''
 +
 +
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Hard Step Scalar nodes in a project.
 +
*'''Enable:''' When checked, the node is active and the hard step 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.
 +
*'''Step value:''' The value from the shader or function nodes assigned to this setting is used to evaluate the Main Input value as described above. In Terragen version 2.4.5.0 and later, if there is no Step value then a value of 0 is used for Step value.
 +
 +
 +
'''Error conditions:'''
 
* It is an error for there to be no input value. In that case 0 is output from the node.
 
* It is an error for there to be no input value. In that case 0 is output from the node.
* In versions older than 2.4.5.0, it is an error for there to be no '''Step value''' value. In this case the input value is output from the node.
+
* In versions older than 2.4.5.0, it is an error for there to be no Step value value. In this case the Main input value is output from the node.
 +
 
 +
 
 +
<br /n>
  
__NOTOC__
+
[[Category:Step]]
<!-- imported from file: module_130.html-->
 

Latest revision as of 00:11, 25 February 2022

Hard Step Scalar


Overview[edit]

The Hard step scalar node is a function node which outputs either 1 or 0 depending on the input values. It can be used like a switch. The calculation the node performs is very simple:

    Main Input >= Step value


If the value from the Main Input is greater than or equal to Step value, then the node outputs 1. If the value is less than the Step value, then the node outputs 0.

Graphed output from the Hard step scalar node.


Note that this node creates a hard transition between the two values. This can lead to visual artifacts in procedural textures, and often it is better to use the Smooth step scalar node, which creates smooth transitions.

The Hard step scalar node can be used as a mask to create terraces and roads with hard transitions between altitudes.
Node network example using two Hard step scalar nodes to define two masks based on different altitudes, then subtracting one mask from the other to define a road that conforms to the terrain.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Hard Step Scalar nodes in a project.
  • Enable: When checked, the node is active and the hard step 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.
  • Step value: The value from the shader or function nodes assigned to this setting is used to evaluate the Main Input value as described above. In Terragen version 2.4.5.0 and later, if there is no Step value then a value of 0 is used for Step value.


Error conditions:

  • It is an error for there to be no input value. In that case 0 is output from the node.
  • In versions older than 2.4.5.0, it is an error for there to be no Step value value. In this case the Main input value is output from the node.



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.