Vector Displacement Shader: Difference between revisions

From Terragen Documentation from Planetside Software
Jump to navigation Jump to search
Created page with "'''Node Description and Purpose:''' <br /> The Vector displacement shader can be used to displace a surface in any direction using a vector. This vector can be a vector taken fro..."
 
Redmaw (talk | contribs)
Updated descriptions and example images. Will link to tutorial and content momentarily.
Line 1: Line 1:
'''Node Description and Purpose:''' <br />
[[File:VDS_00_GUI.png|none|470px | Vector Displacement Shader]]
The Vector displacement shader can be used to displace a surface in any direction using a vector. This vector can be a vector taken from a function input, a constant vector offset or a combination of both.


The node parameters are in two main groups. The <u>Function Vector</u> parameters apply to the vector obtained from the '''Vector function''' input. The second group is the <u>Offset Vector</u> parameters. You can use these parameters by themselves to apply a constant offset to displacement. You don't need to specify a '''Vector function''' for them to have an effect.
 
__TOC__
 
== Overview ==
The Vector displacement shader can be used to displace a surface in any direction using a vector. The vector can be taken from a function input, a constant vector offset or a combination of both.


This node is especially useful when you want to apply displacement to a surface using a function network. Normally if a function network was connected to a shader input used for displacement you would not see any effect because the function nodes are not able to directly modify displacement like a shader can. The Vector displacement shader is able to bridge that gap and can take the output of a function network and convert it to displacement.
This node is especially useful when you want to apply displacement to a surface using a function network. Normally if a function network was connected to a shader input used for displacement you would not see any effect because the function nodes are not able to directly modify displacement like a shader can. The Vector displacement shader is able to bridge that gap and can take the output of a function network and convert it to displacement.


Using this node opens up the ability to use multiple 3D applications when sculpting terrain features.  For example, you could create a procedural terrain in Terragen and export it as vector displacement data via an EXR image, then import the image into ZBrush for further refinement and sculpting,  Save the Zbrush refinements as vector displacement data via an EXR image and import that back into Terragen via the Vector displacement shader.
In the example image below, the image on the left relies on displacement of the planet surface by simple shape shaders and Twist and shear shaders, while the image on the right is based on a single rendered image of all the displacement shaders, then assigned to the Vector displacement shader’s Vector function.  As you can see, there is no difference between the final renders, yet on a complex terrain the render times from the Vector displacement shader can be significantly less, as the displacements have been “baked in” to the rendered image.
{|
|-
| [[File:VDS_06_DisplacemnetVsVDS.jpg|none|800px|Comparison between a displaced surface on the left, and a Vector displacement shader using an EXR image rendered from the displacement data.]]
|-
| [[File:VDS_07_NodeNetworkComparison.jpg|none|800px|Node Network view comparing nodes needed for displacement only verses nodes needed for Vector displacement shader.]]
|}
'''Settings:'''
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Vector displacement shader nodes in a project.
*'''Enable:''' When checked, the node is active and the settings below will affect the surface. When unchecked, the node is ignored.
== Function Vector Section ==
The Function Vector parameters apply to the vector obtained from the Vector function input.
*'''Vector function:'''  The function assigned to this setting is converted to displacement.  The input expects a vector but will convert other input types according to the type conversion rules described [[Node_Input_Type_Conversion | here]]. 
*'''X function multiplier:''' This value is multiplied with the X value obtained from the Vector function input.  A value of 1, results in no change to the X vector value.  Smaller values would reduce the X vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input.  Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed outwards could be turned inwards.
*'''Y function multiplier:''' This value is multiplied with the Y value obtained from the Vector function input.  A value of 1, results in no change to the Y vector value.  Smaller values would reduce the Y vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input.  Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed upwards could be turned downwards.
*'''Z function multiplier:''' This value is multiplied with the Z value obtained from the Vector function input.  A value of 1, results in no change to the Z vector value.  Smaller values would reduce the Z vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input.  Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed outwards could be turned inwards.
<ul>
[[File:VDS_08_XYZFunctionMulitpliers.jpg|none|800px|The Function multiplier value can modify each component value.]]
</ul>
*'''Reverse function:''' When checked, the value obtained from the Vector function input is reversed. In other words each component of the vector has its sign changed. This happens after the vector value has been multiplied by the function multiplier values above.
<ul>
[[File:VDS_09_ReverseFunction.jpg|none|800px|Reverse function off and on.]]
</ul>
== Offset Vector Section ==
The parameters under this section do not require that a shader or function nodes be assigned to the Vector Function setting.  Values applied to the Offset Vector settings apply a constant offset to any displacement by shifting the entire surface the Vector Displacement shader is applied to.


'''Node Type:''' Displacement shader<br />


*'''X offset:''' This value can be used to shift displacement along the X axis.


'''Settings:'''  
*'''Y offset:''' This value can be used to shift displacement along the Y axis.


*'''Z offset:''' This value can be used to shift displacement along the Z axis.
<ul>
<ul>
<li>
{|
'''Vector function:''' This input is where you connect the function you want to convert to displacement. The input expects a vector but will convert other input types according to the type conversion rules described [[Node Input Type Conversion|here]].
|-
</li><li>
| [[File:VDS_10_XZOffset.jpg|none|800px|Offset vectors applied to X and Z component values.]]
'''X function multiplier:''' This value is multiplied with the X value obtained from the '''Vector function''' input.
|-
</li><li>
| [[File:VDS_11_YOffset.jpg|none|800px|Offset vectors applied to Y component value. Note, that the dark grey value is constrained to an altitude of 0 and below.]]
'''Y function multiplier:''' This value is multiplied with the Y value obtained from the '''Vector function''' input.
|}
</li><li>
'''Z function multiplier:''' This value is multiplied with the Z value obtained from the '''Vector function''' input.
</li><li>
'''Reverse function:''' If this is checked the value obtained from the '''Vector function''' input is reversed. In other words each component of the vector has its sign changed. This happens after the vector value has been multiplied by the function multiplier values above.
</li><li>
'''X offset:''' This value can be used to shift displacement along the X axis.
</li><li>
'''Y offset:''' This value can be used to shift displacement along the Y axis.
</li><li>
'''Z offset:''' This value can be used to shift displacement along the Z axis.
</li><li>
'''Reverse offset:''' If this is checked the offset vector is reversed. In other words each component of the vector has its sign changed.
</li><li>
'''Final multiplier:''' The calculated displacement vector (the vector function and/or the offset) is multiplied by this value as the last step before being added to the current surface displacement.
</li>
</ul>
</ul>
*'''Reverse offset:''' When checked, the offset vector is reversed. In other words each component of the vector has its sign changed.
<ul>
[[File:VDS_12_ReverseOffset.jpg|none|800px|Reverse offset off and on.]]
</ul>
*'''Final multiplier:''' The calculated displacement vector (the vector function and/or the offset) is multiplied by this value as the last step before being added to the current surface displacement.
<ul>
[[File:VDS_13_FinalMultiplier.jpg|none|800px|Final multiplier values set to 0.25, 1.0 and 2.0.]]
</ul>
== Tutorials and Resources ==
Vector displacement shader - Terragen to Zbrush and back!  Coming shortly.
<br /n>




[[Category:Displacement Shader]]
[[Category:Displacement Shader]]

Revision as of 22:46, 19 November 2021

Vector Displacement Shader
Vector Displacement Shader


Overview

The Vector displacement shader can be used to displace a surface in any direction using a vector. The vector can be taken from a function input, a constant vector offset or a combination of both.

This node is especially useful when you want to apply displacement to a surface using a function network. Normally if a function network was connected to a shader input used for displacement you would not see any effect because the function nodes are not able to directly modify displacement like a shader can. The Vector displacement shader is able to bridge that gap and can take the output of a function network and convert it to displacement.

Using this node opens up the ability to use multiple 3D applications when sculpting terrain features. For example, you could create a procedural terrain in Terragen and export it as vector displacement data via an EXR image, then import the image into ZBrush for further refinement and sculpting, Save the Zbrush refinements as vector displacement data via an EXR image and import that back into Terragen via the Vector displacement shader.

In the example image below, the image on the left relies on displacement of the planet surface by simple shape shaders and Twist and shear shaders, while the image on the right is based on a single rendered image of all the displacement shaders, then assigned to the Vector displacement shader’s Vector function. As you can see, there is no difference between the final renders, yet on a complex terrain the render times from the Vector displacement shader can be significantly less, as the displacements have been “baked in” to the rendered image.


Comparison between a displaced surface on the left, and a Vector displacement shader using an EXR image rendered from the displacement data.
Comparison between a displaced surface on the left, and a Vector displacement shader using an EXR image rendered from the displacement data.
Node Network view comparing nodes needed for displacement only verses nodes needed for Vector displacement shader.
Node Network view comparing nodes needed for displacement only verses nodes needed for Vector displacement shader.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Vector displacement shader nodes in a project.
  • Enable: When checked, the node is active and the settings below will affect the surface. When unchecked, the node is ignored.


Function Vector Section

The Function Vector parameters apply to the vector obtained from the Vector function input.

  • Vector function: The function assigned to this setting is converted to displacement. The input expects a vector but will convert other input types according to the type conversion rules described here.


  • X function multiplier: This value is multiplied with the X value obtained from the Vector function input. A value of 1, results in no change to the X vector value. Smaller values would reduce the X vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input. Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed outwards could be turned inwards.
  • Y function multiplier: This value is multiplied with the Y value obtained from the Vector function input. A value of 1, results in no change to the Y vector value. Smaller values would reduce the Y vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input. Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed upwards could be turned downwards.
  • Z function multiplier: This value is multiplied with the Z value obtained from the Vector function input. A value of 1, results in no change to the Z vector value. Smaller values would reduce the Z vector value, for example a value of 0.5 would result in a displacement amount that’s half of the Vector function’s input. Negative values cause the vector’s sign to switch from positive to negative, or visa-versa, therefore a displacement that is pointed outwards could be turned inwards.
    The Function multiplier value can modify each component value.
    The Function multiplier value can modify each component value.


  • Reverse function: When checked, the value obtained from the Vector function input is reversed. In other words each component of the vector has its sign changed. This happens after the vector value has been multiplied by the function multiplier values above.
    Reverse function off and on.
    Reverse function off and on.


Offset Vector Section

The parameters under this section do not require that a shader or function nodes be assigned to the Vector Function setting. Values applied to the Offset Vector settings apply a constant offset to any displacement by shifting the entire surface the Vector Displacement shader is applied to.


  • X offset: This value can be used to shift displacement along the X axis.
  • Y offset: This value can be used to shift displacement along the Y axis.
  • Z offset: This value can be used to shift displacement along the Z axis.
    Offset vectors applied to X and Z component values.
    Offset vectors applied to X and Z component values.
    Offset vectors applied to Y component value. Note, that the dark grey value is constrained to an altitude of 0 and below.
    Offset vectors applied to Y component value. Note, that the dark grey value is constrained to an altitude of 0 and below.


  • Reverse offset: When checked, the offset vector is reversed. In other words each component of the vector has its sign changed.
    Reverse offset off and on.
    Reverse offset off and on.


  • Final multiplier: The calculated displacement vector (the vector function and/or the offset) is multiplied by this value as the last step before being added to the current surface displacement.
    Final multiplier values set to 0.25, 1.0 and 2.0.
    Final multiplier values set to 0.25, 1.0 and 2.0.


Tutorials and Resources

Vector displacement shader - Terragen to Zbrush and back! Coming shortly.