Difference between revisions of "Fractal Warp Shader"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Created page with "File:FractalWarpShader.png ---- Scale: File:WarpScale.gif Warp amount: File:WarpScaleAmount.gif Variation: File:WarpVariation.gif Roughness: [[File:WarpRou...")
 
m (Updated example images for Obey Smoothing parameter. Reformatted older archival example movies.)
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[File:FractalWarpShader.png]]
+
[[File:FWS_00-2_MainGui.png|none|470px|Fractal Warp Shader]]
 +
== Overview ==
 +
The Fractal warp shader distorts the 2D texture coordinates of the upstream shaders connected to its Main Input.  In the example below you can see the effect of modifying the '''Scale''' value on the black and white shapes.  Practical examples of this might be to transform a shape defined and displaced by a Simple shape shader into a snaking river that cuts across the terrain, or into a detailed hill or mountain.
 +
{|
 +
|-
 +
| [[File:FWS_50_2DExample_Scale0.jpg|none|400px|Scale = 0 (No Fractal warp applied)]] || [[File:FWS_51_2DExample_Scale500.jpg|none|400px|Scale = 500]] || [[File:FWS_52_2DExample_Scale1100.jpg|none|400px|Scale = 1100]]
 +
|}
  
----
+
{|
 +
|-
 +
| [[File:FWS_46v2_RiverExample_SimpleShape.jpg|none|400px|Simple shape shader displacing terrain.]] || [[File:FWS_46v2_RiverExample_FractalWarp.jpg|none|400px|Fractal warp shader warping terrain.]]
 +
|}
  
 +
{|
 +
|-
 +
| [[File:FWS_49v2_HillExample_SimpleShapeShader.jpg|none|400px|Simple shape shader displacing terrain.]] || [[File:FWS_49v2_HillExample_FWS.jpg|none|400px|Fractal warp shader warping terrain]]
 +
|}
  
Scale:   [[File:WarpScale.gif]]  Warp amount: [[File:WarpScaleAmount.gif]]
+
'''Settings:'''
  
Variation: [[File:WarpVariation.gif]] Roughness: [[File:WarpRoughness.gif]]
+
*'''Scale:''' Sets the size of the fractal pattern’s feature detail in meters and is similar to the Feature Scale parameter in a Power Fractal shader.  Default value is 1000 metres and useful values depend on the size of the area to warp.  Using too high a value relative to the size of the area you wish to affect, can result in unpredictable results as the fractal pattern can warp the areas to completely new positions and obliterate features.  Values lower than the size of the area you want to warp can lead to more predictable results.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_53_Scale100.jpg|none|400px|Scale = 100]] || [[File:FWS_54_Scale500.jpg|none|400px|Scale = 500]] || [[File:FWS_55_Scale1000.jpg|none|400px|Scale = 1000 (default)]] || [[File:FWS_56_Scale1500.jpg|none|400px|Scale = 1500]]
 +
|}
 +
</ul>
 +
<br />
 +
*'''Warp amount:''' Sets the amplitude of the warp effect.  Default value is 1.0.  A value of 0.0 results in no warping effect.  Lower values result in less warping, while higher values result in greater warping up to the limits set by the Scale parameter.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_57_WarpAmount0p5.jpg|none|400px|Warp amount = 0.5]] || [[File:FWS_58_WarpAmount1.jpg|none|400px|Warp amount = 1.0]] || [[File:FWS_59_WarpAmount1p5.jpg|none|400px|Warp amount = 1.5 (default)]] || [[File:FWS_60_WarpAmount2.jpg|none|400px|Warp amount = 2.0]]
 +
|}
 +
</ul>
 +
<br />
 +
*'''Variation:'''This has an effect on the shape of the warp.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_30_Variation_0p1.jpg|none|400px|Varitation = 0.1]] || [[File:FWS_31_Variation_0p5.jpg|none|400px|Variation = 0.5]] || [[File:FWS_32_Variation_1p0.jpg|none|400px|Variation = 1.0 (default)]] || [[File:FWS_33_Variation_2p0.jpg|none|400px|Variation = 2.0]]
 +
|}
 +
</ul> <br />
 +
*'''Roughness:''' This affects the amount of contribution from smaller octaves of the warp fractal. The default setting is 1, and recommended settings range from 0 to 2.0. 
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_26_Roughness_p85.jpg|none|400px|Roughness = 0.85]] || [[File:FWS_27_Roughness_p95.jpg|none|400px|Roughness = 0.95]] || [[File:FWS_28_Roughness_1p0.jpg|none|400px|Roughness = 1.0 (default)]] || [[File:FWS_29_Roughness_1p1.jpg|none|400px|Roughness = 1.1]]
 +
|-
 +
| [[File:FWS_29_Roughness_2p0.jpg|none|400px|Overdriving the Roughness value to 2.0 can lead to unpredictable vertical stretching and displacements.]]
 +
|}
 +
</ul><br />
 +
*'''Scale modulator:'''  The warp fractal consists of multiple octaves of noise, with each octave working at a different scale. The '''Scale modulator''' acts as a filter on which octaves are applied. When the '''Scale modulator''' is 1, all octaves are applied. When the '''Scale modulator''' is less than 1, some of the largest scale octaves are filtered out so that only the smaller scale octaves are applied. In other words it limits the largest scale of the fractal. The '''Scale modulator''' is applied using an exponential scale. When the s'''Sale modulator''' is 0.5, the largest scale is one thousand times smaller than normal. When the '''Scale modulator''' is 0, the largest scale is one million times smaller than normal.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_34_ScaleMod_SimpleShape.jpg|none|400px|Simple shape shader displacing terrain.]] || [[File:FWS_35_ScaleMod_FWS.jpg|none|400px|Fractal warp shader warping terrain.]] || [[File:FWS_36_ScaleMod_Ramp.jpg|none|400px|Ramp from 0 - 1 to be applied via Scale Modulator parameter.]]
 +
|-
 +
| [[File:FWS_37_ScaleMod_On.jpg|none|400px|Result of ramp assigned to Scale Modulator.]] || [[File:FWS_38_ScaleModMask.jpg|none|400px|Result of ramp assigned as a mask.]] ||
 +
|}
 +
</ul><br />
 +
*'''Obey downstream smoothing filters:'''  Allows the Fractal warp shader to take into consideration the “Smoothing scale” parameter of any Smoothing filter shaders located  downstream from it in the node network.  The “Smooth scale” value can force the Fractal warp shader not to generate features smaller than the “Smooth scale” value thereby smoothing its output.
 +
<ul>
 +
{|
 +
|-
 +
| [[File:FWS_61_ObeySmoothing1.jpg|none|400px|Smoothing = 1.0]] || [[File:FWS_62_ObeySmoothing2p5.jpg|none|400px|Smoothing = 2.5]] || [[File:FWS_63_ObeySmoothing5.jpg|none|400px|Smoothing = 5.0]] || [[File:FWS_64_ObeySmoothing10.jpg|none|400px|Smoothing - 10.0]]
 +
|}
 +
</ul><br />
 +
*'''Mask by shader:''' When checked this shader is masked by the shader or function node assigned to this parameter.
 +
*'''Fit mask to this:''' If this is checked the mask shader, specified with the '''Mask by shader''' parameter is given different texture coordinates in order to remap it into the texture space of this shader. Note that not all shaders use texture coordinates so this may have no effect.
 +
 
 +
*'''Invert mask:''' Check this to invert the values produced by the mask shader specified in the '''Mask by shader''' parameter.
 +
 
 +
 
 +
== Archival Examples ==
 +
<br />
 +
'''Effect on displacement'''
 +
{|
 +
|-
 +
! Scale !! Warp amount !! Variation !! Roughness
 +
|-
 +
| [[File:WarpScale.gif]] || [[File:WarpScaleAmount.gif]] || [[File:WarpVariation.gif]] || [[File:WarpRoughness.gif]]
 +
|}
 +
<br />
 +
'''Effects on texture '''
 +
{|
 +
|-
 +
! Scale !! Warp amount !! Variation !! Roughness
 +
|-
 +
| [[File:ScalePlanet.gif]] || [[File:WarpAmountPlanet.gif]] || [[File:VariationPlanet.gif]] || [[File:RoughnessPlanet.gif]]
 +
|}
 +
 
 +
<!-- == Example Movies ==
 +
<br />
 +
'''Effect on displacement'''
 +
{|
 +
|-
 +
|
 +
Scale<br />
 +
[[File:WarpScale.gif]]
 +
|
 +
Warp amount<br />
 +
[[File:WarpScaleAmount.gif]]
 +
|-
 +
|
 +
Variation<br />
 +
[[File:WarpVariation.gif]]
 +
|
 +
Roughness<br />
 +
[[File:WarpRoughness.gif]]
 +
|}
 +
'''Effect on texture'''
 +
{|
 +
|-
 +
|
 +
Scale<br />
 +
[[File:ScalePlanet.gif]]
 +
|
 +
Warp amount<br />
 +
[[File:WarpAmountPlanet.gif]]
 +
|-
 +
|
 +
Variation<br />
 +
[[File:VariationPlanet.gif]]
 +
|
 +
Roughness<br />
 +
[[File:RoughnessPlanet.gif]]
 +
|} -->
 +
 
 +
 
 +
 
 +
[[Category:Warp Shader]]

Revision as of 16:47, 4 September 2020

Fractal Warp Shader

Overview[edit]

The Fractal warp shader distorts the 2D texture coordinates of the upstream shaders connected to its Main Input. In the example below you can see the effect of modifying the Scale value on the black and white shapes. Practical examples of this might be to transform a shape defined and displaced by a Simple shape shader into a snaking river that cuts across the terrain, or into a detailed hill or mountain.

Scale = 0 (No Fractal warp applied)
Scale = 500
Scale = 1100
Simple shape shader displacing terrain.
Fractal warp shader warping terrain.
Simple shape shader displacing terrain.
Fractal warp shader warping terrain

Settings:

  • Scale: Sets the size of the fractal pattern’s feature detail in meters and is similar to the Feature Scale parameter in a Power Fractal shader. Default value is 1000 metres and useful values depend on the size of the area to warp. Using too high a value relative to the size of the area you wish to affect, can result in unpredictable results as the fractal pattern can warp the areas to completely new positions and obliterate features. Values lower than the size of the area you want to warp can lead to more predictable results.
    Scale = 100
    Scale = 500
    Scale = 1000 (default)
    Scale = 1500


  • Warp amount: Sets the amplitude of the warp effect. Default value is 1.0. A value of 0.0 results in no warping effect. Lower values result in less warping, while higher values result in greater warping up to the limits set by the Scale parameter.
    Warp amount = 0.5
    Warp amount = 1.0
    Warp amount = 1.5 (default)
    Warp amount = 2.0


  • Variation:This has an effect on the shape of the warp.
    Varitation = 0.1
    Variation = 0.5
    Variation = 1.0 (default)
    Variation = 2.0


  • Roughness: This affects the amount of contribution from smaller octaves of the warp fractal. The default setting is 1, and recommended settings range from 0 to 2.0.
    Roughness = 0.85
    Roughness = 0.95
    Roughness = 1.0 (default)
    Roughness = 1.1
    Overdriving the Roughness value to 2.0 can lead to unpredictable vertical stretching and displacements.


  • Scale modulator: The warp fractal consists of multiple octaves of noise, with each octave working at a different scale. The Scale modulator acts as a filter on which octaves are applied. When the Scale modulator is 1, all octaves are applied. When the Scale modulator is less than 1, some of the largest scale octaves are filtered out so that only the smaller scale octaves are applied. In other words it limits the largest scale of the fractal. The Scale modulator is applied using an exponential scale. When the sSale modulator is 0.5, the largest scale is one thousand times smaller than normal. When the Scale modulator is 0, the largest scale is one million times smaller than normal.
    Simple shape shader displacing terrain.
    Fractal warp shader warping terrain.
    Ramp from 0 - 1 to be applied via Scale Modulator parameter.
    Result of ramp assigned to Scale Modulator.
    Result of ramp assigned as a mask.


  • Obey downstream smoothing filters: Allows the Fractal warp shader to take into consideration the “Smoothing scale” parameter of any Smoothing filter shaders located downstream from it in the node network. The “Smooth scale” value can force the Fractal warp shader not to generate features smaller than the “Smooth scale” value thereby smoothing its output.
    Smoothing = 1.0
    Smoothing = 2.5
    Smoothing = 5.0
    Smoothing - 10.0


  • Mask by shader: When checked this shader is masked by the shader or function node assigned to this parameter.
  • Fit mask to this: If this is checked the mask shader, specified with the Mask by shader parameter is given different texture coordinates in order to remap it into the texture space of this shader. Note that not all shaders use texture coordinates so this may have no effect.
  • Invert mask: Check this to invert the values produced by the mask shader specified in the Mask by shader parameter.


Archival Examples[edit]


Effect on displacement

Scale Warp amount Variation Roughness
WarpScale.gif WarpScaleAmount.gif WarpVariation.gif WarpRoughness.gif


Effects on texture

Scale Warp amount Variation Roughness
ScalePlanet.gif WarpAmountPlanet.gif VariationPlanet.gif RoughnessPlanet.gif

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