Difference between revisions of "Merge Shader"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(jrfconvert import)
 
(Added descriptions and example images for all settings. Texture space descriptions & examples pending.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:IMPORT]]
+
[[File:Merge_00_GUI.png|none|470px|Merge Shader]]
='''Merge Shader'''=
 
  
[[Image:drex_module_152_image_0.png|485pxpx|Merge Shader]]
 
  
==Additional tabs for Merge Shader==
+
__TOC__
 +
== Overview ==
 +
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.
  
* [[Merge Shader - Merge Mode Tab]]
+
'''Settings:'''
__NOTOC__
+
 
<!-- imported from file: module_152.html-->
+
* '''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 ==
 +
[[File:Merge_01_MixControl.png|none|470px|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.
 +
 
 +
<ul>
 +
[[File:Merge_50_MixToA.jpg|none|800px|Mix to A values from 0 to 1.]]
 +
</ul>
 +
 
 +
 
 +
*'''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”.
 +
 
 +
<ul>
 +
[[File:Merge_49_MixController.jpg|none|800px|Image map shader assigned to Mix controller, with Mix amount = 1.]]
 +
</ul>
 +
 
 +
 
 +
*'''Choose by altitude: '''This popup menu has three options which are used to select which area of the surface the merge is applied to.
 +
 
 +
<ul>
 +
[[File:Merge_03_ChooseByAltitude.png|none|331px|Choose by altitude options.]]
 +
</ul>
 +
 
 +
 
 +
<ul>
 +
*<u>All:</u>  This is the default option and when chosen the entire surface is affected by the merge.
 +
<ul>
 +
[[File:Merge_47_ChooseAltitude_All.jpg|none|800px|Choose altitude = All]]
 +
</ul>
 +
 
 +
 
 +
*<u>Highest (raise):</u> Selects the higher of the two surfaces.  The Mix controller is ignored.
 +
<ul>
 +
[[File:Merge_48_ChooseAltitude_Hi.jpg|none|800px|Choose altitude = Highest (raised)]]
 +
</ul>
 +
 
 +
 +
*<u>Lowest (cut away):</u> The merge takes place on the lower of the two surfaces.  The mix controller is ignored.
 +
<ul>
 +
[[File:Merge_49_ChooseAltitude_Lo.jpg|none|800px|Choose altitude = Lowest (cut away)]]
 +
</ul>
 +
 
 +
</ul>
 +
 
 +
 
 +
*'''Texture space:'''
 +
<ul>
 +
[[File:Merge_04_TextureSpace.png|none|416px|Texture space options]]
 +
 
 +
 
 +
 
 +
* <u>Current texture space (most uses): </u>
 +
* <u>Undisplaced space (for alignment): </u>
 +
* <u>Legacy</u>
 +
</ul>
 +
 
 +
 
 +
== Merge Mode Tab==
 +
[[File:Merge_02_MergeMode.png|none|470px|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.
 +
 
 +
<ul>
 +
*'''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.
 +
 
 +
<ul>
 +
{|
 +
|-
 +
| [[File:Merge_06_ColourMergeMode.png|none|423px|Colour merge options]] || [[File:Merge_05_DisplaceMergeMode.png|none|423px|Displacement merge options]]
 +
|}
 +
 
 +
 
 +
<ul>
 +
*<u>Mix (Normal): </u> 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. <br>
 +
 
 +
*<u>Add:</u> This mode adds the values from Shader A to the values from the Main input.<br>
 +
 
 +
*<u>Subtract (Input - A):</u> This mode subtracts Shader A’s values from the values of the Main input.<br>
 +
 
 +
*<u>Subtract (A - Input):</u> This mode subtracts the Main input’s values from the values of Shader A.<br>
 +
 
 +
*<u>Difference:</u> 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.<br>
 +
 
 +
*<u>Multiply (Input * A’s diffuse colour):</u> 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.<br>
 +
 
 +
*<u>Multiply (A * Input’s diffuse colour):</u> 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.<br>
 +
 
 +
*<u>Screen by A’s diffuse colour:</u> 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.<br>
 +
 
 +
*<u>Screen by Input’s diffuse colour:</u> 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.<br>
 +
</ul>
 +
</ul>
 +
 
 +
 
 +
{|
 +
| [[File:Merge_51_MergeColourAndDisplacement.jpg|none|800px|Merge colour and displacement via all merge options]]
 +
|}
 +
</ul>
 +
 
 +
<br>
 +
 
 +
 
 +
[[Category:Other Shader]]

Latest revision as of 00:19, 9 June 2021

Merge Shader


Overview[edit]

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.

Settings:

  • 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[edit]

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 to A values from 0 to 1.


  • 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”.
    Image map shader assigned to Mix controller, with Mix amount = 1.


  • Choose by altitude: This popup menu has three options which are used to select which area of the surface the merge is applied to.
    Choose by altitude options.


    • All: This is the default option and when chosen the entire surface is affected by the merge.
      Choose altitude = All


    • Highest (raise): Selects the higher of the two surfaces. The Mix controller is ignored.
      Choose altitude = Highest (raised)


    • Lowest (cut away): The merge takes place on the lower of the two surfaces. The mix controller is ignored.
      Choose altitude = Lowest (cut away)


  • Texture space:
    Texture space options


    • Current texture space (most uses):
    • Undisplaced space (for alignment):
    • Legacy


Merge Mode Tab[edit]

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.
      Colour merge options
      Displacement merge options


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


    Merge colour and displacement via all merge options


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.