From 5a2796266f6f88464396a9cd255dd9d0dedba749 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 23 Jun 2017 14:25:55 -0400 Subject: Support wl_shm pixel formats in gles2 renderer --- render/gles2/shaders.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'render/gles2/shaders.c') diff --git a/render/gles2/shaders.c b/render/gles2/shaders.c index 62712230..f5e61dd6 100644 --- a/render/gles2/shaders.c +++ b/render/gles2/shaders.c @@ -20,7 +20,6 @@ const GLchar quad_vertex_src[] = " vec4(i0.z, i1.z, i2.z, i3.z)," " vec4(i0.w, i1.w, i2.w, i3.w)" " );" -"" " return outMatrix;" "}" "void main() {" @@ -37,8 +36,7 @@ const GLchar quad_fragment_src[] = " gl_FragColor = v_color;" "}"; -// Colored ellipses (TODO) - +// Colored ellipses const GLchar ellipse_fragment_src[] = "precision mediump float;" "varying vec4 v_color;" @@ -74,18 +72,21 @@ const GLchar vertex_src[] = " v_texcoord = texcoord;" "}"; -const GLchar fragment_src_RGB[] = +const GLchar fragment_src_rgba[] = "precision mediump float;" "varying vec2 v_texcoord;" "uniform sampler2D tex;" +"uniform float alpha;" "void main() {" -" gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0);" +" gl_FragColor = alpha * texture2D(tex, v_texcoord);" "}"; -const GLchar fragment_src_RGBA[] = +const GLchar fragment_src_rgbx[] = "precision mediump float;" "varying vec2 v_texcoord;" "uniform sampler2D tex;" +"uniform float alpha;" "void main() {" -" gl_FragColor = texture2D(tex, v_texcoord);" +" gl_FragColor.rgb = alpha * texture2D(tex, v_texcoord).rgb;" +" gl_FragColor.a = alpha;" "}"; -- cgit v1.2.3