spinning
spinning

Reputation: 119

glAlphaFunc performance on newer GPUs

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?

Upvotes: 0

Views: 324

Answers (1)

tbalazs
tbalazs

Reputation: 599

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.

Upvotes: 2

Related Questions