aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-16 08:29:45 +0100
committerGitHub <noreply@github.com>2018-05-16 08:29:45 +0100
commit027ead2de7fd66c0c969c08e0341219f03599253 (patch)
treecd46344b495f358d24ae10dc073cb0369296796c /render
parent5758498831875833f5b616140bfca3def763c696 (diff)
parent35e83800d4f66008bfd9dc58fb4c5b407dc78dd3 (diff)
Merge pull request #982 from RedSoxFan/fix-alpha
Fix alpha for src_rgba and src_rgbx
Diffstat (limited to 'render')
-rw-r--r--render/gles2/shaders.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/render/gles2/shaders.c b/render/gles2/shaders.c
index ba3bd971..b940ee53 100644
--- a/render/gles2/shaders.c
+++ b/render/gles2/shaders.c
@@ -63,7 +63,8 @@ const GLchar tex_fragment_src_rgba[] =
"uniform float alpha;\n"
"\n"
"void main() {\n"
-" gl_FragColor = alpha * texture2D(tex, v_texcoord);\n"
+" gl_FragColor.rgb = texture2D(tex, v_texcoord).rgb;\n"
+" gl_FragColor.a = alpha * texture2D(tex, v_texcoord).a;\n"
"}\n";
const GLchar tex_fragment_src_rgbx[] =
@@ -73,7 +74,7 @@ const GLchar tex_fragment_src_rgbx[] =
"uniform float alpha;\n"
"\n"
"void main() {\n"
-" gl_FragColor.rgb = alpha * texture2D(tex, v_texcoord).rgb;\n"
+" gl_FragColor.rgb = texture2D(tex, v_texcoord).rgb;\n"
" gl_FragColor.a = alpha;\n"
"}\n";