From 33b400c5d78347150c9f1191df0c15b253f3d48e Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sun, 19 Mar 2023 11:55:58 +0100 Subject: [PATCH] unitRange vec2 --- data/ofxMsdfgen/shaders/unitRange/ES3/shader.frag | 4 +++- data/ofxMsdfgen/shaders/unitRange/GL3/shader.frag | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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;