Difference between revisions of "Power Fractal Shader v3"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Updated descriptions and added example images for Colour Tab. Legacy videos for Colour Tab added at bottom.)
(Added descriptions and example images for Displacement tab.)
Line 175: Line 175:
 
<ul>
 
<ul>
 
[[File:PF3_42_ClampLowColour.jpg|none|800px|The Clamp low colour setting ensures that colour values output by the shader are 0.0 or greater.]]
 
[[File:PF3_42_ClampLowColour.jpg|none|800px|The Clamp low colour setting ensures that colour values output by the shader are 0.0 or greater.]]
 +
</ul>
 +
 +
 +
== Displacement Tab ==
 +
[[File:PF3_03_DisplacementTab.png|none|470px|Displacement Tab]]
 +
 +
Displacements are one of the two main functions of the Power Fractal Shader. When displacement is enabled in this shader, the color information generated by the fractal is interpreted as elevations; where the high color equals maximum elevation, and the low color is the minimum elevation.  The elevation information is independent of the color chosen in the Colour tab of the Power Fractal Shader. In fact, colors can be completely disabled in the Power Fractal Shader and displacement information is still generated for use by other shaders and functions.
 +
 +
*'''Apply displacement:'''  When checked, the shader will generate displacement. This popup menu contains five options which allow you to choose the direction that displacement is applied in.  Options in the popup list that have "(requires computed normal)" require that there be a Compute Terrain or Compute Normal connected somewhere above the node in the network to work properly.
 +
<ul>
 +
[[File:PF3_07_ApplyDisplacement.png|none|439px|Apply displacement options]]
 +
<u>Along vertical:</u> Displacement happens along the original normals of the underlying object (i.e. the planet or a model) prior to any displacement having been applied. <br /n>
 +
<u>Along normal:</u> Displacement happens along the current surface normal.<br /n>
 +
<u>Vertical only (requires computed normal):</u> Displacement only happens along the normal of the underlying object (i.e. the planet or a model). The displacement is scaled by the difference between the object normal and the surface normal. Displacement is reduced as the angle between the normals approaches 90°.<br /n>
 +
<u>Lateral only (requires computed normal):</u> Displacement only occurs in the lateral plane, or in other words perpendicular to the normal of the underlying object.<br /n>
 +
<u>Lateral normalized (requires computed normal):</u> This is the same as Lateral only but the normal is normalised, that is scaled so it has a length of 1.<br /n>
 +
[[File:PF3_45_ApplyDisplacement.jpg|none|800px|Apply displacement options]]
 +
</ul>
 +
 +
 +
*'''Displacement amplitude:'''  This setting determines the amplitude of the displacement. For example, how high and low the maximum terrain features can be when the power fractal is used to displace a terrain. 
 +
<ul>
 +
[[File:PF3_47_DisplacementAmplitude.jpg|none|800px|Displacement amplitude ranging from none to 1000.]]
 +
</ul>
 +
 +
 +
*'''Displacement offset:''' This value is added to the displacement values, offsetting the displacement by a set amount along the displacement direction. Positive values push the displacement out so it looks almost as if it was sitting on a plinth. Negative values will sink the displacement back into the surface. It doesn't reverse the displacement, it's more like creating a hole in the surface and then applying the displacement to the bottom of the hole.
 +
<ul>
 +
[[File:PF3_46_DisplacementOffset.jpg|none|800px|Displacement offset ranging from 0 to 1000 metres, illustrating how the Apply displacement mode affects the offset direction.]]
 +
</ul>
 +
 +
 +
*'''Displacement roughness:''' This setting controls roughness of the displacements. Values less than 1 reduce the roughness of the displacement.
 +
<ul>
 +
[[File:PF3_48_DisplacementRoughness.jpg|none|800px|Displacement roughness ranging between 0 and 1]]
 +
</ul>
 +
 +
 +
*'''Displacement spike limit:'''  This setting prevents individual noise elements from becoming too high in amplitude.  It works similarly to a gradient limit, putting a damper on how steep the noise features can get.  Without damping, the fractal can end up with very steep and spikey features caused by high roughness, high displacement or high variation settings.  While you might want to use these high roughness values to drive steeper and rougher terrain at small scales, you still need a way to stop the roughness getting out of hand in some places due to amplitude variations.
 +
<ul>
 +
[[File:PF3_49_DisplacementSpikeLimit.jpg|none|800px|Displacement spike limit limits the amplitude of the noise features.]]
 +
</ul>
 +
 +
 +
*'''Continue spike limit:''' When unchecked, the Displacement spike limit only limits the amplitude of each octave independently.  When checked, whenever some noise element is affected by spike limit it remembers the reduction in amplitude and applies that reduction to further (smaller scaller) octaves that overlap the same region. This allows roughness and noise variation to continue to have effects on smaller scales even on parts of the fractal where the amplitude is being limited, and in most cases results in a smoother, yet more varied, appearance of steep surfaces where larger scale octaves were producing excessive amplitude.
 +
<ul>
 +
[[File:PF3_50_ContinueSpikeLimit.jpg|none|800px|Continue spike limit checked.]]
 +
</ul>
 +
 +
 +
*'''Adjust coastline:'''  When checked, displacements will be smoothed by the Coastline altitude and Coastline smoothing settings below.
 +
 +
 +
*'''Coastline altitude:'''  This setting controls the altitude where the smoothing effect begins. 
 +
<ul>
 +
[[File:PF3_51_CoastlineAltitude.jpg|none|800px|Coastline altitude at various heights.]]
 +
</ul>
 +
 +
 +
*'''Coastline smoothing:'''  This setting determines the amount of smoothing.  A value of 0 results in no smoothing.
 +
<ul>
 +
[[File:PF3_55_CoaslineAltitudeNeg100_CoastSmooth.jpg|none|800px|Coastline altitude = -100.  Coastline smoothing from 0 - 40.]]
 
</ul>
 
</ul>
  
Line 222: Line 284:
 
|}
 
|}
  
 +
{|
 +
|-
 +
|
 +
Displacement direction<br />
 +
[[File:DisplacementDirection.gif]]
 +
|
 +
Displacement amplitude<br />
 +
[[File:DisplacementAmplitude.gif]]
 +
|
 +
Displacement offset<br />
 +
[[File:OffsetDisplacement.gif]]
 +
|-
 +
|
 +
Displacement roughness<br />
 +
[[File:Displacement roughness.gif]]
 +
|
 +
Displacement spike limit<br />
 +
[[File:Displacement spike limit.gif]]
 +
|
 +
Coastline altitude<br />
 +
[[File:CoastlineAltitude.gif]]
 +
|-
 +
|
 +
Coastline smoothing<br />
 +
[[File:CoastlineSmoothing.gif]]
 +
|}
  
 
==Additional tabs for Power Fractal Shader v3==
 
==Additional tabs for Power Fractal Shader v3==
 
* [[Power Fractal Shader v3 - Displacement Tab]]
 
  
 
* [[Power Fractal Shader v3 - Tweak Noise Tab]]
 
* [[Power Fractal Shader v3 - Tweak Noise Tab]]

Revision as of 04:38, 29 August 2021

Power Fractal Shader v3


Overview[edit]

The Power Fractal Shader is one of the most important and fundamental shaders used in Terragen. Based on a choice of fractal formulas, it provides the user with the ability to create and control the distribution and displacement of many functions in any Terragen project. The fractal detail provided by this shader is user-defined and adaptable to any scale required, ranging between the order of magnitude of a tiny grain of sand, up to planetary structures.

Usually, the Power Fractal Shader is sourcing information to other shaders, such as a surface shader or cloud shader, which then interpret the fractal information provided, relative to the functions these other shaders perform.

Fractals can be used for displacement or for colour, or for both displacement and colour. When we refer to the amplitude of a feature, this is related to the "displacement amplitude" when used for displacement or the "colour contrast" when used for colour. The colour generated by a shader is often interpreted in other ways when connected to other shaders. Examples are the density of a cloud layer or the fractal breakup applied to another surface layer.

Scale is measured in texture space, which is not the same as the "tallness" of a feature. For example, you can have a feature scale of 100 km but its features only 10 metres tall.

The default scene contains a Power Fractal Shader which has been renamed "Base Colors". This shader provides color to the planet surface. To be precise, it provides a fractal distribution of colors, ranging from grey to black, at a certain fractal detail, contrast and color roughness. Under its Displacement Tab, the “Apply displacement” checkbox has been disabled so as not to provide additional 3D structure to the planet surface.

Settings

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Power fractal 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.
  • Seed: This setting controls the noise pattern generated. Each seed value generates a slightly different pattern. You can either set the value manually or use the Random Seed button at right to generate a random value.
  • Random seed: Clicking this button will randomly choose a new value for the “Seed” setting.
    The Seed value and Random seed button can be used to generate variations of the fractal pattern without having to change any of the other settings.
  • Mask by shader: When checked, the Power fractal shader is masked by the shader or function nodes assigned to this setting. Whiter parts of the masking shader show more of the image map. Shades of grey control the opacity of the image map.
  • Fit mask to this: When checked, the masking shader or function nodes are remapped to fit into the area of the image map shader. When unchecked, the masking shader determines the area to which the mask is applied.
  • Invert mask: When checked, the shader or function nodes assigned to the Mask by shader input are inverted. For example, light parts become dark and vice versa.

Scale Tab[edit]

Scale Tab


  • Feature scale: The dominant features in the fractal pattern occur at the "feature scale", therefore any positive value may be used. Features that are smaller than the feature scale have a reduced amplitude, that is, the amplitude continues to diminish as the scale gets smaller, at a rate that depends on the roughness parameters.
    Feature scale values on terrain at 1500, 5000, and 12500 metres.
    Feature scale values on cloud layer at 500, 1500, and 5000 metres.
    Feature scale values on planet at 10,000 metres, 100,000 metres, and 1,000,000 metres.


  • Lead-in scale: This setting should always be the largest feature that is visible in the texture. Any positive value may be used. With clouds, for example, the lead-in scale allows you to create variations that occur over large areas of the sky, even if you want more prominent features at a smaller scale.
    Lead-in scale values on terrain at 5000, 25000, and 100000 metres.
    Lead-in scale values on cloud at 7500, 50000, and 100000 metres.
    Lead-in scale value on planet at 250000, 1 million, and 5 million metres.


  • Smallest scale: This setting may be any positive value, and sets the fractal pattern’s limit for producing detail, so that the shader does not calculate detail to an infinite level. The fractal does not create detail below this scale. If this is the only fractal in your surface or texture, then it will be smooth below this scale.
    Smallest scale values on terrain at 0.1, 100 and 1000 metres.
    Smallest scale value on cloud layer at 0.1, 1000 and 1,500 metres.


  • Noise octaves: This setting controls the number of layers which are combined to make up the noise pattern. The noise in each additional layer is twice the frequency of the previous layer. This has the effect of adding finer detail to the noise pattern.
    Noise octave values on terrain ranging between 2 and 20.
    Noise octave values on cloud layer ranging between 2 and 20.
    Noise octave values on planet ranging between 2 and 20.


  • Obey downstream smoothing filters: This setting allows the shader to take into consideration the Smoothing scale setting value of any Smoothing filter shaders located downstream from its position in the node network. The Smoothing filter forces the Power Fractal shader not to generate features smaller than its Smooth scale value thereby smoothing the output of the Power Fractal shader..
    The Smoothing scale setting on Smoothing filter shaders downstream from the Power fractal shader limits the feature size generated by the Power fractal shader.
    The Smoothing scale setting on Smoothing filter shaders downstream from a cloud layer limits the feature size generated by the Power fractal shader.
    The Smoothing scale setting on Smoothing filter shaders downstream from the Power fractal shader limits the feature size generated by the Power fractal shader.


  • Noise stretch XYZ: This setting stretches, or scales, the noise pattern along the XYZ axis.
    The fractal noise pattern can be stretched along any or all of its axis via the Noise stretch XYZ setting.
    The fractal noise pattern can be stretched along any or all of its axis via the Noise stretch XYZ setting.
    The fractal noise pattern can be stretched along any or all of its axis via the Noise stretch XYZ setting.


Colour Tab[edit]

Colour Tab

The settings on this tab allow you to tweak the color information generated by the fractal, which in turn impacts the functions or nodes reading the information from this shader.

For example, a Power fractal shader with a colour range from black to white might be assigned to the Colour function parameter of a Surface layer in order to create variations of the colour defined by its Apply colour setting.

A Power fractal shader assigned to the Colour function setting of a Surface layer.


Or, a Power fractal shader might be used to tint a tree population, changing their folliage from green to autumnal colours.

A Power fractal shader assigned to the Diffuse tint colour setting of a population.


  • Apply high colour: When checked, the colour value to the right determines the high end of the power fractal’s colour range. The Power fractal shader generates a range of colours between this setting and the Apply low colour setting. When unchecked, the colour values defined by other shaders upstream from this shader are passed through.
    When the Apply high colour setting is unchecked, colour values from upstream shaders are passed through.


  • Apply low colour: When checked, the colour value to the right determines the low end of the power fractal’s colour range. When unchecked, the colour values defined by other shaders upstream from this shader are passed through.
    When the Apply low colour setting is unchecked, colour values from upstream shaders are passed through.
    When the Apply high colour and Apply low colour settings are checked, the shader generates colour values between the two colour swatches.


  • Colour contrast: This setting adjusts the contrast between the colors generated by the fractal.
    Contrast between the colour values generated by the power fractal can be adjusted via the Colour contrast setting.


  • Colour offset: This setting is used to adjust the bias between the Apply high colour and Apply low colour values. At the default value of zero the two colours are considered “in balance”. Lowering the value below 0 strengthens the effect of the Apply low colour, while increasing the value above 0 strengthens the effect of the Apply high colour.
    The Colour offset setting can be used to shift the colours towards the high or low colour value.
    The Colour offset setting can be used to shift the colours towards the high or low colour value.


  • Colour roughness: This setting controls the transitions between the colour values. The lower the value the smoother the transition, and the higher the value the sharper and more abrupt the transition.
    The Colour roughness value controls the transition between colour values in the fractal.
    The Colour roughness value controls the transition between colour values in the fractal.


  • Clamp high colour: The Power Fractal shader generates values above white or 1.0. When checked, this setting stops the fractal from generating values greater than 1.0.
    The Clamp high colour setting ensures that colour values output by the shader do not exceed a value of 1.0.


  • Clamp low colour: The Power Fractal shader generates values below black or 0.0. When checked, this setting stops the fractal from generating values below 0.0.
    The Clamp low colour setting ensures that colour values output by the shader are 0.0 or greater.


Displacement Tab[edit]

Displacement Tab

Displacements are one of the two main functions of the Power Fractal Shader. When displacement is enabled in this shader, the color information generated by the fractal is interpreted as elevations; where the high color equals maximum elevation, and the low color is the minimum elevation. The elevation information is independent of the color chosen in the Colour tab of the Power Fractal Shader. In fact, colors can be completely disabled in the Power Fractal Shader and displacement information is still generated for use by other shaders and functions.

  • Apply displacement: When checked, the shader will generate displacement. This popup menu contains five options which allow you to choose the direction that displacement is applied in. Options in the popup list that have "(requires computed normal)" require that there be a Compute Terrain or Compute Normal connected somewhere above the node in the network to work properly.
    Apply displacement options

    Along vertical: Displacement happens along the original normals of the underlying object (i.e. the planet or a model) prior to any displacement having been applied.
    Along normal: Displacement happens along the current surface normal.
    Vertical only (requires computed normal): Displacement only happens along the normal of the underlying object (i.e. the planet or a model). The displacement is scaled by the difference between the object normal and the surface normal. Displacement is reduced as the angle between the normals approaches 90°.
    Lateral only (requires computed normal): Displacement only occurs in the lateral plane, or in other words perpendicular to the normal of the underlying object.
    Lateral normalized (requires computed normal): This is the same as Lateral only but the normal is normalised, that is scaled so it has a length of 1.

    Apply displacement options


  • Displacement amplitude: This setting determines the amplitude of the displacement. For example, how high and low the maximum terrain features can be when the power fractal is used to displace a terrain.
    Displacement amplitude ranging from none to 1000.


  • Displacement offset: This value is added to the displacement values, offsetting the displacement by a set amount along the displacement direction. Positive values push the displacement out so it looks almost as if it was sitting on a plinth. Negative values will sink the displacement back into the surface. It doesn't reverse the displacement, it's more like creating a hole in the surface and then applying the displacement to the bottom of the hole.
    Displacement offset ranging from 0 to 1000 metres, illustrating how the Apply displacement mode affects the offset direction.


  • Displacement roughness: This setting controls roughness of the displacements. Values less than 1 reduce the roughness of the displacement.
    Displacement roughness ranging between 0 and 1


  • Displacement spike limit: This setting prevents individual noise elements from becoming too high in amplitude. It works similarly to a gradient limit, putting a damper on how steep the noise features can get. Without damping, the fractal can end up with very steep and spikey features caused by high roughness, high displacement or high variation settings. While you might want to use these high roughness values to drive steeper and rougher terrain at small scales, you still need a way to stop the roughness getting out of hand in some places due to amplitude variations.
    Displacement spike limit limits the amplitude of the noise features.


  • Continue spike limit: When unchecked, the Displacement spike limit only limits the amplitude of each octave independently. When checked, whenever some noise element is affected by spike limit it remembers the reduction in amplitude and applies that reduction to further (smaller scaller) octaves that overlap the same region. This allows roughness and noise variation to continue to have effects on smaller scales even on parts of the fractal where the amplitude is being limited, and in most cases results in a smoother, yet more varied, appearance of steep surfaces where larger scale octaves were producing excessive amplitude.
    Continue spike limit checked.


  • Adjust coastline: When checked, displacements will be smoothed by the Coastline altitude and Coastline smoothing settings below.


  • Coastline altitude: This setting controls the altitude where the smoothing effect begins.
    Coastline altitude at various heights.


  • Coastline smoothing: This setting determines the amount of smoothing. A value of 0 results in no smoothing.
    Coastline altitude = -100.  Coastline smoothing from 0 - 40.


Legacy Example Movies[edit]

Feature scale
FeatureScale.gif

Lead-in scale
LeadInV3Cloud.gifLeadInV3.gif

Smallest scale
SmallestScale.gif

Noise octaves
NoiseOctavesV3.gif

Noise stretch
NoiseStretchV3.gif

"Apply High Color" and "Apply Low Color"
Applycolor.gif

Color Contrast
Colorcontrast.gif

Color Offset
Offsetcolor.gif

Color Roughness
Roughnessscolor.gif

"Clamp High Color" and "Clamp Low Color"
ColorClamp.gif

Displacement direction
DisplacementDirection.gif

Displacement amplitude
DisplacementAmplitude.gif

Displacement offset
OffsetDisplacement.gif

Displacement roughness
Displacement roughness.gif

Displacement spike limit
Displacement spike limit.gif

Coastline altitude
CoastlineAltitude.gif

Coastline smoothing
CoastlineSmoothing.gif

Additional tabs for Power Fractal Shader v3[edit]


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

A parameter is an individual setting in a node parameter view which controls some aspect of the node.

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.