#version 330

smooth in vec2 v_uv;

out vec4 result;

uniform sampler2D source;

void main()
{
  float alpha = texture(source, v_uv).r;

  result.rgb = mix(vec3(0.2, 0.6, 0.2), vec3(0), smoothstep(0.5, 1.0, alpha));
  result.a = 4.0 * alpha * (1.0 - alpha);
}
