Get Altitude: Difference between revisions
No edit summary |
Updated descriptions and added example images. |
||
| Line 1: | Line 1: | ||
<div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Get</categorytree></div> | |||
[[File:GetAltitude_00_GUI.png|none|470px|Get Altitude]] | |||
< | == 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]] | [[Category:Get]] | ||
Latest revision as of 19:30, 29 March 2022

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 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.
![]() |
![]() |
- 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.
Here's a view of the Node Network.
Where the condition is met, i.e. the altitude is greater than 0, the terrain is coloured magenta.
Where the condition is met, i.e. the altitude is less than 0, the terrain is coloured magenta.





