Difference between revisions of "Transform Input Shader"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Added setting labels and descriptions, added example images.)
m (Added image example for Use world space (final position) setting.)
Line 20: Line 20:
  
 
*'''Use world space: (final position):''' When checked, the texture coordinates are reset to world space coordinates.
 
*'''Use world space: (final position):''' When checked, the texture coordinates are reset to world space coordinates.
 +
<ul>
 +
[[File:TransformInput_07_SphereWithUseWorldSpaceOn.jpg|none|800 px | By resetting the texture coordinates to World space coordinates the Power fractal shader is properly aligned and is no longer pinched at the top of the sphere.
 +
]]
 +
</ul>
  
  

Revision as of 23:34, 28 July 2021

Transform Input Shader


Overview[edit]

Transform Input Shader and Transform Merge Shader allow you to transform the output of other shaders by changing their texture coordinates. A transformation can translate (move), scale (resize) and rotate. It can also reset the texture coordinates to a different texture space (e.g. world space or undisplaced space). Any shaders which are upstream (via the main input connection) are affected by the Transform Input Shader, as long as those shaders are programmed to use texture coordinates. Most shaders do use texture coordinates but some exceptions are listed below. The Transform Input Shader works by modifying the texture coordinates before it evaluates the upstream shaders. The upstream shaders see modified texture coordinates and therefore any shapes or textures they produce are transformed in space.


The difference between the Transform Input Shader and the Transform Merge Shader is:

  • The Transform Input Shader transforms the shader attached to the main input (Input node) and any shaders further upstream of the main input.
  • The Transform Merge Shader transforms the shader attached to the Shader input and any shaders further upstream of that input (in other words a "side branch"). It merges the side branch with the main input, but only the side branch is transformed.


Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Transform Input 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.


  • Use world space: (final position): When checked, the texture coordinates are reset to world space coordinates.
    By resetting the texture coordinates to World space coordinates the Power fractal shader is properly aligned and is no longer pinched at the top of the sphere.


  • Use undisplaced space (position in geometry): When checked, the texture coordinates are reset to the undisplaced space.


  • Translate: When checked, all shaders upstream from this node are moved in the amount in metres and in the direction as specified by the values entered into the XYZ axis fields to the right.
    Terrain features and textures moved via Translate values.


  • Rotate: When checked, all shaders upstream from this node are rotated in degrees in the amount and direction as specified by the values entered into the XYZ axis fields to the right.
    Terrain features and textures rotated via Rotate setting.


  • Scale: When checked, all shaders upstream from this node are resized in the amount specified by the values entered into the XYZ axis fields to the right.
    Terrain features and textures resized via Scale values.


Exceptions[edit]

Some shaders are not always affected by the Transform Input Shader or Transform Merge Shader, depending on their settings:

  • Distribution Shader v4. If the Altitude Key is set to "Final position" then it uses world space instead of texture space, so the Tranform Input Shader and Transform Merge Shader have no effect, although its mask may be transformed.
  • Geog Image Map Shader. If georeferencing is enabled it uses world space instead of texture space, so the Transform Input Shader and Transform Merge Shader have no effect, although its mask may be transformed.

Some shaders are not affected by the Transform Input Shader or Transform Merge Shader, although their masks may be:

  • Any displacements following a 'Compute Terrain' node or 'Tex Coords from XYZ' node - these nodes reset the texture coordinates for downstream displacements
  • Cloud layers (Cloud Layer v2/v3 and Easy Cloud) - these are world space volumetric objects, but transforms can be applied separately to their inputs
  • Constant Shader - produces the same output everywhere
  • Distance Shader - uses world space
  • Heightfield Shader - uses world space, although its mask may be transformed
  • Lambert Shader - uses the same albedo everywhere
  • MOLA Map Shader - uses undisplaced normal to infer position on the planet, although its mask may be transformed
  • Planet Atmosphere - this is a world space volumetric object, but transforms can be applied separately to its inputs
  • Shadow Catcher Shader - is only affected by lighting
  • Twist and Shear Shader - uses world space
  • Visualise Normal - normals are not changed by the Tranform Input Shader or Transform Merge Shader


See also: Transform Merge Shader

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