I am working on a handwriting application on iOS. I found a sample GLPaint project from the iOS documentation that is implemented by OpenGL ES, and I did something on it.
I track the points of tangency and calculate the curves between the points and draw the images of the particles only a curve so that it looks like the finger has passed.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, brushData); // burshData is from CGImage, it is // vertexBuffer is generated based on the calculated points, it just a sequence of point where need to draw image. glVertexPointer(2, GL_FLOAT, 0, vertexBuffer); glDrawArrays(GL_POINTS, 0, vertexCount); glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES];
I got a solid line that looks good. But now I want to make a translucent backlight instead of a solid line. Therefore, I replace the particle image with 50% transparency without changing the code.
50% transparency image result

Something is wrong with blend.
What I need

I draw three points using the image of a translucent particle, and the intersection area should maintain transparency by 50%.
What's the solution?
source share