Difference between revisions of "Displacement Shader to Vector"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Updated descriptions and added example images.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Node Description and Purpose:'''<br />
+
<div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Convert</categorytree></div>
The Displacement shader to vector node extracts the displacement generated by the connected shader and returns it as a vector, which can then be used by other function nodes.
 
  
In general, shaders may displace in any direction, so displacement is a vector. Note that if you connect this node to a function that expects a scalar input, a scalar will be generated from the length (magnitude) of the vector according to Terragen's conversion rules (see [[Node_Input_Type_Conversion]]). Be aware that this may not give you the results you expect if the displacement is negative, because the resulting scalar will always be positive or 0. In some cases [[Displacement_Shader_to_Scalar]] may be more suitable.
+
[[File:DisplacementShaderToVector_00_GUI.png|none|470px|Displacement Shader to Vector]]
  
See also: [[Displacement_Shader_to_Scalar]]
 
  
 +
__TOC__
  
'''Node Type:''' Function<br />
 
  
 +
==Overview==
 +
The Displacement shader to vector node extracts the displacement generated by the shader or function nodes assigned to its Main input, and returns it as a vector.
 +
 +
In general, shaders may displace in any direction, so displacement is a vector. Note that if the output of this node connects to a function that expects a scalar input, a scalar will be generated from the length (magnitude) of the vector according to Terragen's conversion rules (see Node Input Type Conversion). Be aware that this may not give you the results you expect if the displacement is negative, because the resulting scalar will always be positive or 0. In some cases Displacement Shader to Scalar may be more suitable.
  
'''Settings:'''<br />
 
 
This node has no other settings apart from the Input node.
 
This node has no other settings apart from the Input node.
 +
 +
 +
'''Settings:'''
 +
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Displacement shader to vector nodes in a project.
 +
*'''Enable:''' When checked, the node is active and the conversion operation will take place. When unchecked the values assigned to its Main Input, if any, are passed through, otherwise a value of 0 is passed through.
 +
 +
 +
== Fun with Displacement Shader to Vector ==
 +
The Displacement Shader to Vector node performs the task of converting displacement information to vector information.  While the node has no parameters per se, its use is critical in order to harness the power of vector displacement, which provides a method to import/export vector data between Terragen and other 3D software packages, such as Zbrush. 
 +
 +
 +
In the example images below, notice the overlapping features of the terrain which has been sculpted using Terragen’s procedural noise functions, like the Voronoi 3D diff scalar and the Power fractal shader v3 nodes.  Following the last node that displaces the terrain, a Displacement shader to vector node is used to direct the displacement data to a Default shader’s luminosity channel.  An image of the displacement data is rendered and saved as an EXR file, which can then be loaded back into Terragen, or even into another 3D software package for further manipulation. 
 +
 +
[[File:DispShdr2Vector_04_NodeNetwork.jpg|none|800px|A Node Network view of the Displacement Shader to Vector node supplying the Default shader with displacement information.]]
 +
 +
 +
Often when a complex network of displacements is used to shape the terrain, render times can actually be reduced by rendering and saving the displacements to an EXR file, and then assigning that image to a Vector Displacement Shader.
 +
 +
[[File:DispShdr2Vector_01_Compare.JPG|none|800px|A comparison of render times between a regularly displaced terrain, and a terrain displaced with the Vector Displacement Shader.]]
 +
 +
 +
In addition, the EXR image can be used multiple times in the project, re-positioning, rotating, and resizing it via the Vector Displacement Shader’s parameters or Transform Merge shaders.
 +
{|
 +
|-
 +
| [[File:DispShdr2Vector_02_MultiVector.JPG|none|800px|An EXR file used as a vector displacement can be used multiple times in a project.]]
 +
|-
 +
| [[File:DispShdr2Vector_03_NodeNetwork.jpg|none|800px|Node Network view illustrating the use of one EXR image to create multiple terrain features.]]
 +
|}
 +
 +
 +
 +
For more information about vector displacement pipelines click on the links below.
 +
<ul>
 +
[[Vector_Displacement_-_Terragen_to_Zbrush_and_back_again | Vector Displacement - Terragen to Zbrush and back again tutorial.]] <br /n>
 +
[[Vector_Displacement_Shader | Vector Displacement Shader documenation]]
 +
</ul>
 +
  
 +
<br /n>
  
 
[[Category:Convert]]
 
[[Category:Convert]]

Latest revision as of 23:35, 14 March 2022

Displacement Shader to Vector



Overview[edit]

The Displacement shader to vector node extracts the displacement generated by the shader or function nodes assigned to its Main input, and returns it as a vector.

In general, shaders may displace in any direction, so displacement is a vector. Note that if the output of this node connects to a function that expects a scalar input, a scalar will be generated from the length (magnitude) of the vector according to Terragen's conversion rules (see Node Input Type Conversion). Be aware that this may not give you the results you expect if the displacement is negative, because the resulting scalar will always be positive or 0. In some cases Displacement Shader to Scalar may be more suitable.

This node has no other settings apart from the Input node.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Displacement shader to vector nodes in a project.
  • Enable: When checked, the node is active and the conversion operation will take place. When unchecked the values assigned to its Main Input, if any, are passed through, otherwise a value of 0 is passed through.


Fun with Displacement Shader to Vector[edit]

The Displacement Shader to Vector node performs the task of converting displacement information to vector information. While the node has no parameters per se, its use is critical in order to harness the power of vector displacement, which provides a method to import/export vector data between Terragen and other 3D software packages, such as Zbrush.


In the example images below, notice the overlapping features of the terrain which has been sculpted using Terragen’s procedural noise functions, like the Voronoi 3D diff scalar and the Power fractal shader v3 nodes. Following the last node that displaces the terrain, a Displacement shader to vector node is used to direct the displacement data to a Default shader’s luminosity channel. An image of the displacement data is rendered and saved as an EXR file, which can then be loaded back into Terragen, or even into another 3D software package for further manipulation.

A Node Network view of the Displacement Shader to Vector node supplying the Default shader with displacement information.


Often when a complex network of displacements is used to shape the terrain, render times can actually be reduced by rendering and saving the displacements to an EXR file, and then assigning that image to a Vector Displacement Shader.

A comparison of render times between a regularly displaced terrain, and a terrain displaced with the Vector Displacement Shader.


In addition, the EXR image can be used multiple times in the project, re-positioning, rotating, and resizing it via the Vector Displacement Shader’s parameters or Transform Merge shaders.

An EXR file used as a vector displacement can be used multiple times in a project.
Node Network view illustrating the use of one EXR image to create multiple terrain features.


For more information about vector displacement pipelines click on the links below.



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 vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.

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.

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