Created
April 22, 2015 04:12
-
-
Save prespondek/93e2efa4b4e5cf2ec1de to your computer and use it in GitHub Desktop.
Cocos2DX Alpha Mask Fragment Shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_ES | |
varying mediump vec2 v_texture_coord; | |
varying mediump vec2 v_texture_coord1; | |
#else | |
varying vec2 v_texture_coord; | |
varying vec2 v_texture_coord1; | |
#endif | |
uniform sampler2D lightmap; | |
void main(void) | |
{ | |
vec4 texel = texture2D(CC_Texture0, v_texture_coord) * (texture2D(lightmap, v_texture_coord1) * 2.0); | |
if(texel.a < 0.5) | |
discard; | |
gl_FragColor = texel; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment