PDA

View Full Version : Alphatest vs Blend



DaViper
02-22-2001, 02:09 AM
I was wondering if anyone could tell me if



glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_EQUAL, 1.0);

is faster than



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

DFrey
02-22-2001, 02:20 AM
Generally the alpha test will be a bit faster if blending is disabled.

MikeC
02-22-2001, 04:02 AM
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.

DaViper
02-22-2001, 04:54 AM
thx for the replies, both of you confirmed what i thought http://www.opengl.org/discussion_boards/ubb/smile.gif