开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜