Difference between revisions of "Distribution Shader v4"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
Line 2: Line 2:
  
 
'''Node Description and Purpose:'''<br />
 
'''Node Description and Purpose:'''<br />
The Distribution shader is a very useful shader. You can use it to generate a mask that can be used to blend other shaders or do things like control where populations appear. It shares many of the same concepts as the [[Surface Layer]] when it comes to controlling where something appears based on altitude or slope, as well as having similar coverage and breakup settings.
+
The Distribution shader is a very useful shader. You could use it to apply colour to something while controlling where that colour appears. You can also use it to generate a mask that can be used to blend other shaders or do things like control where populations appear. It shares many of the same concepts as the [[Surface Layer]] when it comes to controlling where something appears based on altitude or slope, as well as having similar coverage and breakup settings. In many ways it's a basic version of a Surface Layer without things like displacement and luminosity.
  
 
Let's say you have a grass population. You don't want it to appear on slopes steeper than 45&deg;. You can do this using a Distribution shader as the input to the population's density shader. In the Distribution shader go to the '''Slope constraints''' tab, check the '''Limit maximum slope''' checkbox and enter 45 in the '''Maximum slope angle''' field. Repopulate the grass and you'll see that it's only appearing on parts of the terrain where the slope is 45&deg; or less.
 
Let's say you have a grass population. You don't want it to appear on slopes steeper than 45&deg;. You can do this using a Distribution shader as the input to the population's density shader. In the Distribution shader go to the '''Slope constraints''' tab, check the '''Limit maximum slope''' checkbox and enter 45 in the '''Maximum slope angle''' field. Repopulate the grass and you'll see that it's only appearing on parts of the terrain where the slope is 45&deg; or less.
 +
 +
The output of the shader will be referred to as a "mask" in the following documentation as this is the most common way of using the shader.
  
  
Line 11: Line 13:
  
 
'''Settings:'''<br />
 
'''Settings:'''<br />
 +
 +
* '''Colour:''' This sets the colour used to generate the mask. The mask will blend from this colour to black. Typically you would use white to generate a mask.
  
 
<u>Coverage, Breakup tab</u>
 
<u>Coverage, Breakup tab</u>

Revision as of 11:19, 13 March 2012

Distribution Shader v4

Node Description and Purpose:
The Distribution shader is a very useful shader. You could use it to apply colour to something while controlling where that colour appears. You can also use it to generate a mask that can be used to blend other shaders or do things like control where populations appear. It shares many of the same concepts as the Surface Layer when it comes to controlling where something appears based on altitude or slope, as well as having similar coverage and breakup settings. In many ways it's a basic version of a Surface Layer without things like displacement and luminosity.

Let's say you have a grass population. You don't want it to appear on slopes steeper than 45°. You can do this using a Distribution shader as the input to the population's density shader. In the Distribution shader go to the Slope constraints tab, check the Limit maximum slope checkbox and enter 45 in the Maximum slope angle field. Repopulate the grass and you'll see that it's only appearing on parts of the terrain where the slope is 45° or less.

The output of the shader will be referred to as a "mask" in the following documentation as this is the most common way of using the shader.


Node Type: Colour Shader


Settings:

  • Colour: This sets the colour used to generate the mask. The mask will blend from this colour to black. Typically you would use white to generate a mask.

Coverage, Breakup tab

  • Coverage: This setting controls the coverage of the mask generated by the shader. It's a little like changing the transparency of the overall mask.
  • Fractal breakup: If this is checked the mask is broken up using the fractal assigned in the field to the right. This introduces more of a sense of randomness and texture to the maks. The amount of fractal breakup is specified in the controls immediately below. Larger numbers mean greater breakup.

  • Invert breakup: If this is checked the fractal breakup pattern is inverted, i.e. light parts become dark and vice versa.

  • Blend by shader: You can check this and specify a shader using the field to the left to have even greater control over where the mask appears. By default the mask will cover the whole planet. However you could, for example, use an Image Map Shader to control where the mask appears using an image. You could use a Painted Shader to paint where you want the mask to appear. You could use a Simple Shape Shader to limit the mask to a hexagonal area. There are lots of different things you can do.

    Whiter parts of the shader show where the mask is more opaque. Shades of grey control the opacity or coverage of the layer. You can also control the RGB channels individually.

  • Invert breakup: If this is checked the blending shader is inverted, i.e. light parts become dark and vice versa.

  • Blend as coverage: If this is checked the blending shader is used to modify coverage rather than blending the mask as a whole. Blending as coverage allows for more sophisticated interaction with aspects of the shader such as fractal breakup. This can be a subtle effect though and is an advanced feature you would not typically need to use.


Additional tabs for Distribution Shader v4.01[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.