Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Alphatest vs Blend

  1. #1
    Junior Member Newbie
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    15

    Alphatest vs Blend

    I was wondering if anyone could tell me if
    Code :
    glEnable(GL_ALPHA_TEST);
    glAlphaFunc(GL_EQUAL, 1.0);
    is faster than
    Code :
    glEnable(GL_BLEND)
    glBlendFunc(GL_ONE_MINUS_DST_ALPHA,GL_ZERO);
    in my application both calls have similar effects, so i would like to know which one is faster.

    Chris
    yes

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Alphatest vs Blend

    Generally the alpha test will be a bit faster if blending is disabled.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    562

    Re: Alphatest vs Blend

    IIRC, in the SGI software renderer for Win32 (and possibly in the MS one too) alpha blend is on the fast path and alpha test isn't, so in software you might see alpha blend running faster. In general though, as DFrey says, testing should be faster. Blending requires a read-modify-write round trip to the framebuffer whereas testing doesn't, so theoretically alpha test requires only half the memory bandwidth.

  4. #4
    Junior Member Newbie
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    15

    Re: Alphatest vs Blend

    thx for the replies, both of you confirmed what i thought
    yes

Posting Permissions

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