As for subtractive blending, there is an extension that lets you change the blending equation from D=D+S to D=D-S or D=S-D:
Yes, it is part of the imaging operation subset, which was introduced in openGL 1.2 (april 1999)
as a set of extensions (ARB_imaging). It was only specified as mandatory in openGL 1.4 (july 2002).
If the implementation supports it, you have access to:
- glBlendColor and GL_CONSTANT_ALPHA
- glBlendEquation
So that you can write:
{
// 0.5xB + 0.5 x F
case BLEND_PSX_0:
glBlendEquation(GL_FUNC_ADD);
glBlendColor(1.0, 1.0, 1.0, 0.5);
glBlendFunc(GL_CONSTANT_ALPHA, GL_CONSTANT_ALPHA);
break;
// 1.0xB + 1.0 x F
case BLEND_PSX_1:
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_ONE, GL_ONE);
break;
// 1.0xB - 1.0 x F
case BLEND_PSX_2:
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
glBlendFunc(GL_ONE, GL_ONE);
break;
// 1.0xB + 0.25 x F
case BLEND_PSX_3:
glBlendEquation(GL_FUNC_ADD);
glBlendColor(1.0, 1.0, 1.0, 0.25);
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE);
break;
}
Notice that by using this, you do not need "explicit" alpha channel anymore.
The subsidiary question is: what openGL version/extensions are required for running q-gears ?