OpenGL: Is "discard" the only replacement for deprecated GL_ALPHA_TEST?

Viewed 954

I've just realized that GL_ALPHA_TEST was deprecated since OpenGL 3.0, so I can't use it with glEnable(). And I've tried quickly to google how to replace it now (and why it was deprecated), but failed to find the answer for this simple question. I also didn't find the information about GL_ALPHA_TEST removing in Khronos documentation.

I suggest that now the only way to discard fragments according to their alpha value is the "discard" keyword in fragment shaders. Am I right?

1 Answers

Yes, you are correct. GL_ALPHA_TEST is not in core and you must use discard in the fragment shader to get the same effect.

The other alternative is to use a compatibility context, but this is not available on all systems.

Related