Alpha blend with an extra alpha

Hello!

I’m looking for a way to blend a source texture containing an alpha channel, onto the framebuffer, modulated by an extra alpha.
that is, insted of just
dst = a*src + (1-a)dst
I need:
dst = (a1
a2)src + (1-(a1a2))*dst;
where a1 is the texel alpha value, and a2 is a constant value for the whole texture.

How can I achive this using OpenGL ES 1.0?

[ January 19, 2005: Message edited by: Olof Hedman ]

Set flat color shading and call glColor4f(1.0f, 1.0f, 1.0f, a2). This assumes you’re blending with the frame buffer using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). Should blend according to your equation.

Edit: Oops, you’ll also need glTexEnvf(GL_TEXTURE_ENV_MODE, GL_MODULATE).

  • ben

[ January 19, 2005: Message edited by: bentlegen ]

Thanks!
It worked perfectly.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.