Vector Displacement Shader: Difference between revisions
Updated descriptions and example images. Will link to tutorial and content momentarily. |
Added Fun with Vector Displacement and linked to dropbox content files. |
||
| Line 83: | Line 83: | ||
== | == Fun with Vector Displacement == | ||
Try saving out a Terragen terrain as a vector displacement EXR image and then modifying it in a third party application, like Zbrush, adding details. Reload the modified image back into Terragen. | |||
Click [[Vector Displacement - Terragen to Zbrush and back again|here]] for complete tutorial. | |||
[[File:VDS_14_TerrainBeforeAfter.jpg|none|800px|A procedural Terragen terrain before and after adding construction site detail via the Vector displacement shader.]] | |||
In the image below, we created a Terragen project with a single crater shader and assigned a Fake stones shader to its Rim shader input for detail. We rendered several vector displacement EXR images of the crater, each time slightly adjusting the crater settings to generate a unique crater. We combined these vector displacement images in Zbrush to create a new vector displacement image with lots of craters. Note, Terragen could also be used to combine the individual EXR files, but it's easier to “paint” these features in Zbrush. Back in Terragen, the new vector displacement image with lots of craters was assigned to a Shader array and duplicated across the terrain. | |||
[[File:VDS_15_VDSCraterShaderArray.jpg|none|800px|A vector displacement image of lots of craters duplicated across the terrain with a Shader array.]] | |||
Click [https://www.dropbox.com/s/1zoc5cbrndus92o/Terragen4_FunWithVectorDisplacement_Content01.zip?dl=0 here] for Vector displacement shader content files. | |||
<br /n> | <br /n> | ||
Latest revision as of 00:42, 11 December 2021

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.
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.
- 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.
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.
- Reverse offset: When checked, the offset vector is reversed. In other words each component of the vector has its sign changed.
- 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.
Fun with Vector Displacement
Try saving out a Terragen terrain as a vector displacement EXR image and then modifying it in a third party application, like Zbrush, adding details. Reload the modified image back into Terragen.
Click here for complete tutorial.

In the image below, we created a Terragen project with a single crater shader and assigned a Fake stones shader to its Rim shader input for detail. We rendered several vector displacement EXR images of the crater, each time slightly adjusting the crater settings to generate a unique crater. We combined these vector displacement images in Zbrush to create a new vector displacement image with lots of craters. Note, Terragen could also be used to combine the individual EXR files, but it's easier to “paint” these features in Zbrush. Back in Terragen, the new vector displacement image with lots of craters was assigned to a Shader array and duplicated across the terrain.

Click here for Vector displacement shader content files.







