Highlighter effect in OpenGL ES
I am developing an iPhone paining app in OpenGL ES. I want to create a highlighter tool that has the same effect of a real highlighter - lays a flo开发者_JAVA技巧rescent color still showing what is behind. I am not able to come up with the correct combination of parameters for the glBlendFunc. Any help will be greatly appreciated.
There are several ways to get this done. I would recommend using the alpha parameter for glColor4F:
glColor4f(0.97, 0.58, 0.12, 0.2);
(That will give you an orange highlighter) As for your blend function, just use:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
精彩评论