Skip to content

Channel Math

Brief Description

Apply a simple GLSL shader expression on each pixels. The expression is evaluated on the GPU. If the Channels Processing Style is set to Vec4, the resulting vec4 "color" variable must be assigned, otherwise the "r", "g", "b", "a" float variables must be assigned, respectively for the red, green, blue and alpha channels. Note that these variables already contain the source pixel intensities, thus if the expression is empty this acts as a pass-through. The auxiliary source is available in the "color1" variable (in vec4 mode) or "r1", "g1", "b1", "a1" in single-channel mode.

User parameters are made available as GLSL uniforms in the expression. The name of the variable is the same as the script-name given to the parameter in its settings.

Note that the Shadertoy modifier provides more features to write more complex shaders: It provides support for more auxiliary sources, support for pre-processor variables and pre-defined variables compatibly with Shadertoy.

Controls

Parameter / Script Name Type Default Function
Enabled / enabled Boolean On
Red / process_red Boolean On Enable the red channel in output. Otherwise if there's a source the content of the main source is returned instead, else 0
Green / process_green Boolean On Enable the green channel in output. Otherwise if there's a source the content of the main source is returned instead, else 0
Blue / process_blue Boolean On Enable the blue channel in output. Otherwise if there's a source the content of the main source is returned instead, else 0
Alpha / process_alpha Boolean On Enable the alpha channel in output. Otherwise if there's a source the content of the main source is returned instead, else 0
Channels Processing Style / processingStyle Choice Separated Channels
- Vec4: The resulting vec4 "color" variable must be assigned. The auxliary source 1 is available with "color1"
- Separated Channels: Each channel is separated to their own respective "r", "g", "b" and "a" variables which must be assigned. The auxiliary source 1 is available with "r1", "g1", "b1", "a1"
R / expr_r
G / expr_g
B / expr_b
A / expr_a
Auxiliary Source 1 / aux_image_1 Image - The auxiliary source, available with "color1" (Vec4) or "r1", "g1", "b1", "a1" (Separated Channels)
Uniform Parameters / userParams -