This page is currently available only in English


General Color Math Shaders

Table Of Contents


Introduction

Redshift supports a sub-set of math shaders that can also operate on RGBA color components. These simple shaders are all listed here.


Color addition, multiplication or subtraction can also be found in the more comprehensive Color Composite and Color Layer shaders.


Color Abs


Returns the absolute value of Input. For example, a value of -1.0 will be returned as 1.0.


Color Bias

Returns a curved bias of Input by Bias, using the following Ken Perlin formula: pow(Input, log(Bias)/log(0.5))


Color Change Range

Returns Input remapped from Old Range values to New Range values, with an optional clamp to the new range.


Color Exp

Returns the exponential of Input, using the following formula: e^Input.


Color Gain


Returns a contrast gain of Input by Gain, using the following Ken Perlin formula:

Bias( 2 * Input, 1 - Gain ) * 0.5 ;                  if Input < 0.5

1 - Bias( 2 - 2 * Input, 1 - Gain ) * 0.5 ;       otherwise


Color Invert

Returns 1 - Input.


Color Mix

Returns Input 1 linearly interpolated to Input 2 by Mix. When Mix is 0.0, Input 1 will be returned. When Mix is 1.0, Input 2 will be returned.


Color Saturate


Returns Input clamped to values between 0 and 1, inclusively. For example -1.5 will be returned as 0.0 and 1.5 will be returned as 1.0.


Color Splitter

Returns each component of the Input color separately, like so:

outR = Input.r

outG = Input.g

outB = Input.b

outA = Input.a


Color Sub


Returns Input 1 - Input 2.