1
votes

In Apple's GLPaint example, the user can draw with semi-transparent brush over a surface and change colours.

However, as of iOS7, for some odd reason it is not possible to draw something that completely goes over its background: In the first image, we see "Shake me" written with green and a red blob that was drawn multiple times over it. Yet, the writing bellow is still barely visible. The second image was desaturated to make the defect more obvious.

Screenshot of Apple's GLPaintA modified screenshot to show the remnants of older paint strokes

The OpenGL blending function Apple is using is:

glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

What I expect it to do is to blend the newer semi-transparent brush strokes over their background until it cannot longer be seen.

How do I modify the example to achieve such traditional blending?

Nice find! I'll give this a try too for confirmation and then try my app in iOS 6 to see what happens. This is really the biggest hurdle in my app right now. - The Way
I don't see a difference between iOS 6 and 7, but they both are "painting" with what seems to be additive vs subtractive when painting below 1.0 opacity. Here is an image that might help describe the differences. indiana.edu/~telecom/people/faculty/krause/images/… I want paint, not light :) - The Way
Strange, the latest GLPaint I have from Apple is with subtractive blending. Are you sure you're not using older code? - Hristo
I'm using Version: 1.13 Can you post a zip of your sample? Maybe we are doing the opacity differently or something else. I am only seeing the problem when the opacity low on both 6 and 7. - The Way
I am using version 1.13, too. Without any changes, the code produces the results shown above. When I tested on iOS6 last year, it behaved OK. Even if I was misled, one thing is true for sure: even Apple's blending is not right on iOS7 :) - Hristo