Difference between revisions of "Distribution Shader v4"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Added descriptions and example images for most settings. Conformed to latest layout.)
 
Line 1: Line 1:
[[Image:drex_module_137_image_0.png|center|Distribution Shader v4]]
+
[[File:Distribution_00_GUI.png|none|470px|Distribution Shader v4]]
  
'''Node Description and Purpose:'''<br />
 
The Distribution shader is a very useful shader. You could use it to apply colour to something while controlling where that colour appears. You can also use it to generate a mask that can be used to blend other shaders or do things like control where populations appear. It shares many of the same concepts as the [[Surface Layer]] when it comes to controlling where something appears based on altitude or slope, as well as having similar coverage and breakup settings. In many ways it's a basic version of a Surface Layer without things like displacement and luminosity.
 
  
Let's say you have a grass population. You don't want it to appear on slopes steeper than 45&deg;. You can do this using a Distribution shader as the input to the population's density shader. In the Distribution shader go to the '''Slope constraints''' tab, check the '''Limit maximum slope''' checkbox and enter 45 in the '''Maximum slope angle''' field. Repopulate the grass and you'll see that it's only appearing on parts of the terrain where the slope is 45&deg; or less.
+
== Overview ==
 +
The Distribution shader is a versatile shader, useful for applying and controlling where colour appears. It is often used to generate masks in order to blend other shaders or limit where populations appear. In many ways It is similar to a Surface Layer, having altitude and slope constraints, and coverage and breakup settings, but without displacement and luminosity parameters.
 +
 +
'''Settings:'''
  
The output of the shader will be referred to as a "mask" in the following documentation as this is the most common way of using the shader.
+
*'''Name:''' This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Distribution shader nodes in a project. <br /n>
  
 +
*'''Enable: ''' When checked, the node is active and the settings below will affect the surface. When unchecked, the node is ignored. <br />
  
'''Node Type:''' Colour Shader<br />
+
*'''Colour:'''  This shader outputs the colour defined by the colour swatch to the right.  A slider and numerical input field allow you to easily adjust the colour’s brightness up or down.  White is often chosen for generating masks. <br /n>
 +
<ul>
 +
[[File:Distribution_28_Colour.jpg|none|800 px | The brightness of the colour can be adjusted with the slider or numerical input field.]]
 +
</ul>
 +
 
 +
 
 +
== Coverage/Breakup Tab ==
 +
[[File:Distribution_01_CoverageTab.png|none|470 px | Coverage/Breakup Tab]]
 +
 
 +
 
 +
*'''Coverage:''' This setting controls how much of this shader is applied, almost like a transparency control.  A value of 1 means the shader is fully applied and will cover all surfaces upstream of it in the node network, while smaller values allow only a portion of the surface layer to be applied, so the upstream surfaces will show through.  Coverage can be randomised by the use of the Fractal breakup setting below, which allows for a more naturalistic look by randomly breaking up the opacity of the coverage.
 +
<ul>
 +
[[File:Distribution_25_Coverage.jpg|none|800 px | Coverage settings from 0.25 to 1.0]]
 +
</ul>
 +
 
 +
 
 +
*'''Fractal breakup:''' When checked, shader opacity is broken up using the fractal assigned in the field to the right. This introduces a sense of randomness and texture, especially when used as a  mask. The amount of fractal breakup is specified in the controls immediately below. Larger numbers mean greater breakup. See [[Fractal Breakup Explained]] for details. <br /n>
 +
<ul>
 +
[[File:Distribution_27_FractalBreakupFuzzyZone1.jpg|none|800 px | Fractal breakup settings from 0.25 to 2 with Fuzzy zone softness at 1.]]
 +
</ul>
 +
 
 +
 
 +
*'''Invert breakup:'''  When checked, the fractal breakup pattern is inverted, i.e. light parts become dark and vice versa.
 +
<ul>
 +
[[File:Distribution_29_InvertBreakupOnOff.jpg|none|800 px | Invert breakup off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Mask by shader:'''  When checked, the shader or function nodes assigned to this setting are used as a mask for this Distribution shader. For example, you could use an [[Image Map Shader]] and an image to control where the Distribution shader appears. Likewise, you could paint a mask with a [[Painted Shader]], or use a [[Simple Shape Shader]] to limit this shader to a hexagonal area.  White parts of the shader indicate that the mask is more opaque, while shades of grey control the opacity or coverage of the layer. You can also control the RGB channels individually.
 +
<ul>
 +
[[File:Distribution_30_MaskByShaderOffOn.jpg|none|800 px | Get position in texture function nodes assigned to Mask by shader.]]
 +
</ul>
 +
 
 +
 
 +
*'''Invert mask:''' When checked, the masking shader is inverted, i.e. light parts become dark and vice versa.
 +
<ul>
 +
[[File:Distribution_31_InvertBreakupOffOn.jpg|none|800 px | Invert mask enabled.]]
 +
</ul>
 +
 
 +
 
 +
*'''Mask as coverage:''' When checked, the shader or function nodes assigned to this setting are used to modify coverage rather than simply as a mask for the shader.  Blending as coverage allows for more sophisticated interaction with aspects of the shader such as fractal breakup. This can be a subtle effect though and is an advanced feature you would not typically need to use.
 +
<ul>
 +
[[File:Distribution_32_MaskAsCoverageOffOn.jpg|none|800 px | Mask as coverage off and on.]]
 +
</ul>
 +
 
 +
 
 +
== Altitude Constraints Tab ==
 +
[[File:Distribution_02_AltitudeConstratintsTab.png|none|470 px | Altitude Constraints Tab]]
 +
 
 +
This tab has settings which let you control where the Distribution shader appears by altitude or height. For example, if your shader layer represents snow you might not want it to appear below a certain height. You can use the 3D Preview to quickly and accurately select altitudes by right clicking in the pane at the altitude you want and selecting “Copy Altitude” from the context menu, then pasting the copied value into the text field for Minimum Altitude by highlighting its current value and pressing “Ctrl + V” on your keyboard.  With the Limit minimum altitude checkbox enabled, the snow layer will only cover the terrain to the point at which you clicked in the 3D Preview.
 +
 
 +
*'''Limit maximum altitude:''' When checked, the Maximum altitude constraint becomes active and the shader is limited to altitudes below the Maximum altitude value. <br /n>
 +
 
 +
*'''Maximum altitude:''' This setting controls the maximum height at which the shader will appear at.
 +
<ul>
 +
[[File:Distribution_33_MaxAltOffOn.jpg|none|800 px | Maximum altitude off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Max alt fuzzy zone:''' This controls the width of the fuzzy zone for the maximum altitude constraint. The fuzzy zone is an area below the maximum altitude which controls how the shader is blended. [[Fuzzy Zones]] are explained in detail here.
 +
<ul>
 +
[[File:Distribution_34_MaxAltFuzzyOffOn.jpg|none|800 px | Maximum alt fuzzy zone off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Limit minimum altitude: ''' When checked, the Minimum altitude constraint becomes active and the shader will not appear below the Minimum altitude value. <br /n>
 +
 
 +
*'''Minimum altitude:''' This setting controls the minimum height at which the shader will appear at.
 +
<ul>
 +
[[File:Distribution_35_MinAltOffOn.jpg|none|800 px | Minimum altitude off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Min alt fuzzy zone: ''' This controls the width of the fuzzy zone for the minimum altitude constraint. The fuzzy zone is an area above the minimum altitude which controls how the shader is blended. Fuzzy zones are explained in detail here.
 +
<ul>
 +
[[File:Distribution_36_MinAltFuzzyOffOn.jpg|none|800 px | Minimum alt fuzzy zone off and on.]]
 +
</ul>
 +
 
 +
 
 +
<ul>
 +
[[File:Distribution_42_MaxMinAltAndFuzOffOn.jpg|none|800 px | Maximum and Minimum altitude with fuzzy zones off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Altitude key:''' This popup menu has two options which are used to select how the altitude or height is based.
 +
<ul>
 +
[[File:Distribution_06_AltitudeKey.png|none|292px|Altitude key options]]
 +
<u>Final position</u>: When selected the altitudes are based on world space and not texture space. <br /n>
 +
<u>Position in terrain/texture</u>: When selected the altitudes are based on texture space
 +
</ul>
 +
 
 +
 
 +
*'''Use Y:''' Description coming soon.
 +
 
 +
 
 +
== Slope Constraints Tab==
 +
[[File:Distribution_03_SlopeConstratintsTab.png|none|470 px | Slope Constraints Tab]]
 +
 
 +
This tab has settings which let you control where the Distribution shader appears according to slope. For example, if your surface layer represents grass you might want it to only grow on slopes that are relatively flat.  You can use the 3D Preview to quickly and accurately select the angle of the sloping terrain by right clicking in the pane at the level of the sloping area you want and selecting “Copy Slope Angle” from the context menu, then pasting the copied value into the text field for Maximum slope angle by highlighting its current value and pressing “Ctrl + V” on your keyboard.  With the Limit maximum slope checkbox enabled, the grass layer will only be visible on the terrain up to the point at which you clicked in the 3D Preview.
 +
 +
*'''Limit maximum slope: ''' When checked, the Maximum slope constraint becomes active and the shader will not be visible on slopes that are steeper than the Maximum slope angle.
 +
 
 +
*'''Maximum slope angle: ''' This setting controls the maximum slope angle that the shader will appear at.
 +
<ul>
 +
[[File:Distribution_37_MaxSlopeOffOn.jpg|none|800 px | Maximum slope angle off and on.]]
 +
</ul>
  
  
'''Settings:'''<br />
+
*'''Max slope fuzzy zone:''' This controls the width of the fuzzy zone for the maximum slope constraint. The fuzzy zone is an area of the shader that is less steep than the maximum slope angle and controls how the shader is blended.  [[Fuzzy Zones]] are explained in detail here.
 +
<ul>
 +
[[File:Distribution_38_MaxSlopeFuzzyOffOn.jpg|none|800 px | Maximum slope fuzzy zones off and on.]]
 +
</ul>
 +
 
  
* '''Colour:''' This sets the colour used to generate the mask. The mask will blend from this colour to black. Typically you would use white to generate a mask.
+
*'''Limit minimum slope:'''When checked, the Minimum slope constraint becomes active and the shader will not be visible on slopes that are less steep than the Minimum slope angle.
  
<u>Coverage, Breakup tab</u>
+
*'''Minimum slope angle:''' This setting controls the minimum slope angle that the shader will appear at. It will not appear on areas flatter than this angle.
 
<ul>
 
<ul>
<li>
+
[[File:Distribution_39_MinSlopeOffOn.jpg|none|800 px | Minimum slope angle off and on.]]
'''Coverage:''' This setting controls the coverage of the mask generated by the shader. It's a little like changing the transparency of the overall mask.
+
</ul>
</li><li>
 
'''Fractal breakup:''' If this is checked the mask is broken up using the fractal assigned in the field to the right. This introduces more of a sense of randomness and texture to the maks. The amount of fractal breakup is specified in the controls immediately below. Larger numbers mean greater breakup. See [[Fractal Breakup Explained]] for details.
 
</li><li>
 
'''Invert breakup:''' If this is checked the fractal breakup pattern is inverted, i.e. light parts become dark and vice versa.
 
</li><li>
 
'''Blend by shader:''' You can check this and specify a shader using the field to the left to have even greater control over where the mask appears. By default the mask will cover the whole planet. However you could, for example, use an [[Image Map Shader]] to control where the mask appears using an image. You could use a [[Painted Shader]] to paint where you want the mask to appear. You could use a [[Simple Shape Shader]] to limit the mask to a hexagonal area. There are lots of different things you can do.
 
  
Whiter parts of the shader show where the mask is more opaque. Shades of grey control the opacity or coverage of the layer. You can also control the RGB channels individually.
+
 
</li><li>
+
*'''Min slope fuzzy zone:''' This controls the width of the fuzzy zone for the minimum altitude constraint. The fuzzy zone is an area above the minimum altitude which controls how the shader is blended. [[Fuzzy Zones]] are explained in detail here.
'''Invert breakup:''' If this is checked the blending shader is inverted, i.e. light parts become dark and vice versa.
+
<ul>
</li><li>
+
[[File:Distribution_40_MinSlopeFuzzyOffOn.jpg|none|800 px | Minimum slope fuzzy zones off and on.]]
'''Blend as coverage:''' If this is checked the blending shader is used to modify coverage rather than blending the mask as a whole. Blending as coverage allows for more sophisticated interaction with aspects of the shader such as fractal breakup. This can be a subtle effect though and is an advanced feature you would not typically need to use.
 
</li>
 
 
</ul>
 
</ul>
  
  
==Additional tabs for Distribution Shader v4.01==
+
<ul>
 +
[[File:Distribution_41_MaxMinSlopeAndFuzzyOffOn.jpg|none|800 px | Maximum and Minimum slope angle with fuzzy zones off and on.]]
 +
</ul>
 +
 
 +
 
 +
*'''Slope key:''' This popup menu has three options which are used to select how the slope is calculated.
 +
<ul>
 +
[[File:Distribution_05_SlopeKey.png|none|264 px | Slope key options]]
 +
<u>Final normal:</u> This is the final normal computed after all the displacements have happened in the scene. <br /n>
 +
<u>Terrain normal:</u> This is the terrain normal, normally obtained from the last Compute Terrain node.<br /n>
 +
<u>Planet/object normal:</u> This the normal from the planet or object the surface layer is attached to, after displacement has been applied.<br /n>
 +
</ul>
 +
 
 +
 
 +
*''' Use Y:''' Slope is calculated based on the chosen option in the Slope key setting and wherever you go on the planet (or object) the slopes remain relative to the surface.  When this checkbox is enabled, the Y value from the normal will be used instead, which means the angle now becomes relative to the Y axis and as you move further from the planet origin the slope will change. This is most useful for creating global planet-wide effects. For normal surfacing situations you can ignore this setting.
 +
 
 +
 
 +
== Tweaks Tab ==
 +
[[File:Distribution_04_TweaksTab.png|none|470 px | Tweaks Tab]]
 +
 
 +
 
 +
*'''Fuzzy zone softness:'''  This setting changes the rate at which a partially-weighted surface approaches full weight. Where a shader is partially weighted, perhaps within the fuzzy zone of an altitude constraint or the transition zone of the Intersect Underlying feature, the weight can be boosted. This allows different effects than are possible with other settings that affect coverage. Low values allows the colour transition to become sharper.
 +
<ul>
 +
{|
 +
|-
 +
|[[File:Distribution_43_FractalBreakupFuzzyZone0p0.jpg|none|800 px | Fuzzy zone sharpness value = 0.00]]
 +
|-
 +
| [[File:Distribution_44_FractalBreakupFuzzyZone0p5.jpg|none|800 px | Fuzzy zone sharpness value = 0.50]]
 +
|}
 +
</ul>
  
* [[Distribution Shader v4 - Altitude Constraints Tab]]
 
  
* [[Distribution Shader v4 - Slope Constraints Tab]]
+
*'''Smoother fuzzy zones (better curve continuity):'''- Description coming soon.
  
* [[Distribution Shader v4 - Tweaks Tab]]
 
  
  
  
 
[[Category:Colour Shader]]
 
[[Category:Colour Shader]]

Latest revision as of 23:02, 16 July 2021

Distribution Shader v4


Overview[edit]

The Distribution shader is a versatile shader, useful for applying and controlling where colour appears. It is often used to generate masks in order to blend other shaders or limit where populations appear. In many ways It is similar to a Surface Layer, having altitude and slope constraints, and coverage and breakup settings, but without displacement and luminosity parameters.

Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Distribution 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.
  • Colour: This shader outputs the colour defined by the colour swatch to the right. A slider and numerical input field allow you to easily adjust the colour’s brightness up or down. White is often chosen for generating masks.
    The brightness of the colour can be adjusted with the slider or numerical input field.


Coverage/Breakup Tab[edit]

Coverage/Breakup Tab


  • Coverage: This setting controls how much of this shader is applied, almost like a transparency control. A value of 1 means the shader is fully applied and will cover all surfaces upstream of it in the node network, while smaller values allow only a portion of the surface layer to be applied, so the upstream surfaces will show through. Coverage can be randomised by the use of the Fractal breakup setting below, which allows for a more naturalistic look by randomly breaking up the opacity of the coverage.
    Coverage settings from 0.25 to 1.0


  • Fractal breakup: When checked, shader opacity is broken up using the fractal assigned in the field to the right. This introduces a sense of randomness and texture, especially when used as a mask. The amount of fractal breakup is specified in the controls immediately below. Larger numbers mean greater breakup. See Fractal Breakup Explained for details.
    Fractal breakup settings from 0.25 to 2 with Fuzzy zone softness at 1.


  • Invert breakup: When checked, the fractal breakup pattern is inverted, i.e. light parts become dark and vice versa.
    Invert breakup off and on.


  • Mask by shader: When checked, the shader or function nodes assigned to this setting are used as a mask for this Distribution shader. For example, you could use an Image Map Shader and an image to control where the Distribution shader appears. Likewise, you could paint a mask with a Painted Shader, or use a Simple Shape Shader to limit this shader to a hexagonal area. White parts of the shader indicate that the mask is more opaque, while shades of grey control the opacity or coverage of the layer. You can also control the RGB channels individually.
    Get position in texture function nodes assigned to Mask by shader.


  • Invert mask: When checked, the masking shader is inverted, i.e. light parts become dark and vice versa.
    Invert mask enabled.


  • Mask as coverage: When checked, the shader or function nodes assigned to this setting are used to modify coverage rather than simply as a mask for the shader. Blending as coverage allows for more sophisticated interaction with aspects of the shader such as fractal breakup. This can be a subtle effect though and is an advanced feature you would not typically need to use.
    Mask as coverage off and on.


Altitude Constraints Tab[edit]

Altitude Constraints Tab

This tab has settings which let you control where the Distribution shader appears by altitude or height. For example, if your shader layer represents snow you might not want it to appear below a certain height. You can use the 3D Preview to quickly and accurately select altitudes by right clicking in the pane at the altitude you want and selecting “Copy Altitude” from the context menu, then pasting the copied value into the text field for Minimum Altitude by highlighting its current value and pressing “Ctrl + V” on your keyboard. With the Limit minimum altitude checkbox enabled, the snow layer will only cover the terrain to the point at which you clicked in the 3D Preview.

  • Limit maximum altitude: When checked, the Maximum altitude constraint becomes active and the shader is limited to altitudes below the Maximum altitude value.
  • Maximum altitude: This setting controls the maximum height at which the shader will appear at.
    Maximum altitude off and on.


  • Max alt fuzzy zone: This controls the width of the fuzzy zone for the maximum altitude constraint. The fuzzy zone is an area below the maximum altitude which controls how the shader is blended. Fuzzy Zones are explained in detail here.
    Maximum alt fuzzy zone off and on.


  • Limit minimum altitude: When checked, the Minimum altitude constraint becomes active and the shader will not appear below the Minimum altitude value.
  • Minimum altitude: This setting controls the minimum height at which the shader will appear at.
    Minimum altitude off and on.


  • Min alt fuzzy zone: This controls the width of the fuzzy zone for the minimum altitude constraint. The fuzzy zone is an area above the minimum altitude which controls how the shader is blended. Fuzzy zones are explained in detail here.
    Minimum alt fuzzy zone off and on.


    Maximum and Minimum altitude with fuzzy zones off and on.


  • Altitude key: This popup menu has two options which are used to select how the altitude or height is based.
    Altitude key options

    Final position: When selected the altitudes are based on world space and not texture space.
    Position in terrain/texture: When selected the altitudes are based on texture space


  • Use Y: Description coming soon.


Slope Constraints Tab[edit]

Slope Constraints Tab

This tab has settings which let you control where the Distribution shader appears according to slope. For example, if your surface layer represents grass you might want it to only grow on slopes that are relatively flat. You can use the 3D Preview to quickly and accurately select the angle of the sloping terrain by right clicking in the pane at the level of the sloping area you want and selecting “Copy Slope Angle” from the context menu, then pasting the copied value into the text field for Maximum slope angle by highlighting its current value and pressing “Ctrl + V” on your keyboard. With the Limit maximum slope checkbox enabled, the grass layer will only be visible on the terrain up to the point at which you clicked in the 3D Preview.

  • Limit maximum slope: When checked, the Maximum slope constraint becomes active and the shader will not be visible on slopes that are steeper than the Maximum slope angle.
  • Maximum slope angle: This setting controls the maximum slope angle that the shader will appear at.
    Maximum slope angle off and on.


  • Max slope fuzzy zone: This controls the width of the fuzzy zone for the maximum slope constraint. The fuzzy zone is an area of the shader that is less steep than the maximum slope angle and controls how the shader is blended. Fuzzy Zones are explained in detail here.
    Maximum slope fuzzy zones off and on.


  • Limit minimum slope:When checked, the Minimum slope constraint becomes active and the shader will not be visible on slopes that are less steep than the Minimum slope angle.
  • Minimum slope angle: This setting controls the minimum slope angle that the shader will appear at. It will not appear on areas flatter than this angle.
    Minimum slope angle off and on.


  • Min slope fuzzy zone: This controls the width of the fuzzy zone for the minimum altitude constraint. The fuzzy zone is an area above the minimum altitude which controls how the shader is blended. Fuzzy Zones are explained in detail here.
    Minimum slope fuzzy zones off and on.


    Maximum and Minimum slope angle with fuzzy zones off and on.


  • Slope key: This popup menu has three options which are used to select how the slope is calculated.
    Slope key options

    Final normal: This is the final normal computed after all the displacements have happened in the scene.
    Terrain normal: This is the terrain normal, normally obtained from the last Compute Terrain node.
    Planet/object normal: This the normal from the planet or object the surface layer is attached to, after displacement has been applied.


  • Use Y: Slope is calculated based on the chosen option in the Slope key setting and wherever you go on the planet (or object) the slopes remain relative to the surface. When this checkbox is enabled, the Y value from the normal will be used instead, which means the angle now becomes relative to the Y axis and as you move further from the planet origin the slope will change. This is most useful for creating global planet-wide effects. For normal surfacing situations you can ignore this setting.


Tweaks Tab[edit]

Tweaks Tab


  • Fuzzy zone softness: This setting changes the rate at which a partially-weighted surface approaches full weight. Where a shader is partially weighted, perhaps within the fuzzy zone of an altitude constraint or the transition zone of the Intersect Underlying feature, the weight can be boosted. This allows different effects than are possible with other settings that affect coverage. Low values allows the colour transition to become sharper.
    Fuzzy zone sharpness value = 0.00
    Fuzzy zone sharpness value = 0.50


  • Smoother fuzzy zones (better curve continuity):- Description coming soon.

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.

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.

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.