0
votes

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?

1

1 Answers

0
votes

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.