I am totally new at OpenGL (and Cocos2D for that matter) and I have a little problem with my game.
One of the sprite that the gfx guy gave me needs the equivalent of the Photoshop "screen" blending. I read on forums that you can have the equivalent in OpenGl by changing the parameters of glBlendFunc.
Now, if I change the blend values in ccMacros, this sprite is perfect, but of course others are totally off. So my question is, how do I set the blendFunc for just one sprite ?
Thanks.
__________________
Isometric Traffic Management Game with stunning artwork:
I am totally new at OpenGL (and Cocos2D for that matter) and I have a little problem with my game.
One of the sprite that the gfx guy gave me needs the equivalent of the Photoshop "screen" blending. I read on forums that you can have the equivalent in OpenGl by changing the parameters of glBlendFunc.
Now, if I change the blend values in ccMacros, this sprite is perfect, but of course others are totally off. So my question is, how do I set the blendFunc for just one sprite ?
Thanks.
I don't fully understand what you are saying, but that may be because by changing those values, you are changing the blend values for every sprite that is created in Cocos2D. Try to find a way to change the blend values when your sprite is drawn and restore them after it is displayed.
Or, you can use custom OpenGL code to draw your texture, by overriding the -draw method of the CocosNode class. Cocos2D will render everything that doesn't belong to the -draw function as it should.
I am totally new at OpenGL (and Cocos2D for that matter) and I have a little problem with my game.
One of the sprite that the gfx guy gave me needs the equivalent of the Photoshop "screen" blending. I read on forums that you can have the equivalent in OpenGl by changing the parameters of glBlendFunc.
Now, if I change the blend values in ccMacros, this sprite is perfect, but of course others are totally off. So my question is, how do I set the blendFunc for just one sprite ?
Thanks.
You need to group your sprites based on their blending properties.
This is generally handled by using a separate sprite atlas for different blending modes.
Well, I was asking if there was a "sanctionned" way to do it in Cocos2D. But as you said, I ended up hacking up the draw method. Not pretty.
I know, Cocos2D doesn't solve all problems. I mainly try to use it as a wrapper of my own OpenGL ES code. I mainly override the -draw functions. I use Cocos2D for background drawing or doing simple things like moving an actor.
You need to group your sprites based on their blending properties.
This is generally handled by using a separate sprite atlas for different blending modes.
You are speaking Chinese to me here.
__________________
Isometric Traffic Management Game with stunning artwork: