Contour Shader

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


Node Description and Purpose:
The Contour shader can be used to create contour lines on a surface according to altitude. This is similar to the contour lines you may have seen on maps.

One thing to note is that the Contour shader generates bands of colour based on altitude rather than creating actual lines as such. This means that on parts of the surface which aren't very sloped the contours will be wider and on steeper parts they'll be thinner.

The shader can create both main contours and intermediate contours. Intermediate contours are equally spaced between main contours. It is quite common for main contours, those at 100m intervals for example, to be coloured differently or be thicker than the intermediate contours.

The Contour shader is set up to generate a main contour in one colour and intermediate contours in another colour. If you want to give the appearance of the just one type of contour there are a couple of ways you could do it. The easiest is to set Number of intermediates to 0. Another way would be to set the Thickness and Colour params in the Intermediate Contours settings so they match those in the Main Contour settings.

The Contour shader is not limited to creating map-like contours on terrains. It can also be used to give interesting effects on other sorts of surfaces.


Node Type: Colour Shader


Contour shader examples

This project is an example of using the Contour shader as a surface layer. You might need to right click and choose "Save as" (Windows) or option-click (Mac) on the project file link to download it directly and prevent it opening in your browser.

Media:Contour_shader_example.tgd

Contour shader example.jpg


Settings:

Main Contour

  • Spacing: This sets the altitude difference between main contour lines.
  • Thickness: This sets the thickness of main contour lines.

  • Colour: Sets the colour of the main contours.

Intermediate Contours

  • Number of intermediate contours: This sets the number of intermediate contours. When you change this setting the Spacing setting below is updated with an appropriate value based on the main contour spacing and the number of intermediates.
  • Spacing: This sets the spacing between intermediate contours. If you change this setting the Number of intermediates setting above is updated with an appropriate value based on the main contour spacing and the intermediate contour spacing.

  • Thickness: This sets the thickness of intermediate contour lines.

  • Colour: Sets the colour of the intermediate contours.


  • Smooth edges: If this is checked the edges of the contour lines are smoothed. This mainly helps to prevent aliasing or jaggies, but you can also use it to give a blurred effect to the edges of contours.
  • Smoothing distance: This is sets the distance that gets smoothed along edges of the contour lines.


  • Base altitude: The Contour shader applies its effect across the entire altitude range of a surface. You can use this setting to offset the effect up or down.
  • Use Y for altitude: TBC

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.