Sprite: Add special case shader for translucent effect

Translucent sprites (opacity < 255) are very common,
so using a custom shader instead of the full blown effect one
helps a lot, especially on mobile.
This commit is contained in:
Jonas Kulla 2014-12-23 17:52:32 +01:00
parent a53163660f
commit 3c0a530eba
6 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,11 @@
uniform sampler2D texture;
uniform lowp float alpha;
varying vec2 v_texCoord;
void main()
{
gl_FragColor = texture2D(texture, v_texCoord);
gl_FragColor.a *= alpha;
}