Results 1 to 3 of 3

Thread: alpha blend with an extra alpha.

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Location
    Lund
    Posts
    4

    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-(a1*a2))*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 ]

  2. #2

    Re: alpha blend with an extra alpha.

    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 ]

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Location
    Lund
    Posts
    4

    Re: alpha blend with an extra alpha.

    Thanks!
    It worked perfectly.

Similar Threads

  1. glClear alpha vs geometry alpha -- blending result confusin
    By jasontrice in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 3
    Last Post: 06-16-2011, 11:51 AM
  2. Source Alpha Blending without an Alpha Buffer
    By niallm in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 06-18-2009, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •