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;
// 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);
}

View file

@ -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;
}
}