From 514c3110c1fc80ac91b874bedc4a63859aace9c4 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Wed, 12 Apr 2023 10:57:31 +0200 Subject: [PATCH] fix GL3 mix shaders --- data/ofxMsdfgen/shaders/mix/GL3/shader.frag | 9 ++++----- data/ofxMsdfgen/shaders/mix/GL3/shader.vert | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/data/ofxMsdfgen/shaders/mix/GL3/shader.frag b/data/ofxMsdfgen/shaders/mix/GL3/shader.frag index 519a4e9..ccad4e4 100644 --- a/data/ofxMsdfgen/shaders/mix/GL3/shader.frag +++ b/data/ofxMsdfgen/shaders/mix/GL3/shader.frag @@ -1,8 +1,8 @@ -#version 150 +#version 330 precision highp float; // these are our textures -uniform sampler2DRect msdf; +uniform sampler2D msdf; uniform vec4 fontColor; uniform vec2 unitRange; @@ -14,8 +14,6 @@ uniform vec2 scale_b; // this comes from the vertex shader in vec2 texCoordVarying; - -// this is the output of the fragment shader out vec4 outputColor; float median(float r, float g, float b) { @@ -23,7 +21,8 @@ float median(float r, float g, float b) { } float screenPxRange() { - //vec2 unitRange = vec2(pxRange)/vec2(textureSize(msdf)); + //ivec2 ts = textureSize(msdf, 0); + //vec2 unitRange = vec2(pxRange)/vec2(ts); vec2 screenTexSize = vec2(1.0)/fwidth(texCoordVarying); return max(0.5*dot(unitRange, screenTexSize), 1.0); } diff --git a/data/ofxMsdfgen/shaders/mix/GL3/shader.vert b/data/ofxMsdfgen/shaders/mix/GL3/shader.vert index 0e63995..4b2db52 100644 --- a/data/ofxMsdfgen/shaders/mix/GL3/shader.vert +++ b/data/ofxMsdfgen/shaders/mix/GL3/shader.vert @@ -1,4 +1,4 @@ -#version 150 +#version 330 // these come from the programmable pipeline uniform mat4 modelViewProjectionMatrix; @@ -6,11 +6,10 @@ uniform mat4 modelViewProjectionMatrix; in vec4 position; in vec2 texcoord; -// texture coordinates are sent to fragment shader out vec2 texCoordVarying; void main() { texCoordVarying = texcoord; gl_Position = modelViewProjectionMatrix * position; -} \ No newline at end of file +}