Difference between revisions of "Distance Shader"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(3 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
<ul>
 
<ul>
 
<li>
 
<li>
'''Apply far colour:''' Check this checkbox to use the colour specified at right as the far colour. If you don't specify a colour black will be used.
+
'''Apply far colour:''' Check this checkbox to use the colour specified at right as the far colour. If you don't specify a colour the shader's input will be passed through.
 
</li><li>
 
</li><li>
'''Apply near colour:''' Check this checkbox to use the colour specified at right as the near colour. If you don't specify a colour black will be used.
+
'''Apply near colour:''' Check this checkbox to use the colour specified at right as the near colour. If you don't specify a colour the shader's input will be passed through.
 
</li><li>
 
</li><li>
'''Far distance:''' This sets the furthest blending distance. The colour used further out than this distance will be the far colour.
+
'''Far distance:''' This sets the furthest blending distance. The colour at this distance will be the far colour.
 
</li><li>
 
</li><li>
'''Near distance:''' This sets the distance where the near colour starts to blend with the far colour. If this distance is more than 0 the near colour will be used from the camera position to the near distance.
+
'''Near distance:''' This sets the distance where the near colour starts to blend with the far colour. The colour at this distance will be the near colour.
 
</li><li>
 
</li><li>
 
'''Distance mode:''' This popup allows you choose the way the blending is done. The popup has these options:
 
'''Distance mode:''' This popup allows you choose the way the blending is done. The popup has these options:
Line 23: Line 23:
 
<li>
 
<li>
 
<u>Distance (spherical):</u> This option causes the distances to be calculated in a sphere around the camera. The shape of blending will be circular, radiating out in all directions. Here's an example showing the blend radiating out around the camera:
 
<u>Distance (spherical):</u> This option causes the distances to be calculated in a sphere around the camera. The shape of blending will be circular, radiating out in all directions. Here's an example showing the blend radiating out around the camera:
 +
[[image:distance_shader_spherical_example.jpg|180px|thumb|center|Spherical blend example]]
 
</li><li>
 
</li><li>
 
<u>Z depth (planar):</u> This option makes the blend happen in the direction the camera is looking. All points from the near distance back past the camera position will take on the near colour and the blend. The blend looks a bit like a line cutting across the scene perpendicular to the camera direction. Here's an example, showing how the blend is oriented to the camera:
 
<u>Z depth (planar):</u> This option makes the blend happen in the direction the camera is looking. All points from the near distance back past the camera position will take on the near colour and the blend. The blend looks a bit like a line cutting across the scene perpendicular to the camera direction. Here's an example, showing how the blend is oriented to the camera:
 +
[[image:distance_shader_linear_example.jpg|180px|thumb|center|Planar blend example]]
 
</li>
 
</li>
 
</ul>
 
</ul>
Line 30: Line 32:
 
'''Camera:''' This allows you to choose a camera to use with the shader. You can create cameras which are only used with Distance shaders and not actually used to view the scene through. If you don't specify one the camera being used for rendering is used.
 
'''Camera:''' This allows you to choose a camera to use with the shader. You can create cameras which are only used with Distance shaders and not actually used to view the scene through. If you don't specify one the camera being used for rendering is used.
 
</li><li>
 
</li><li>
'''Clamp far colour:''' When this is checked the far colour is clamped to 1.
+
'''Clamp far colour:''' When this is checked, all distances greater than the far distance will have the far colour. When it is unchecked, additional colours will be extrapolated beyond the far distance.
 
</li><li>
 
</li><li>
'''Clamp near colour:''' When this is checked the near colour is clamped to 0.
+
'''Clamp near colour:''' When this is checked, all distances less than the near distance will have the near colour. When it is unchecked, additional colours will be extrapolated below the near distance.
 
</li>
 
</li>
 
</ul>
 
</ul>
 +
  
  
 
[[Category:Colour Shader]]
 
[[Category:Colour Shader]]

Revision as of 10:14, 14 March 2012

Distance Shader

Node Description and Purpose:
The Distance Shader generates colour based on a computation of distance into the scene from a specific camera. You can specify the "near" and "far" colours, and the distances within which the shading will be performed. The two colours are blended between those distances. The output of a Distance Shader can be used to control surface textures, populations, even clouds and other scene features by distance from the camera, allowing you to for example specify that there are no clouds near to the camera and that cloud coverage increases with distance.


Node Type: Colour Shader


Settings:

  • Apply far colour: Check this checkbox to use the colour specified at right as the far colour. If you don't specify a colour the shader's input will be passed through.
  • Apply near colour: Check this checkbox to use the colour specified at right as the near colour. If you don't specify a colour the shader's input will be passed through.

  • Far distance: This sets the furthest blending distance. The colour at this distance will be the far colour.

  • Near distance: This sets the distance where the near colour starts to blend with the far colour. The colour at this distance will be the near colour.

  • Distance mode: This popup allows you choose the way the blending is done. The popup has these options:

    • Distance (spherical): This option causes the distances to be calculated in a sphere around the camera. The shape of blending will be circular, radiating out in all directions. Here's an example showing the blend radiating out around the camera:
      Spherical blend example
    • Z depth (planar): This option makes the blend happen in the direction the camera is looking. All points from the near distance back past the camera position will take on the near colour and the blend. The blend looks a bit like a line cutting across the scene perpendicular to the camera direction. Here's an example, showing how the blend is oriented to the camera:

      Planar blend example
  • Camera: This allows you to choose a camera to use with the shader. You can create cameras which are only used with Distance shaders and not actually used to view the scene through. If you don't specify one the camera being used for rendering is used.

  • Clamp far colour: When this is checked, all distances greater than the far distance will have the far colour. When it is unchecked, additional colours will be extrapolated beyond the far distance.

  • Clamp near colour: When this is checked, all distances less than the near distance will have the near colour. When it is unchecked, additional colours will be extrapolated below the near distance.

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.