Difference between revisions of "Transform Merge Shader"
Revision as of 01:58, 5 May 2017
Transform Merge Shader allows you to transform the output of other shaders by changing their texture coordinates, and then merge them with the main input (which is not transformed). 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). The shader which is connected to the 'Shader' input and all shaders upstream of this connection are affected by the Transform Merge 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.
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
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.