0

I'm almost finished with an app that only uses vertex arrays and no shaders. I draw a lot of polygons with glAlphaFunc in use and it is unexpectedly slow. Is this because it is depreciated and unsupported by the hardware or would it be just as slow if I had a texture shader and an alpha test to discard the fragment?

spinning
  • 119
  • 1
  • 1
  • 10
  • 2
    The speed of alpha test, like the speed of anything else, is governed by your hardware. There's no way to answer this without knowing what hardware you're using. – Nicol Bolas Apr 25 '12 at 20:46

1 Answers1

2

With alpha blending enabled every fragment is shaded and blended into the frame buffer regardless of its depth value, which means lots of write operation. But without alpha blending the pipeline can utilize the Z-buffer before fragment shading to discard those fragments which failed at the early Z test. This can reduce the write operations substantially.

tbalazs
  • 589
  • 3
  • 5