The Merge Shader allows you to merge two separate shaders, or even entire shader networks, based on the input of a third shader acting as a mask. You can control the amount of contribution of each input shader as well as the method used for merging.
- Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Merge shader nodes in a project.
- Enable: When checked, the node is active and the settings below will affect how the shader networks are merged together. When unchecked, no merge takes place and the shader or function nodes assigned to the Main input are passed through unaffected.
- Shader A: This setting allows you to assign the shader or function nodes to be merged with the Main input.
Mix Control Tab
- Mix to A: This setting controls how much mixture takes place between the shader or function nodes assigned to the Main shader input and those assigned to the Shader A input. When the Merge mode is set to “Mix”, a value of 0 results in no mixture and a value of 1 results in a complete mixture, meaning that at 0 the outcome will be the same as the Main input and at 1 will be the same as Shader A. Other types of merge modes yield different results based on the way they blend the inputs.
- Mix controller: This setting is similar to the Mix family of function nodes which are used to blend or interpolate between two input values. If the value coming from the shader or function node assigned to the Mix controller is 0, then the value of the Main input node will be the result. If the value coming from the Mix controller node is 1, then the value of the Shader A node will be the result. If the Mix controller value is somewhere between 0 and 1 then the output will be a blended combination of the two input values based on the selected merge mode. Note, this setting only applies when the Choose by altitude setting is set to “All”.
- Choose by altitude: This popup menu has three options which are used to select which area of the surface the merge is applied to.
- All: This is the default option and when chosen the entire surface is affected by the merge.
- Highest (raise): Selects the higher of the two surfaces. The Mix controller is ignored.
- Lowest (cut away): The merge takes place on the lower of the two surfaces. The mix controller is ignored.
- Texture space:
- Current texture space (most uses):
- Undisplaced space (for alignment):
Merge Mode Tab
The settings on this tab determine which types of data are merged together; colour and/or displacement. The merge modes determine the manner in which the Main input and the Shader A input are blended. The merge modes listed below apply to both colour and displacement.
- Merge colour: When checked, the colour information from the shader or function nodes assigned to the Main input and Shader A input will be merged together in the manner selected via the Colour merge mode setting. When unchecked, the colour information will not be merged together.
- Merge displacement: When checked, the displacement information from the shader or function nodes assigned to the Main input and Shader A input will be merged together in the manner selected via the Displacement merge mode setting. When unchecked, the displacement information will not be merged together.
- Colour / Displacement merge modes: These two popup menus have nine options which determine the blending method used to merge the shader or function nodes assigned via the Main input and Shader A input.
*Mix (Normal): This mode progressively blends between the shaders or function nodes assigned to the two inputs. A value of 0.5 results in the two inputs being equally blended together. A value of 0 returns just the Main input, while a value of 1 returns just the Shader A input.
*Add: This mode adds the values from Shader A to the values from the Main input.
*Subtract (Input - A): This mode subtracts Shader A’s values from the values of the Main input.
*Subtract (A - Input): This mode subtracts the Main input’s values from the values of Shader A.
*Difference: This mode compares the two inputs and subtracts the brighter of the two values at any given point. When the values from Shader A are white the Main input values are inverted, and when its values are black no change is produced.
*Multiply (Input * A’s diffuse colour): This mode multiples values of the Main input by Shader A’s diffuse colour values. Multiplying any value by black will result in black, while multiplying by white leaves the value unchanged.
*Multiply (A * Input’s diffuse colour): This mode multiples the values of the Shader A by the Main input’s diffuse colour values. Multiplying any value by black will result in black, while multiplying by white leaves the value unchanged.
*Screen by A’s diffuse colour: This mode multiplies together the inverse of the two inputs resulting in brighter values. Where the diffuse colour values of Shader A are black the Main input values are unchanged and where the values of Shader A are white the Main input values become white.
*Screen by Input’s diffuse colour: This mode multiplies together the inverse of the two inputs resulting in brighter values. Where the diffuse colour values of the Main input are black the Shader A values are unchanged and where they are white the Main input values become white.
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.
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.