I have an application which renders various graphical elements using opengl and then transfers the rendered data to a videocard that generates a color and an key video signal used in broadcasting. The color is blended with other video signals in the mixer box based on the key. If the key is 1, the my graphics color is used, if the key is zero then the other video signal is used and in between they are blended.
The problem is that if I clear the framebuffer to black and for example render a red square with alpha 0.5, the resulting framebuffer color is ARGB=0.5,0.5,0,0 since the red is blended 50% with the black background.
What i do need is ARGB=0.5,1,0,0 since the color should still be pure red, it should just be semi transparent.
As it is now, any object which is semi transparent will also be too dark and the result when blending this with a video signal is incorrect.
I have read about premultiplied alpha, but fail to see how I could use that information to solve my blending problem.
In essence, I want my graphics to not blend with the background color. This might be solveable by using destination alpha rather than source, but I fear that would cause problems when I render several semi transparent partially overlapping objects in the same scene, since they need to blend as usual. Only the background should not be blended into the colors.
Might anyone have a hint for a solution?