Blending a texture to erase alpha values softly with OpenGL

和自甴很熟 提交于 2019-12-03 13:16:02

Do you know the background color of the texture? If so, instead of "erasing", you could simply paint background over it. That would be somewhat simpler, as you would only change the color and not the blending mod.

If you need to do it with blending, try:

glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);

This will use the zero in area of full alpha, and fade back into the existing color as the brush's alpha fades off.

This page contains a full list of possible modes: http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!