Basic Shader Processes

From Tombstone Engine Wiki
Jump to: navigation, search

This is a list of the basic shader processes that are available in the Shader Editor under the Basic tab.

Process

Description

Constant Scalar

Shader constantscalar.png

Inputs: None

Output: Scalar

Outputs a constant scalar value that is specified in the settings for the process.

A parameter slot may be specified in the process settings. If the parameter slot is set to “Constant” (the default), then the output of this process can never be changed while rendering. However, if one of the eight numbered parameter slots is selected, then it is possible to change the value output by this process without actually modifying the shader. For instance, the Set Shader Parameter script method can be used to change the output value of this process, effectively making it a variable parameter of the shader.

Constant Vector

Shader constantvector.png

Inputs: None

Output: 4D vector

Outputs a constant vector value that is specified in the settings for the process.

See the note about parameter slots under the Constant Scalar process.

Constant Color

Shader constantcolor.png

Inputs: None

Output: RGBA color

Outputs a constant color value that is specified in the settings for the process.

See the note about parameter slots under the Constant Scalar process.

Shader Time

Shader time.png

Inputs: None

Output: Scalar

Outputs a scalar value in the range [0,1) representing the current shader time. The shader time runs from 0 to 1 over a period of 120 seconds and then repeats by wrapping back to 0.

Shader Detail Parameter

Shader detail.png

Inputs: None

Output: Scalar

Outputs a scalar value in the range [0,1] representing the shader detail parameter. This value moves from 1.0 to 0.0 as the switch from the high-detail shader to the low-detail shader approaches. It is always 0.0 in the low-detail shader. The shader detail parameter can be used to smoothly fade out certain components of a shader before the switch to low detail occurs.

Fragment Depth

Shader fragmentdepth.png

Inputs: None

Output: Scalar

Outputs a scalar value equal to the depth of the fragment in camera space.

Primitive Facing

Shader primitivefacing.png

Inputs: None

Output: Scalar

Outputs a scalar value that is +1.0 for front-facing primitives and −1.0 for back-facing primitives.

Merge 2D

Shader merge2d.png

Inputs: Scalar x (required), Scalar y (required)

Output: 2D vector

Combines the two scalar inputs x and y into a single 2D vector output.

Merge 3D

Shader merge3d.png

Inputs: Scalar x (required), Scalar y (required), Scalar z (required)

Output: 3D vector

Combines the three scalar inputs x, y, and z into a single 3D vector output.

Merge 4D

Shader merge4d.png

Inputs: Scalar x (required), Scalar y (required), Scalar z (required), Scalar w (required)

Output: 4D vector

Combines the four scalar inputs x, y, z, and w into a single 4D vector output.

Texture Map

Shader texturemap.png

Inputs: 2D or 3D vector TEXC (required)

Output: RGBA color

Samples a texture map using the input texture coordinates TEXC. The texture map is specified in the settings for the process.

The size of the input TEXC is determined by the type of the texture map. The input is a 2D vector for 2D and Rect textures, and the size is a 3D vector for 3D, Cube, and Array 2D textures.

Note that this process should not be used for normal maps. Use the Normal Map process instead.

Normal Map

Shader normalmap.png

Inputs: 2D vector TEXC (required)

Output: 3D vector

Samples a normal map using the input texture coordinates TEXC. The normal map is specified in the settings for the process.

Paint Texture

Shader painttexture.png

Inputs: 2D vector TEXC (required)

Output: RGBA color

Samples a paint space texture map using the input texture coordinates TEXC. The texture map is determined by what paint space is associated with the geometry being rendered. The input vector is normally the output of the Paint Texcoord interpolant process.

Terrain Texture

Shader terraintexture.png

Inputs: None

Output: RGBA color

Samples a terrain texture palette. The texture map is specified in the settings for the process.

Note that this process should not be used for terrain normal maps. Use the Terrain Normal process instead.

Terrain Normal 1, 2, 3

Shader terrainnormal1.png

Inputs: None

Output: 3D vector

Samples a terrain normal palette. The normal map is specified in the settings for the process.

If one of these three processes exists, then all three should exist and should use the same normal map. Their outputs should be sent to a Terrain Diffuse Reflection and/or Terrain Specular Reflection process.

Impostor Texture

Shader impostortexture.png

Inputs: None

Output: RGBA color

Samples an impostor texture map. The texture map is specified in the settings for the process.

Note that this process should not be used for impostor normal maps. Use the Impostor Normal process instead.

Impostor Normal

Shader impostornormal.png

Inputs: None

Output: 3D vector

Samples an impostor normal map. The normal map is specified in the settings for the process.

See Also