SNL: Color alpha pre-multiply
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
One of the things selecting ordered composite should do is help when rendering transparent surfaces. Unfortunatly, when this option is on, the colors are wrong.
The problem is that ordered compositing does alpha blending of images (generally good for compositing transparent items), but the alpha values in the color buffer are wrong.
The problem is that the blending mode is set to glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA). Although many people think this is appropriate for the Porter & Duff OVER operation, it is not (it gets the color right but the alpha wrong).
There are two ways to get the OVER operation right. The first involves using a special blending mode available in OpenGL 1.3. Unfortunatly, many cheaper implementations still do not support this.
The other way involves setting the blend function to glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA) AND premultiplying the polygon colors by their alpha. For example, the RGBA value of a full intensity red with half opacity is (0.5, 0, 0, 0.5) instead of (1, 0, 0, 0.5) (i.e., the RGB values are "premuliplied" by the alpha).