Refactor shaders to use GLES3 syntax

Signed-off-by: renderexpert <expert@renderconsulting.co.uk>
This commit is contained in:
renderexpert
2025-01-21 14:39:31 +00:00
committed by Konstantin Pastbin
parent b23c2ba3e3
commit 897d7a253d
84 changed files with 471 additions and 543 deletions

View File

@@ -1,6 +1,6 @@
varying vec2 v_colorTexCoord;
varying vec2 v_maskTexCoord;
//varying vec2 v_halfLength;
in vec2 v_colorTexCoord;
in vec2 v_maskTexCoord;
//in vec2 v_halfLength;
uniform sampler2D u_colorTex;
uniform sampler2D u_maskTex;
@@ -8,14 +8,12 @@ uniform float u_opacity;
//const float aaPixelsCount = 2.5;
out vec4 v_FragColor;
void main()
{
vec4 color = texture2D(u_colorTex, v_colorTexCoord);
#ifdef GLES3
float mask = texture2D(u_maskTex, v_maskTexCoord).r;
#else
float mask = texture2D(u_maskTex, v_maskTexCoord).a;
#endif
vec4 color = texture(u_colorTex, v_colorTexCoord);
float mask = texture(u_maskTex, v_maskTexCoord).r;
color.a = color.a * mask * u_opacity;
// Disabled too agressive AA-like blurring of edges,
@@ -24,5 +22,5 @@ void main()
//float diff = v_halfLength.y - currentW;
//color.a *= mix(0.3, 1.0, clamp(diff / aaPixelsCount, 0.0, 1.0));
gl_FragColor = color;
v_FragColor = color;
}