Combine Two Translucent Unpremultiplied Textures in Open GL With Blend Modes?

I'm trying to figure out how to use Open GL to combine two unpremultiplied textures (one on top of the other).

Both textures have areas with 0-alpha. I'd like the combined result to be unpremultiplied as well. I've tried multiple combinations of GL_ONE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, etc but haven't had any luck yet.

Here's what I mean (Texture1 and Texture2 are the input textures, Combo is the desired combination):

在这里输入图像描述


Wow...after too long on this, it looks like the image I created for this question led me to the answer.

Here's what did the trick:

glBlendFuncSeparate( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA );

链接地址: http://www.djcxy.com/p/31840.html

上一篇: OpenGL添加剂混合在没有背景时出现问题

下一篇: 在混合模式下将Open GL中的两个半透明未预乘的纹理结合起来?