mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-15 06:53:59 +01:00
13 lines
251 B
GLSL
13 lines
251 B
GLSL
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.);
|
|
}
|