Difference between revisions of "Transform Input Shader"
|Line 36:||Line 36:|
Latest revision as of 02:08, 4 May 2018
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.
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.