2022-01-13 05:24:03 +01:00
|
|
|
//
|
|
|
|
// Simple passthrough fragment shader
|
|
|
|
//
|
|
|
|
varying vec2 v_vTexcoord;
|
|
|
|
varying vec4 v_vColour;
|
|
|
|
|
|
|
|
uniform float size;
|
|
|
|
uniform float tolerance;
|
|
|
|
|
2023-01-01 02:06:02 +01:00
|
|
|
uniform int useMask;
|
|
|
|
uniform sampler2D mask;
|
|
|
|
|
2022-01-13 05:24:03 +01:00
|
|
|
void main() {
|
2023-01-01 02:06:02 +01:00
|
|
|
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
2022-01-13 05:24:03 +01:00
|
|
|
float bright = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
|
|
|
|
if(bright > tolerance)
|
|
|
|
gl_FragColor = col;
|
|
|
|
else
|
|
|
|
gl_FragColor = vec4(vec3(0.), 1.);
|
2023-01-01 02:06:02 +01:00
|
|
|
|
|
|
|
if(useMask == 1)
|
|
|
|
gl_FragColor = col * texture2D( mask, v_vTexcoord );
|
2022-01-13 05:24:03 +01:00
|
|
|
}
|