krzysztofzablocki / LineDrawing

Beatiful and fast smooth line drawing algorithm for iOS - as seen in Foldify.
http://twitter.com/merowing_
Other
1.29k stars 213 forks source link

Updating to Cocos2d 2.1 #19

Closed mbustamanteo closed 11 years ago

mbustamanteo commented 11 years ago

I've updated Cocos2d to 2.1 version. This update breaks a lot of projects because they changed the ivars naming.

In commit 15713b01cc88ddf35b2db88dd659bbdc200e5d9c are the important changes to the project. With 2.1, calling glBlendFuncSeparate makes the background turn black, sometimes blinks before turning completely black. Removing that line seems to solve the issue. I do not have the knowledge to explain why.

Here is a snapshot showing the project with the glBlendFuncSeparate function call. captura de pantalla 2013-10-01 a la s 2 52 30

krzysztofzablocki commented 11 years ago

Blending should just be normal additive really, I never have time to update this. You reckon you could set it for normal additive blending?

mbustamanteo commented 11 years ago

I'm really sorry but i have little knowledge about OpenGL. I googled additive blending and it seems that this is what you are referring to

glBlend(GL_ONE, GL_ONE)

That does not work. The screen remains blank.

However if i use this code, it works as expected:

glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);

This is what you mean with additive blending ?