cocos2d fragment shader transparency

Posted by fiddler on Game Development See other posts from Game Development or by fiddler
Published on 2012-11-07T09:02:00Z Indexed on 2012/11/07 11:21 UTC
Read the original article Hit count: 495

I'm playing with custom fragment shaders for a CCSprite (see http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0).

But I can't figure out why I get a white color whith the following line:

gl_FragColor = vec4(1.0,1.0,1.0,0.0);

Whereas I have a transparent color with this:

gl_FragColor = vec4(0.0,0.0,0.0,0.0);

Shouln't I have a transparent sprite in both cases ? (alpha channel is null, right ?)

© Game Development or respective owner

Related posts about cocos2d

Related posts about transparency