Difference between revisions of "Get Altitude"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(jrfconvert import)
 
(Updated descriptions and added example images.)
 
(7 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>Get</categorytree></div>
='''Get Altitude'''=
 
  
[[Image:drex_module_24_image_0.png|485pxpx|Get Altitude]]
+
[[File:GetAltitude_00_GUI.png|none|470px|Get Altitude]]
__NOTOC__
+
 
<!-- imported from file: module_24.html-->
+
 
 +
== Overview ==
 +
The Get Altitude node provides the "altitude" of the current [[Render State]]. The [[Render State]] is affected by any shaders which were called before this function is called, among other things. Get Altitude provides the signed difference between [[Get Position]] and [[Get Position in Geometry]] in the direction of [[Get Normal in Geometry]]. For a planet this basically means the altitude of the current point being rendered. Position is modified by displacement shaders, therefore so is altitude. Refer to [[Get Position]] for more information.
 +
 
 +
 
 +
The input connection is not used by this node, which is consistent with all [[:Get|Get nodes]].
 +
 
 +
 
 +
'''Settings:'''
 +
*'''Name: '''This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Get Altitude nodes in a project.
 +
*'''Enable:''' When checked, the node is active, and when unchecked the node is ignored.
 +
 
 +
== Fun with Get Altitude ==
 +
Here’s a simple example to illustrate how the Get Altitude node works.  We’ll mask a Surface layer with the results of a Conditional scalar node, that tests the altitude of the terrain.  The Surface layer’s test colour will indicate which parts of the terrain meet the requirements of the condition.
 +
 
 +
* Click on the “'''Shaders'''” button on the toolbar.
 +
* Click the “'''Add Layer'''” button then select “'''Surface Layer'''”. 
 +
* Under the Colour tab, check the “'''Enable test colour'''” checkbox.
 +
<ul>
 +
{|
 +
|-
 +
| [[File: GetPositionInTexture_11_AddSurfLay.jpg|none|800px|Add a Surface layer to the project.]]
 +
|-
 +
| [[File:GetAltitude_01_TestColor.jpg|none|800px|Render of terrain with the Surface layer’s Enable test colour parameter checked.]]
 +
|}
 +
</ul>
 +
 
 +
 
 +
* Click on an empty space in the Node Network pane to focus the program's attention there.
 +
* Press the tab key or “'''N'''” key to open the Quick Node Palette window.
 +
* Start typing the words “'''Conditional scalar'''” and the closest match in the Node list will be highlighted.
 +
* With “Conditional scalar” highlighted, press the enter key to add it to the project.
 +
* Drag a connection line from the “'''Output'''” of the Conditional scalar node to the ”'''Mask shader'''” input of the Surface layer node.
 +
* Add a “'''Get altitude'''” node to the project in the same manner.
 +
* Drag a connection line from the “'''Output'''” of the Get altitude node to the ”'''Main input'''” of the Conditional scalar node.
 +
* Add three “'''Constant scalar'''” nodes to the project.
 +
* Double-click on the first Constant scalar node to open its dialog window.
 +
* Set “'''Name'''” to “'''Constant scalar COMPARE'''”, or something descriptive.
 +
* Set “'''Scalar'''” to any altitude value you wish to test for.  We used “'''0'''”.
 +
* Drag a connection line from the “'''Output'''” of the Constant scalar node to the “'''Comparison value'''” input of the Conditional scalar node.
 +
* Double-click on the second Constant scalar node to open its dialog window.
 +
* Set “'''Name'''” to “'''Constant scalar IF'''”, or something descriptive.
 +
* Set “'''Scalar'''” to “'''1'''”.  This is the value we want the Conditional scalar node to output if the condition is met.
 +
* Drag a connection line from the “'''Output'''” of the Constant scalar node to the “'''If result'''” input of the Conditional scalar node.
 +
* Double-click on the last Constant scalar node to open its dialog window.
 +
* Set “'''Name'''” to “'''Constant scalar ELSE'''”, or something descriptive.
 +
* Set “'''Scalar'''” to “'''0'''”.  This is the value we want the Conditional scalar node to output if the condition is not met.
 +
* Drag a connection line from the “'''Output'''” of the Constant scalar node to the “'''Else result'''” input of the Conditional scalar node.
 +
* Double-click on the Conditional scalar node to open its dialog window.
 +
* Use the drop down list under the “'''Condition'''” parameter to set the test condition. 
 +
<ul>
 +
[[File:GetAltitude_02_ConditionalScalarOpts.png|None|276px|Conditional scalar Condition parameter drop down list.]]
 +
</ul>
 +
 
 +
 
 +
Here's a view of the Node Network.
 +
<ul>
 +
[[File:GetAltitude_03_Nodes.jpg|none|800px|Node Network view Step 01.]]
 +
</ul>
 +
 
 +
 
 +
Where the condition is met, i.e. the altitude is greater than 0, the terrain is coloured magenta.
 +
<ul>
 +
[[File:GetAltitude_04_GreaterThan0.jpg|none|800px|The terrain coloured magenta meet the condition Greater than 0.]]
 +
</ul>
 +
 
 +
 
 +
Where the condition is met, i.e. the altitude is less than 0, the terrain is coloured magenta.
 +
<ul>
 +
[[File:GetAltitude_05_LessThan0.jpg|none|800px|The terrain coloured magenta meet the condition Less than 0.]]
 +
</ul>
 +
 
 +
 
 +
<br /n>
 +
 
 +
 
 +
[[Category:Get]]

Latest revision as of 19:30, 29 March 2022

Get Altitude


Overview[edit]

The Get Altitude node provides the "altitude" of the current Render State. The Render State is affected by any shaders which were called before this function is called, among other things. Get Altitude provides the signed difference between Get Position and Get Position in Geometry in the direction of Get Normal in Geometry. For a planet this basically means the altitude of the current point being rendered. Position is modified by displacement shaders, therefore so is altitude. Refer to Get Position for more information.


The input connection is not used by this node, which is consistent with all Get nodes.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Get Altitude nodes in a project.
  • Enable: When checked, the node is active, and when unchecked the node is ignored.

Fun with Get Altitude[edit]

Here’s a simple example to illustrate how the Get Altitude node works. We’ll mask a Surface layer with the results of a Conditional scalar node, that tests the altitude of the terrain. The Surface layer’s test colour will indicate which parts of the terrain meet the requirements of the condition.

  • Click on the “Shaders” button on the toolbar.
  • Click the “Add Layer” button then select “Surface Layer”.
  • Under the Colour tab, check the “Enable test colour” checkbox.
    Add a Surface layer to the project.
    Render of terrain with the Surface layer’s Enable test colour parameter checked.


  • Click on an empty space in the Node Network pane to focus the program's attention there.
  • Press the tab key or “N” key to open the Quick Node Palette window.
  • Start typing the words “Conditional scalar” and the closest match in the Node list will be highlighted.
  • With “Conditional scalar” highlighted, press the enter key to add it to the project.
  • Drag a connection line from the “Output” of the Conditional scalar node to the ”Mask shader” input of the Surface layer node.
  • Add a “Get altitude” node to the project in the same manner.
  • Drag a connection line from the “Output” of the Get altitude node to the ”Main input” of the Conditional scalar node.
  • Add three “Constant scalar” nodes to the project.
  • Double-click on the first Constant scalar node to open its dialog window.
  • Set “Name” to “Constant scalar COMPARE”, or something descriptive.
  • Set “Scalar” to any altitude value you wish to test for. We used “0”.
  • Drag a connection line from the “Output” of the Constant scalar node to the “Comparison value” input of the Conditional scalar node.
  • Double-click on the second Constant scalar node to open its dialog window.
  • Set “Name” to “Constant scalar IF”, or something descriptive.
  • Set “Scalar” to “1”. This is the value we want the Conditional scalar node to output if the condition is met.
  • Drag a connection line from the “Output” of the Constant scalar node to the “If result” input of the Conditional scalar node.
  • Double-click on the last Constant scalar node to open its dialog window.
  • Set “Name” to “Constant scalar ELSE”, or something descriptive.
  • Set “Scalar” to “0”. This is the value we want the Conditional scalar node to output if the condition is not met.
  • Drag a connection line from the “Output” of the Constant scalar node to the “Else result” input of the Conditional scalar node.
  • Double-click on the Conditional scalar node to open its dialog window.
  • Use the drop down list under the “Conditionparameter to set the test condition.
    Conditional scalar Condition parameter drop down list.


Here's a view of the Node Network.

    Node Network view Step 01.


Where the condition is met, i.e. the altitude is greater than 0, the terrain is coloured magenta.

    The terrain coloured magenta meet the condition Greater than 0.


Where the condition is met, i.e. the altitude is less than 0, the terrain is coloured magenta.

    The terrain coloured magenta meet the condition Less than 0.



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.

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

In a graphical user interface (GUI) on a computer a toolbar is a row, column, or block of onscreen buttons or icons that, when clicked, activate certain functions of the program.

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.

A parameter is an individual setting in a node parameter view which controls some aspect of the node.