Vector Displacement Shader

From Planetside Software Wiki
Jump to: navigation, search

Node Description and Purpose:
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 Function Vector parameters apply to the vector obtained from the Vector function input. The second group is the Offset Vector 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.

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.


Node Type: Displacement shader


Settings:

  • 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 here.
  • X function multiplier: This value is multiplied with the X value obtained from the Vector function input.

  • Y function multiplier: This value is multiplied with the Y value obtained from the Vector function input.

  • Z function multiplier: This value is multiplied with the Z value obtained from the Vector function input.

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

  • 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: If this is 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.

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

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