GLSL

BlendModes

Blend Modes provider. All discriptions from Substance Desinger - Blending modes description.

Members

number

# inner gln_BLENDMODES

Enum for gl-Noise Blend Modes.
Properties:
Name Type Description
gln_COPY number The Copy blending mode will just place the foreground on top of the background.
gln_ADD number The Add blending mode will add the foreground input value to each corresponding pixel in the background.
gln_SUBSTRACT number The Substract blending mode will substract the foreground input value from each corresponding pixel in the background.
gln_MULTIPLY number The Multiply blending mode will multiply the background input value by each corresponding pixel in the foreground.
gln_ADDSUB number The Add Sub blending mode works as following:
  • Foreground pixels with a value higher than 0.5 are added to their respective background pixels.
  • Foreground pixels with a value lower than 0.5 are substracted from their respective background pixels.
gln_LIGHTEN number The Lighten (Max) Blending mode will pick the higher value between the background and the foreground.
gln_DARKEN number The Darken (Min) Blending mode will pick the lower value between the background and the foreground.
gln_DIVIDE number The Divide blending mode will divide the background input pixels value by each corresponding pixel in the foreground.
gln_OVERLAY number The Overlay blending mode combines Multiply and Screen blend modes:
  • If the value of the lower layer pixel is below 0.5, then a Multiply type blending is applied.
  • If the value of the lower layer pixel is above 0.5, then a Screen type blending is applied.
gln_SCREEN number With Screen blend mode the values of the pixels in the two inputs are inverted, multiplied, and then inverted again.
The result is the opposite effect to multiply and is always equal or higher (brighter) compared to the original.
gln_SOFTLIGHT number The Soft Light blend mode creates a subtle lighter or darker result depending on the brightness of the foreground color.
Blend colors that are more than 50% brightness will lighten the background pixels and colors that are less than 50% brightness will darken the background pixels.

Methods

# inner gln_blend(f, b, type) → {vec4}

Blends a Color with another.
Parameters:
Name Type Description
f vec4 Foreground
b vec4 Background
type gln_BLENDMODES Blend mode
Mapped Value
vec4
Example
vec4 logo = texture2D(uLogo, uv);
vec4 rect = texture2D(uRect, uv);

vec4 final = gln_blend(logo, rect, gln_COPY);