1
0
Fork 0
forked from wry/wry

wayland: implement alpha_modifier_v1

This commit is contained in:
Julian Orth 2024-03-18 19:18:30 +01:00
parent 131f0481e8
commit ff54a8ab96
37 changed files with 655 additions and 89 deletions

View file

@ -1,7 +0,0 @@
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
void main() {
gl_FragColor = texture2D(tex, v_texcoord);
}

View file

@ -1,9 +0,0 @@
#extension GL_OES_EGL_image_external : require
precision mediump float;
varying vec2 v_texcoord;
uniform samplerExternalOES tex;
void main() {
gl_FragColor = texture2D(tex, v_texcoord);
}

View file

@ -1,9 +0,0 @@
#extension GL_OES_EGL_image_external : require
precision mediump float;
varying vec2 v_texcoord;
uniform samplerExternalOES tex;
void main() {
gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0);
}

View file

@ -1,7 +1,34 @@
#ifdef EXTERNAL
#extension GL_OES_EGL_image_external : require
#endif
precision mediump float;
varying vec2 v_texcoord;
#ifdef EXTERNAL
uniform samplerExternalOES tex;
#else
uniform sampler2D tex;
#endif
#ifdef ALPHA_MULTIPLIER
uniform float alpha;
#endif
void main() {
#ifdef ALPHA
#ifdef ALPHA_MULTIPLIER
gl_FragColor = texture2D(tex, v_texcoord) * alpha;
#else // !ALPHA_MULTIPLIER
gl_FragColor = texture2D(tex, v_texcoord);
#endif // ALPHA_MULTIPLIER
#else // !ALPHA
#ifdef ALPHA_MULTIPLIER
gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb * alpha, alpha);
#else // !ALPHA_MULTIPLIER
gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0);
#endif // ALPHA_MULTIPLIER
#endif // ALPHA
}