Simple Shape Shader

From Terragen Documentation from Planetside Software
Revision as of 11:15, 31 July 2013 by Jo (talk | contribs)
Jump to: navigation, search
Simple Shape Shader

Node Type: Shader

Node Description and Purpose
The Simple shape shader is a node which makes it easy to create simple shapes such as circles/ellipses, squares/rectangles, triangles and regular polygons like pentagons and octagons. It can generate both colour and displacement. It can also apply different effects to the edges of the shape.

Currently the Simple shape shader is only applied in a straight-up-and-down Plan Y projection.

Edge profiles
These are the different profiles the shader can apply to the edges of shapes:

Simple shape shader edge profiles.png

Smooth step creates a smooth transition between the edge and the interior of the shape. Bevel creates a straight line or linear ramp and Radius makes a quarter circle shape. Stroke is not shown here. It creates a solid stroke or border around the inside of the shape. Stroke can only be used in colour mode.

Simple shape shader examples

These are project files showing some different ways of using the Simple shape shader. The projects are explained in greater detail in the Comments section of the project settings. To view this click the Project Settings button in the bottom left of the main window. You might need to right click and choose "Save as" (Windows) or option-click (Mac) on the project file links to download them directly and prevent them opening in your browser.

Population density

This project shows how to use a Simple shape shader to control the density of a population. This example combines two Simple shape shaders using a Merge shader to make a more complex shape.


Simple shape shader population density.jpg


This project is an example of using the Simple shape shader to create displacement on the terrain.


Simple shape shader displacement.jpg

Surface layer blending

This project shows how to use a Simple shape shader to control the blending of a surface layer.


Simple shape shader layer blending.jpg


  • Type of shape: This setting lets you choose the type of shape generated by the shader. You can choose from "Square/Rectangle", "Circle/Ellipse" or "Polygon". To create a triangle use a polygon with 3 sides.
  • Position: This sets the position of the centre of the shape.
  • Size: You can use this to set the width and height of the shape. N.B. an ellipse is a circle where the height is a different size to the width.
  • Rotation: This param sets the rotation of the shape around its centre. You can only rotate the array around the Y (upright) axis.
  • Polygon sides: This setting lets you control the number of sides when Type of shape is set to "Polygon".

Colour tab

  • Apply colour: If this is checked the shader will generate colour information.
  • Colour: This sets the colour for the shape.
  • Edge colour: The shader can apply a separate colour to the edge of the shape. To show the edge colour the Colour edge profile popup needs to set to something other than "None" and the Colour edge width needs to be more than 0.
  • Colour edge profile: This controls the edge profile or blending which is applied to the edge of the shape. See above for examples of the different edge profiles.
  • Colour edge width: This param lets you set the width of the edge area of the shape. To show the edge colour the Colour edge profile popup needs to set to something other than "None".
  • Position key:

Additional tabs for Simple Shape Shader[edit]

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.

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.