Difference between revisions of "Displacement Shader"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Added descriptions and example images. Conform to new layout.)
 
Line 1: Line 1:
[[Image:drex_module_18_image_0.png|center|Displacement Shader]]
+
[[File:DisplacementShdr_00_GUI.png|none|470x|Displacement Shader]]
  
'''Node Description and Purpose:'''<br />
 
The Displacement shader takes the values generated by the connected function nodes and turns them into displacement. You can connect any sort of function nodes to the input but the input value is converted to a scalar.
 
  
 +
==Overview==
 +
The Displacement shader displaces a surface by the values from any shader or function nodes assigned to its function input.  Values from the assigned shader or function nodes are converted to scalar data.
  
'''Node Type:''' Displacement Shader<br />
+
 +
'''Settings:'''
 +
 
 +
 +
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Displacement shader nodes in a project.
 +
 
 +
 
 +
*'''Enable:''' When checked, the node is active and the Displacement shader will be applied to the surface. When unchecked, the node is ignored.
 +
 
 +
 
 +
*'''Function:''' This setting allows you to assign shader or function nodes to use as displacement for the surface.
 +
<ul>
 +
[[File:DisplacementShdr_03_Funciton.jpg|none|800px|Various shaders assigned to Function setting to displace the flat plane.]]
 +
</ul>
  
  
'''Settings:'''
+
*'''Displacement direction:''' This popup has 5 options which allow you to choose the direction in which the displacement is applied in. Options that "(requires computed normal)" must have a Compute Terrain or Compute Normal node connected somewhere above the Surface Layer  in the network to work properly. The popup has the following options
 
<ul>
 
<ul>
<li>
+
[[File:SurfLay_05_DisplacementDirectionOptions_GUI.png|436px|Displacement direction options]] <br />
'''Function:''' You connect the function node(s) which generate the displacement values to this input.
 
</li><li>
 
'''Displacement direction:''' This popup list allows you to choose the direction that displacement is applied in. Any options in the popup list that have "(requires computed normal)" require that there be a [[Compute Terrain]] or [[Compute Normal]] connected somewhere above the node in the network to work properly. The popup has the following options:
 
 
<ul>
 
<ul>
<li>
+
<u>Along vertical:</u> Displacement happens along the normal of the underlying planet or 3D object’s geometry. <br />
<u>Along vertical:</u> Displacement will happen along the existing normals of the underlying object (i.e. the planet or a model) prior to any other displacement having been applied.
+
<u>Along normal:</u> Displacement happens along the current surface normal. <br />
</li><li>
+
<u>Vertical only (requires computed normal):</u> Displacement only happens along the normal of the underlying planet or 3d object’s geometry. The displacement is scaled by the difference between the object normal and the surface normal. Displacement is reduced as the angle between the normals approaches 90°. <br />
<u>Along normal:</u> Displacement will happen along the current surface normal.
+
<u>Lateral only (requires computed normal):</u> Displacement only occurs in the lateral plane, that is perpendicular to the normal of the underlying object. <br />
</li><li>
+
<u>Lateral normalized (requires computed normal):</u> This is the same as Lateral only but the normal is normalised, that is scaled so it has a length of 1. <br /><br />
<u>Vertical only (requires computed normal):</u> Displacement only happens along the normal of the underlying object (i.e. the planet or a model). The displacement is scaled by the difference between the object normal and the surface normal. Displacement is reduced as the angle between the normals approaches 90&deg;.
 
</li><li>
 
<u>Lateral only (requires computed normal):</u> Displacement only occurs in the lateral plane, or in other words perpendicular to the normal of the underlying object.
 
</li><li>
 
<u>Lateral normalized (requires computed normal):</u> This is the same as <u>Lateral only</u> but the normal is normalised (scaled so it has a length of 1).
 
</li>
 
 
</ul>
 
</ul>
</li><li>
+
{|
'''Displacement multiplier:''' This multiplies the displacement values coming from the '''Function''' input. A value of 1 leaves the incoming values unchanged. A value of 2 would make the incoming values twice as large. A value of 0.5 would make them half as large. Negative values will invert the displacement.
+
|-
</li>
+
| [[File:DefShdr_17_DisplacementTab_DiplaceDirectionOff.jpg|none|266px|Displace direction: Off ]]|| [[File:DefShdr_09_DisplacementTab_DisplaceDirectionAlongVertical.jpg|none|266px|Displacment direction: Along vertical]] || [[File:DefShdr_10_DisplacementTab_DisplaceDirectionAlongNormal.jpg|none|266px|Displacement direction: Along normal]]
 +
|-
 +
| [[File:DefShdr_11_DisplacementTab_DisplaceDirectionVerticalOnly.jpg|none|266px|Displacment direction: Vertical only]] || [[File:DefShdr_12_DisplacementTab_DisplaceDirectionLateralOnly.jpg|none|266px|Displacement direction: Lateral only]] || [[File:DefShdr_13_DisplacementTab_DisplaceDirectionLateralNormalized.jpg|none|266px|Displacement direction: Lateral normalized]]
 +
|}
 
</ul>
 
</ul>
 +
 +
 +
*'''Displacement multiplier:''' This multiplies the displacement values coming from the "Displacement function" input. A value of 1 leaves the incoming values unchanged. A value of 2 would make the incoming values twice as large. A value of 0.5 would make them half as large. Negative values will invert the displacement.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:DefShdr_14_DisplacementTab_DirectionMulitplier0p25.jpg|none|266px|Direction multiplier = 0.25]] || [[File:DefShdr_15_DisplacementTab_DirectionMulitplier0p5.jpg|none|266px|Displacement multiplier = 0.5]] || [[File:DefShdr_16_DisplacementTab_DirectionMulitplier1.jpg|none|266px|Displacement multiplier = 1.0]]
 +
|}
 +
</ul>
 +
<br /n>
 +
 +
  
  
 
[[Category:Displacement Shader]]
 
[[Category:Displacement Shader]]

Latest revision as of 21:15, 19 October 2021

Displacement Shader


Overview[edit]

The Displacement shader displaces a surface by the values from any shader or function nodes assigned to its function input. Values from the assigned shader or function nodes are converted to scalar data.


Settings:


  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Displacement shader nodes in a project.


  • Enable: When checked, the node is active and the Displacement shader will be applied to the surface. When unchecked, the node is ignored.


  • Function: This setting allows you to assign shader or function nodes to use as displacement for the surface.
    Various shaders assigned to Function setting to displace the flat plane.


  • Displacement direction: This popup has 5 options which allow you to choose the direction in which the displacement is applied in. Options that "(requires computed normal)" must have a Compute Terrain or Compute Normal node connected somewhere above the Surface Layer in the network to work properly. The popup has the following options
    Displacement direction options
      Along vertical: Displacement happens along the normal of the underlying planet or 3D object’s geometry.
      Along normal: Displacement happens along the current surface normal.
      Vertical only (requires computed normal): Displacement only happens along the normal of the underlying planet or 3d object’s geometry. The displacement is scaled by the difference between the object normal and the surface normal. Displacement is reduced as the angle between the normals approaches 90°.
      Lateral only (requires computed normal): Displacement only occurs in the lateral plane, that is perpendicular to the normal of the underlying object.
      Lateral normalized (requires computed normal): This is the same as Lateral only but the normal is normalised, that is scaled so it has a length of 1.

    Displace direction: Off
    Displacment direction: Along vertical
    Displacement direction: Along normal
    Displacment direction: Vertical only
    Displacement direction: Lateral only
    Displacement direction: Lateral normalized


  • Displacement multiplier: This multiplies the displacement values coming from the "Displacement function" input. A value of 1 leaves the incoming values unchanged. A value of 2 would make the incoming values twice as large. A value of 0.5 would make them half as large. Negative values will invert the displacement.
    Direction multiplier = 0.25
    Displacement multiplier = 0.5
    Displacement multiplier = 1.0


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

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.