Distance Shader

From Terragen Documentation from Planetside Software
Jump to: navigation, search

Distance Shader

Overview[edit]

The Distance Shader generates colour by computing the distance between a referenced camera and a given sample point within the scene. By associating “near” and “far” colours with “near” and “far” distances, you establish a blending range, i.e. a gradient, which can be used to apply colour to a surface or even as a mask for populations, cloud coverage, and surface textures.

Settings:

  • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Distance 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.


  • Apply far colour: When checked, the colour value defined by the colour swatch to the right, is used at the Far distance. When unchecked, the shader's Main input is passed through.
    Apply far colour off and on.


  • Apply near colour: When checked, the colour value defined by the colour swatch to the right, is used at the Near distance. When unchecked, the shader’s Main input is passed through.
    Apply near colour off and on.


  • Far distance: This value represents the distance in meters from the camera assigned to the Camera setting below. At this distance the colour defined in the Apply far colour setting is at one hundred percent, and any blending between the Apply near and Apply far colour values will be complete. Distances beyond this value will take on the Apply far colour.
    Far distance values from 10,000 metres to 100,000 metres.


  • Near distance: This value represents the distance in meters from the camera assigned to the camera setting below. At this distance the colour defined in the Apply near colour setting begins to blend into the Apply far colour, effectively creating a gradient ramp between the two colours. When they are set to white and black, the shader can be used as a mask with varying degrees of softness or transition zones. Distance values less than this value take on the Apply near colour value.
    Near distance values from 0 metres to 25,000 metres.  Far distance value = 100,000 metres.
    By setting the Far and Near colours to white and black, the shader can be used as a mask.


  • Distance mode: This popup menu has two options to let you choose the manner in which the distance from the camera is determined.
    Distance mode options
    Distance (spherical): This option causes distances to be calculated in a sphere around the camera. Blending will be circular, radiating out from the camera’s position in all directions.
    Z depth (planar): This option causes distances to be calculated in the direction the camera is looking. Points behind the camera and up to the Near distance value take on the value of the Apply near colour. Points in between the Near and Far distance values smoothly transition from the Apply near and Apply far colours. Points farther away from the Far distance take on the Apply far colour value.
    Spherical distance modes radiate from around the camera’s position, while planar distance modes project out into the scene based on the camera’s rotation.


  • Camera: The Distance shader bases its calculations on the position and rotation values from the camera assigned to this setting. You can assign or create a new camera by clicking on the green plus button to the right of the setting. If no camera is assigned, the render camera is used.


  • Clamp far colour:> When checked, colour values for distances greater than the Far distance value will be clamped, or maxed-out, at the Far colour value. When unchecked, additional colour values can be extrapolated beyond the far distance.


  • Clamp near colour:> When checked, colour values for distances less than the Near distance value will be clamped to the Near colour value. When unchecked, additional colour values can be extrapolated below the near distance.


A sample refers to a value or set of values at a point in time and/or space. The defining point of a sample is that it is a chosen value out of a continuous signal. In Terragen 2 it is usually a mathematical (procedural) function that is being sampled.

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