#version 330 core

in vec2 UV;
out vec4 fragColor;

uniform vec2 iResolution;
uniform sampler2D sourcetex;
uniform float threshold;

void main() {
    vec4 src = texture(sourcetex, UV);
    fragColor = (length(src.rgb) > threshold)
              ? src
              : vec4(vec3(0.0), 1.0);
}
