aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/shaders.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-29 16:00:24 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-29 16:00:24 -0400
commit8920b5d607c6b3b5d04894fc1837ac4f2d9558ae (patch)
tree3c79b4faff213544ed247e1c126fc89508bdd75d /render/gles2/shaders.c
parent97f6e9b69aecf1fbcbc2fa95cb2009f873c86d40 (diff)
parent486ec5953cf51f5fde834bf8fa7fbe56f0be9a0e (diff)
Merge branch 'wlcore'
Diffstat (limited to 'render/gles2/shaders.c')
-rw-r--r--render/gles2/shaders.c15
1 files changed, 8 insertions, 7 deletions
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;"
"}";