#version 150 in vec2 vertTexCoord; in vec4 vertColor; uniform sampler2D sdfTexture; uniform float threshold; uniform float smoothRange; out vec4 fragColor; void main() { float smoothMin = threshold - smoothRange * 0.5; float smoothMax = smoothMin + smoothRange; float sample = smoothstep(smoothMin, smoothMax, texture(sdfTexture, vertTexCoord).r); fragColor = vec4(min(1.0, sample)) * vertColor; }