diff --git a/data/ofxMsdfgen/shaders/unitRange/ES3/shader.frag b/data/ofxMsdfgen/shaders/unitRange/ES3/shader.frag index fe58357..068261a 100644 --- a/data/ofxMsdfgen/shaders/unitRange/ES3/shader.frag +++ b/data/ofxMsdfgen/shaders/unitRange/ES3/shader.frag @@ -5,7 +5,7 @@ precision highp float; uniform sampler2D msdf; uniform vec4 fontColor; -uniform float unitRange; +uniform vec2 unitRange; // this comes from the vertex shader in vec2 texCoordVarying; @@ -31,5 +31,7 @@ void main() float sd = median(msdf_rgb.r, msdf_rgb.g, msdf_rgb.b); float screenPxDistance = screenPxRange()*(sd - 0.5); float opacity = clamp(screenPxDistance + 0.5, 0.0, 1.0); + outputColor = mix(bgColor, fgColor, opacity); + //outputColor = vec4(opacity, 1.0-opacity, 0.0, 1.0); } diff --git a/data/ofxMsdfgen/shaders/unitRange/GL3/shader.frag b/data/ofxMsdfgen/shaders/unitRange/GL3/shader.frag index e4032fd..fb9188d 100644 --- a/data/ofxMsdfgen/shaders/unitRange/GL3/shader.frag +++ b/data/ofxMsdfgen/shaders/unitRange/GL3/shader.frag @@ -5,7 +5,7 @@ precision highp float; uniform sampler2DRect msdf; uniform vec4 fontColor; -uniform float unitRange; +uniform vec2 unitRange; // this comes from the vertex shader in vec2 texCoordVarying;