Get Frame Number: Difference between revisions

From Terragen Documentation from Planetside Software
Jump to navigation Jump to search
No edit summary
Redmaw (talk | contribs)
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>Get</categorytree></div>
='''Get Frame Number'''=


[[Image:drex_module_32_image_0.png|485pxpx|Get Frame Number]]
[[File:GetFrameNumber_00_GUI.png|none|470px|Get Frame Number]]


Provides the current frame number as its output.


__NOTOC__
__TOC__
<!-- imported from file: module_32.html-->
 
 
== Overview ==
Provides the current frame number of the current Render State. Usually this is simply the current frame number, but in future there may be shaders which modify this on the fly for special effects or new renderer capabilities to allow sub-frame values.
The input connection is not used by this node (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 frame number nodes in a project.
*'''Enable:''' When checked, the node is active, and when unchecked the node is ignored.
 
== Fun with Get Frame Number ==
Here’s a fun way to animate cloud layers using the Get Frame Number node.  We’ll use the node to drive a warp shader assigned to the Density shader input of a cloud layer.  Let’s start by adding a cloud layer to the default Terragen project.
*'''Click''' the “'''Atmosphere'''” button on the top toolbar.
*'''Click''' the “'''Add Cloud Layer'''” button at the top of the Atmosphere Node List, and select “Mid-level: Generic”.
<ul>
[[File:GetFrameNumber_01_Nodes_Step01.JPG|none|800px|Node Network view - Step 01.]]
</ul>
 
Now we’ll construct the node network that feeds into the warp shader which is responsible for manipulating the clouds.
*'''Click''' once in an empty area of the Node Network pane to focus the program’s attention there. A dotted yellow line will become visible around the Node Network pane.
*Press the “'''Tab'''” key or “'''N'''” key to open the Quick Node Palette window.
* Start typing the words “'''Get frame number'''” and the closest match in the Node list will be highlighted.
* With “Get frame number” highlighted, press the “'''Enter'''” key to add it to the project.
* Repeat this process and add a “'''Vector displacement shader'''” node and a “'''Warp input shader'''” node to the project.
*'''Drag''' a connection line from the “'''Output'''” of the Get frame number node, to the “'''Vector function'''” of the Vector displacement shader node.
*'''Double-click''' on the Vector displacement shader node to open its dialog window.
*Set the “'''X function multiplier'''” value to “'''8'''”, the “'''Y function multiplier'''” value to “'''0'''”, and the “'''Z function multiplier'''” value to “'''40'''”.  These values control both the direction and how quickly the clouds move, and are in metres.
*Check the “'''Reverse function'''” parameter to make the clouds move in the opposite direction.
*'''Drag''' a connection line from the “'''Output'''” of the Vector displacement shader node to the “'''Warper'''” input of the Warp input shader node.
*'''Drag''' a connection line from the “'''Output'''” of the Density fractal node to the “'''Main input'''” of the Warp input shader node.
*Finally, '''drag''' a connection line from the “'''Output'''” of the Warp input shader node to the “'''Density shader'''” input of the cloud layer.
<ul>
[[File:GetFrameNumber_02_Nodes_Step02.JPG|none|800px|Node Network view - Step 02.]] <br /n>
[[File:GetFrameNumber_Anim.gif|none|400px|Get frame number node driving warp shader to animate clouds.]]
</ul>
 
 
In this example, we’ve used large values within the Vector displacement shader node to exaggerate how far the clouds move each frame.  When you need to be more precise, for example moving the clouds 1 metre per second,  you can divide the frame number by the number of frames per second.
* Add a “'''Divide scalar'''” node and a “'''Constant scalar'''” node to the project.
* '''Drag''' a connection line from the “'''Output'''” of the Get frame number node to the “'''Main input'''” of the Divide scalar node.
*'''Drag''' a connection line from the “'''Output'''” of the Divide scalar node to the “'''Vector function'''” input of the Vector displacement shader node.
*'''Double-click''' on the Constant scalar node to open its dialog window.
*Change the “'''Name'''” to something descriptive like “'''Constant scalar 24FPS'''”.
*Set the “'''Scalar'''” value to “'''24'''”, for 24 frames per second, or “'''30'''” for 30 frames per second, etc.
*'''Drag''' a connection line from the “'''Output'''” of the Constant scalar node to “'''Input 2'''” of the Divide scalar node.
<ul>
[[File:GetFrameNumber_03_Nodes_Step03.JPG|none|800px|Node Network view - Step 03.]]
</ul>
 
 
<br /n>
 
 
[[Category:Get]]

Latest revision as of 04:02, 21 April 2022

Get Frame Number
Get Frame Number



Overview

Provides the current frame number of the current Render State. Usually this is simply the current frame number, but in future there may be shaders which modify this on the fly for special effects or new renderer capabilities to allow sub-frame values. The input connection is not used by this node (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 frame number nodes in a project.
  • Enable: When checked, the node is active, and when unchecked the node is ignored.


Fun with Get Frame Number

Here’s a fun way to animate cloud layers using the Get Frame Number node. We’ll use the node to drive a warp shader assigned to the Density shader input of a cloud layer. Let’s start by adding a cloud layer to the default Terragen project.

  • Click the “Atmosphere” button on the top toolbar.
  • Click the “Add Cloud Layer” button at the top of the Atmosphere Node List, and select “Mid-level: Generic”.
    Node Network view - Step 01.
    Node Network view - Step 01.


Now we’ll construct the node network that feeds into the warp shader which is responsible for manipulating the clouds.

  • Click once in an empty area of the Node Network pane to focus the program’s attention there. A dotted yellow line will become visible around the Node Network pane.
  • Press the “Tab” key or “N” key to open the Quick Node Palette window.
  • Start typing the words “Get frame number” and the closest match in the Node list will be highlighted.
  • With “Get frame number” highlighted, press the “Enter” key to add it to the project.
  • Repeat this process and add a “Vector displacement shadernode and a “Warp input shadernode to the project.
  • Drag a connection line from the “Output” of the Get frame number node, to the “Vector function” of the Vector displacement shader node.
  • Double-click on the Vector displacement shader node to open its dialog window.
  • Set the “X function multiplier” value to “8”, the “Y function multiplier” value to “0”, and the “Z function multiplier” value to “40”. These values control both the direction and how quickly the clouds move, and are in metres.
  • Check the “Reverse functionparameter to make the clouds move in the opposite direction.
  • Drag a connection line from the “Output” of the Vector displacement shader node to the “Warper” input of the Warp input shader node.
  • Drag a connection line from the “Output” of the Density fractal node to the “Main input” of the Warp input shader node.
  • Finally, drag a connection line from the “Output” of the Warp input shader node to the “Density shader” input of the cloud layer.
    Node Network view - Step 02.
    Node Network view - Step 02.

    Get frame number node driving warp shader to animate clouds.
    Get frame number node driving warp shader to animate clouds.


In this example, we’ve used large values within the Vector displacement shader node to exaggerate how far the clouds move each frame. When you need to be more precise, for example moving the clouds 1 metre per second, you can divide the frame number by the number of frames per second.

  • Add a “Divide scalarnode and a “Constant scalarnode to the project.
  • Drag a connection line from the “Output” of the Get frame number node to the “Main input” of the Divide scalar node.
  • Drag a connection line from the “Output” of the Divide scalar node to the “Vector function” input of the Vector displacement shader node.
  • Double-click on the Constant scalar node to open its dialog window.
  • Change the “Name” to something descriptive like “Constant scalar 24FPS”.
  • Set the “Scalar” value to “24”, for 24 frames per second, or “30” for 30 frames per second, etc.
  • Drag a connection line from the “Output” of the Constant scalar node to “Input 2” of the Divide scalar node.
    Node Network view - Step 03.
    Node Network view - Step 03.