mirror of
https://github.com/luanti-org/luanti.git
synced 2026-01-12 04:05:26 +01:00
OpenGL: don't use alpha test for GLSL materials (#16832)
This fixes crack for transparent textures on legacy GL (overlay was visible even if base was transparent), because our shader code assumed that transparent pixels would be discarded early.
This commit is contained in:
@@ -790,14 +790,7 @@ void ShaderSource::generateShader(ShaderInfo &shaderinfo)
|
||||
|
||||
ShaderConstants constants = input_const;
|
||||
|
||||
bool use_discard = m_fully_programmable;
|
||||
if (!use_discard) {
|
||||
// workaround for a certain OpenGL implementation lacking GL_ALPHA_TEST
|
||||
const char *renderer = reinterpret_cast<const char*>(GL.GetString(GL.RENDERER));
|
||||
if (strstr(renderer, "GC7000"))
|
||||
use_discard = true;
|
||||
}
|
||||
if (use_discard) {
|
||||
{
|
||||
if (shaderinfo.base_material == video::EMT_TRANSPARENT_ALPHA_CHANNEL)
|
||||
constants["USE_DISCARD"] = 1;
|
||||
else if (shaderinfo.base_material == video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF)
|
||||
|
||||
Reference in New Issue
Block a user