diff --git a/data/ofxMsdfgen/shaders/mix/ES3/shader.frag b/data/ofxMsdfgen/shaders/mix/ES3/shader.frag index 7580689..46a83d6 100644 --- a/data/ofxMsdfgen/shaders/mix/ES3/shader.frag +++ b/data/ofxMsdfgen/shaders/mix/ES3/shader.frag @@ -4,6 +4,7 @@ precision highp float; // these are our textures uniform sampler2D msdf; +uniform float fade; uniform vec2 unitRange; uniform vec4 bgColor; @@ -32,7 +33,7 @@ float screenPxDistance(vec3 msdf_rgb, vec2 uv) { } float near = 1.0; -float far = 4600.0; +float far = 4400.0 + 400.0; float width = 1920.0; float height = 1080.0; float linearizeDepth(float depth) @@ -77,9 +78,10 @@ void main() )); // INFO: this needs to be adjusted if field of view is adjusted float d = smoothstep(0.2, 0.8, z + 0.2 * (screenPos.x + screenPos.y)); + d = min(d, fade); outputColor = vec4(mix(fgColor.rgb, backgroundColor.rgb, d),1.0); //outputColor = vec4(opacity, 1.0-opacity, 0.0, 1.0); - //outputColor = vec4(1.0-msdf_rgb.rgb, 1.0); + //outputColor = vec4(1.0-msdf_rgb_a.rgb, 1.0); //outputColor = vec4(1.0,0.0,1.0,1.0); }