Simple Shape Shader - Displacement Tab

From Planetside Software Wiki
Jump to: navigation, search
Simple Shape Shader - Displacement Tab

Description:
This is the Displacement tab of the Simple Shape Shader.

TG3 introduces some new displacement options, Displace relative to surface and Displace relative to shader position. They allow you to change the way the shader applies displacement. The two images below show the two different methods. The one on the left uses Displace relative to surface and the other one uses Displace relative to shader position. Those were the only parameters which changed between the two images.

Sss surface relative displacement.jpg

Sss shader relative displacement.jpg

Displace relative to surface
Displace relative to shader position

Displace relative to surface is how displacement was always applied in TG2. What happens is that the shader looks at the position of the surface underneath and then applies displacement to that. That means if the surface is lumpy that lumpiness flows through into the shape created by the shader. In this case the shader was making a pyramid and the pyramid shape has been distorted by the underlying terrain. It also integrates smoothly with the terrain around the edges.

Displace relative to shader position ignores the underlying surface and always displaces from the shader position. Currently this means that displacement is applied relative to the Y coordinate of the shader position. As you can see from the image on the right this means that the displaced shape is generated exactly by the shader and not distorted. In this case the shader Y position is 10. You can see there is a "wall" around the bottom of the shape. This accounts for the difference between the edge of the shader (at 10m) and the underlying terrain, which is lower than along 10m along the two edges we can see.


Settings:

  • Apply displacement: If this is checked the shader will generate displacement information.
  • Displace relative to surface (TG3): If this option is chosen the displacement gets applied relative to the underlying surface. This is how the shader works in TG2.
  • Displace relative to shader position (TG3): If this option is chosen the displacement gets applied to the shader position. Currently this means the shader Y position.
  • Displacement direction: Choose the direction for displacement.
  • Displacement amplitude: Set the amount of displacement.
  • Displacement offset: Set the starting offset of the displacement.
  • Displacement edge profile: This controls the profile which is applied to the edge of the shape. This creates a 3D edge profile, as you might expect from displacement. See above for examples of the different edge profiles. Note that the "Stroke" edge profile is not available for displacement.
  • Displacement edge width: This param lets you set the width of the edge area of the shape. To show the edge profile the Displacement edge profile popup needs to set to something other than "None".
  • Position key:


Back to: Simple Shape Shader

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.

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.