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