Enable GL_ALPHA_TEST in OpenGL driver for custom transparent alpha shaders

This commit is contained in:
paradust7 2022-05-04 02:06:15 +00:00 committed by sfan5
parent 24594ce226
commit 401e769114

View File

@ -243,6 +243,8 @@ void COpenGLSLMaterialRenderer::OnSetMaterial(const video::SMaterial& material,
{
cacheHandler->setBlend(true);
cacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
cacheHandler->setAlphaTest(true);
cacheHandler->setAlphaFunc(GL_GREATER, 0.f);
}
else if (FixedBlending)
{
@ -291,7 +293,7 @@ void COpenGLSLMaterialRenderer::OnUnsetMaterial()
{
cacheHandler->setBlend(false);
}
else if (AlphaTest)
if (Alpha || AlphaTest)
{
cacheHandler->setAlphaTest(false);
}