Alpha output after blending

I did this a long time ago, but it’s sort of obscure and difficult to describe.

I am drawing a mesh with blending enabled, and after the blend is calculated, I want to maximum of the source and dest alpha values to be written to the color buffer, after the blend is performed. I think there was some special function to control how the output alpha value is calculated, independent from glBlendFunc. Do you know what this is?

Is it possible to share a picture of what you’re trying to do, and maybe a picture of what your current result is, if any?

Maybe someone else might know more about this, but it will help me if I can see what you are aiming for.

glBlendFuncSeparate lets you specify different blending functions for the colour and alpha components.
glBlendEquation and glBlendEquationSeparate let you specify how the source and destination values are combined (the default is addition, but you can choose subtraction, minimum or maximum).

1 Like

Oh okay, that must have been it. If you are rendering transparency to a separate buffer like for heat haze, then is makes sense to take the maximum of the alpha values.