X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=sdr%2Fglow_font.p.glsl;fp=sdr%2Fglow_font.p.glsl;h=7c55fd1969bd97183bb9adf8162463ebe139c8c4;hp=0000000000000000000000000000000000000000;hb=47fdbdc2feec8d097d296fe019fbeb653c0b0efc;hpb=1c2b18e725db9e066d5dcb11123fc2019aec2ee7 diff --git a/sdr/glow_font.p.glsl b/sdr/glow_font.p.glsl new file mode 100644 index 0000000..7c55fd1 --- /dev/null +++ b/sdr/glow_font.p.glsl @@ -0,0 +1,19 @@ +uniform sampler2D tex; +uniform float smoothness; +uniform float height; +uniform vec2 pix_sz; + +varying vec2 local_pt; + +void main() +{ + const vec3 color = vec3(0.2, 0.4, 1.0); + + vec2 uv = gl_TexCoord[0].st; + float dist = texture2D(tex, uv).a; + + float glyph = smoothstep(0.5 - smoothness, 0.5 + smoothness, dist); + + gl_FragColor.rgb = color * ((dist - 0.5 - smoothness) * 45.0); + gl_FragColor.a = glyph; +}