Results 1 to 2 of 2

Thread: Performance bottleneck glAlphaFunc

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    4

    Performance bottleneck glAlphaFunc

    Hi!
    I have a problem with the glAlphaFunc( ). Without using it, I got a speed of 2 ms /Process. (I use the GPU for processing some calculations).
    When enabling GL_ALPHA_TEST I got a speed of 40ms+ /Process. I thought that alpha-testing is in hardware? So, how can this happen?
    Here's the relevant code snippet:

    glEnable( GL_STENCIL_TEST );
    glEnable( GL_ALPHA_TEST );
    glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );

    loop over i
    {
    //only draw when alpha == i
    glAlphaFunc( GL_EQUAL, (float)(i+1) / 255.f );
    glStencilFunc( GL_ALWAYS, i+1, 0xff );
    glRasterPos2i( 1,0 );
    glCopyPixels( ObjSize + 1, 0, ObjSize, PopSize, GL_COLOR );

    )
    glDisable( GL_STENCIL_TEST );
    glDisable( GL_ALPHA_TEST );

    When I outcomment glEnable( GL_ALPHA_TEST ), I got much better performance. So I think, that this alphatest is performed in software. But why?

    Thanks a lot
    PS: I got a Geforce 6800 GT with hardware acceleration fully enabled

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    4

    Re: Performance bottleneck glAlphaFunc

    Ok i have found the error. It was the driver. I had the latest nvidia driver, but of course (I am a lucky man ) it did not work as it should. So I installed an old one and now it works fine.
    So my solution to everybody:

    <advice deleted by dorbie>
    Edit by dorbie: before giving advice like that I suggest you learn a bit more about graphics hardware performance.

Similar Threads

  1. glBindTexture Bottleneck?
    By bobGL in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 02-16-2007, 07:08 AM
  2. What is that bottleneck
    By SeskaPeel in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 10-16-2003, 11:27 AM
  3. bottleneck
    By Bra'Tac in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-16-2001, 04:37 AM
  4. I know what is the bottleneck but how to solve it ?
    By nanar77 in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 11-08-2000, 07:24 AM
  5. Help with Bottleneck
    By HemiMG in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 10-27-2000, 12:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean