Pixel-Composer/shaders/sh_invert/sh_invert.fsh

12 lines
241 B
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
2024-07-11 09:23:34 +02:00
uniform int alpha;
2022-01-13 05:24:03 +01:00
void main() {
vec4 c = texture2D( gm_BaseTexture, v_vTexcoord );
2024-07-11 09:23:34 +02:00
if(alpha == 0) gl_FragColor = vec4(1. - c.rgb, c.a);
else if(alpha == 1) gl_FragColor = 1. - c;
2022-01-13 05:24:03 +01:00
}