Math category - Stingray Shader Node Reference

Math category

Description

The nodes in this category perform common mathematical operations on their input values.

Nodes

Inputs

auto

A

The number or set of numbers that will be operated on.

Outputs

Out

auto

The absolute value of the input channels.

If the input value has multiple channels, each channel is treated separately.

Node definition in file: core/shader_nodes/abs.shader_node

Inputs

auto

A

The first input value.

auto

B

The second input value.

Outputs

Out

auto

The sum of the input channels.

Node definition in file: core/shader_nodes/add.shader_node

Inputs

auto

A

The number or set of numbers that will be operated on.

Outputs

Out

auto

The input channels, rounded up.

If the input value has multiple channels, each channel is treated separately. See also Math > Floor.

Node definition in file: core/shader_nodes/ceil.shader_node

Inputs

auto

Value

The number or set of numbers that will be clamped.

auto

Max

The maximum permitted output value for each channel.

auto

Min

The minimum permitted output value for each channel.

Outputs

Out

auto

The result of clamping each input channel to the minimum and maximum.

If the value is less than the minimum, it will be raised to the minimum value. If the value is between the minimum and maximum, it will be unchanged. If the value is greater than the maximum, it will be lowered to the maximum value. If the input value has multiple channels, each channel is treated separately.

Node definition in file: core/shader_nodes/clamp.shader_node

Inputs

auto

Angle

The angle or set of angles that will be operated on.

Outputs

Out

auto

The cosine of the input channels.

If the input value has multiple channels, each channel is treated separately.

Node definition in file: core/shader_nodes/cos.shader_node

Inputs

vector3

A

The first input vector.

vector3

B

The second input vector.

Outputs

Out

auto

The cross product.

Node definition in file: core/shader_nodes/cross.shader_node

Inputs

auto

A

The input value that will be operated on.

Outputs

Out

auto

The output value or values produced by this node.

You may be able to use this information to perform custom filtering or anti-aliasing.

Node definition in file: core/shader_nodes/ddx.shader_node

Inputs

auto

A

The input value that will be operated on.

Outputs

Out

auto

The output value or values produced by this node.

You may be able to use this information to perform custom filtering or anti-aliasing.

Node definition in file: core/shader_nodes/ddy.shader_node

Inputs

vector2, vector3, vector4

A

The first input vector.

vector2, vector3, vector4

B

The second input vector.

Outputs

Out

scalar

The distance from A to B.

Node definition in file: core/shader_nodes/distance.shader_node

Inputs

vector2

Pixel Position

The absolute screen-space pixel position

Outputs

Out

scalar

a dither value

Node definition in file: core/shader_nodes/dither.shader_node

Inputs

auto

A

The dividend.

auto

B

The divisor.

Outputs

Out

auto

The quotient, i.e. the result of dividing each channel in A by the corresponding channel in B.

Node definition in file: core/shader_nodes/div.shader_node

Inputs

vector3

A

The first input vector.

vector3

B

The second input vector.

Outputs

Out

scalar

The dot product.

Node definition in file: core/shader_nodes/dot.shader_node

Inputs

auto

A

The number or set of numbers that will be operated on.

Outputs

Out

auto

The input channels, rounded down.

If the input value has multiple channels, each channel is treated separately. See also Math > Ceil.

Node definition in file: core/shader_nodes/floor.shader_node

Inputs

auto

A

The dividend.

auto

B

The divisor.

Outputs

Out

auto

The remainder after dividing each channel in input A by the corresponding channel in input B.

Node definition in file: core/shader_nodes/fmod.shader_node

Inputs

auto

A

The number or set of numbers that will be operated on.

Outputs

Out

auto

The decimal fraction of each channel in the input value.

If the input value has multiple channels, each channel is treated separately.

Node definition in file: core/shader_nodes/frac.shader_node

Inputs

auto

A

The first number or set of numbers, which will be compared against B.

auto

B

The second number or set of numbers, which will be compared against A.

auto

True

The input value that this node will return if the comparison evaluates to true.

auto

False

The input value that this node will return if the comparison evaluates to false.

Outputs

Out

auto

Either the True input or the False input, depending on the result of the comparison.

Options
Operator

Selects the operator that will be used when comparing A to B.

NOTE: To set the options listed above, select this node in the shader graph and open the Property Editor panel in the Stingray Editor.

Node definition in file: core/shader_nodes/if.shader_node

Inputs

auto

A

The input color that will be inverted.

Outputs

Out

auto

The inverse of each channel in the input value.

If the input value contains multiple channels, each will be treated separately.

Node definition in file: core/shader_nodes/invert.shader_node

Inputs

vector2, vector3, vector4

Vector

The input vector.

Outputs

Out

scalar

The length of the input vector.

Node definition in file: core/shader_nodes/length.shader_node

Inputs

auto

A

The first input value.

auto

B

The second input value.

auto

Weight

A value that determines how the two input values should be combined in order to produce the result. Values closer to 0 make the result closer to input A; values closer to 1 make the result closer to input B.

Outputs

Out

auto

The output value or values produced by this node.

See also Math > Smoothstep for cubic interpolation.

Node definition in file: core/shader_nodes/lerp.shader_node

Inputs

auto

A

The first input value.

auto

Max

The second input value.

Outputs

Out

auto

The larger of each channel in A and B.

If the input values contain multiple channels, each will be treated separately.

Node definition in file: core/shader_nodes/max.shader_node

Inputs

auto

A

The first input value.

auto

Min

The second input value.

Outputs

Out

auto

The lesser of each channel in A and B.

If the input values contain multiple channels, each will be treated separately.

Node definition in file: core/shader_nodes/min.shader_node

Inputs

auto

A

The multiplicand.

auto

B

The multiplier.

Outputs

Out

auto

The product, i.e. the result of multiplying each channel in A by the corresponding channel in B.

Node definition in file: core/shader_nodes/mul.shader_node

Inputs

vector2, vector3, vector4

Vector

The input vector that will be normalized.

Outputs

Out

auto

The normalized input vector.

Node definition in file: core/shader_nodes/normalize.shader_node

Inputs

auto

Value

The input value.

auto

Power

The exponent value.

Outputs

Out

auto

The output value or values produced by this node.

If the input value contains multiple channels, each will be treated separately.

Node definition in file: core/shader_nodes/power.shader_node

Inputs

vector2, vector3, vector4

Vector

The direction of the input ray.

vector2, vector3, vector4

Normal

The normal of the surface being hit by the ray.

Outputs

Out

auto

The direction taken by the ray after reflecting from the surface.

Node definition in file: core/shader_nodes/reflect.shader_node

Inputs

vector2, vector3, vector4

In Vector

The direction of the input ray.

vector2, vector3, vector4

Normal

The normal of the surface being hit by the ray.

scalar

Index

The index of refraction of the surface being hit. This controls the strength of the refraction, or the deviation from the straight-line path through the surface.

Outputs

Out

auto

The direction taken by the ray after refracting into the surface.

Node definition in file: core/shader_nodes/refract.shader_node

Inputs

auto

Angle

The angle or set of angles that will be operated on.

Outputs

Out

auto

The sine of the input channels.

If the input value has multiple channels, each channel is treated separately.

Node definition in file: core/shader_nodes/sin.shader_node

Inputs

auto

Max

The first input value.

auto

Min

The second input value.

auto

X

A value that determines how the two input values should be combined in order to produce the result. Values closer to 0 make the result closer to input A; values closer to 1 make the result closer to input B.

Outputs

Out

auto

The output value or values produced by this node.

See also Math > Linear Interpolate.

Node definition in file: core/shader_nodes/smoothstep.shader_node

Inputs

auto

A

The input value.

Outputs

Out

auto

The square root of each channel in the input value.

If the input value contains multiple channels, each will be treated separately.

Node definition in file: core/shader_nodes/square_root.shader_node

Inputs

auto

A

The first input value.

auto

B

The second input value.

Outputs

Out

auto

The result of subtracting each channel in B from the corresponding channel in A.

Node definition in file: core/shader_nodes/subtract.shader_node