Code: Select all
vec4 effect(vec4 vcolor, Image tex, vec2 texcoord, vec2 pixel_coords)
{
// Sample the texture at the given texture coordinates.
vec4 input0 = Texel(tex, texcoord);
// Invert the RGB channels by subtracting them from 1.
vec3 invertedColor = 1.0 - input0.rgb;
// Output the final color with original alpha value.
return vec4(invertedColor, 1.0);
}