fix GL3 mix shaders

This commit is contained in:
jrkb 2023-04-12 10:57:31 +02:00
parent f000eb7d31
commit 514c3110c1
2 changed files with 6 additions and 8 deletions

View file

@ -1,8 +1,8 @@
#version 150 #version 330
precision highp float; precision highp float;
// these are our textures // these are our textures
uniform sampler2DRect msdf; uniform sampler2D msdf;
uniform vec4 fontColor; uniform vec4 fontColor;
uniform vec2 unitRange; uniform vec2 unitRange;
@ -14,8 +14,6 @@ uniform vec2 scale_b;
// this comes from the vertex shader // this comes from the vertex shader
in vec2 texCoordVarying; in vec2 texCoordVarying;
// this is the output of the fragment shader
out vec4 outputColor; out vec4 outputColor;
float median(float r, float g, float b) { float median(float r, float g, float b) {
@ -23,7 +21,8 @@ float median(float r, float g, float b) {
} }
float screenPxRange() { 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); vec2 screenTexSize = vec2(1.0)/fwidth(texCoordVarying);
return max(0.5*dot(unitRange, screenTexSize), 1.0); return max(0.5*dot(unitRange, screenTexSize), 1.0);
} }

View file

@ -1,4 +1,4 @@
#version 150 #version 330
// these come from the programmable pipeline // these come from the programmable pipeline
uniform mat4 modelViewProjectionMatrix; uniform mat4 modelViewProjectionMatrix;
@ -6,7 +6,6 @@ uniform mat4 modelViewProjectionMatrix;
in vec4 position; in vec4 position;
in vec2 texcoord; in vec2 texcoord;
// texture coordinates are sent to fragment shader
out vec2 texCoordVarying; out vec2 texCoordVarying;
void main() void main()