cocos2d GL_SUBTRUCT problem when using CCRenderTexture
My game needs to implement night vision effect. I'm using a CCRenderTexture as a mask, and I plan to draw the visible areas onto the开发者_高级运维 mask by using [rangeSprite visit];
However, it need GL_SUBTRUCT mode. I searched cocos2d's codes, but found nowhere the macro is used. Does it mean cocos2d do not support this?
Have you solved this? I have the same problem, and am approaching it currently by using a blendmode
like this:
[light setBlendFunc:ccBlendFuncMake(GL_DST_ALPHA, GL_ZERO)];
...whereas light
is a sprite I paint onto my CCRenderTexture
, which gets laid over the screen.
精彩评论