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