mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 14:33:53 +01:00
13 lines
251 B
Plaintext
13 lines
251 B
Plaintext
|
varying vec2 v_vTexcoord;
|
||
|
varying vec4 v_vColour;
|
||
|
|
||
|
uniform int invert;
|
||
|
|
||
|
void main() {
|
||
|
vec4 c = texture2D( gm_BaseTexture, v_vTexcoord );
|
||
|
float m = (c.r + c.g + c.b) / 3. * c.a;
|
||
|
if(invert == 1) m = 1. - m;
|
||
|
|
||
|
gl_FragColor = vec4(m, m, m, 1.);
|
||
|
}
|