Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 ?)

share|improve this question
Do you have blending enabled when drawing with your shader? – r2d2rigo Nov 7 '12 at 9:18
1  
Just the default blending mode (GL_ONE, GL_SRC_MINUS_ALPHA) I guess – fiddler Nov 7 '12 at 9:42

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.