mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Fix GLES2 discard behaviour (texture transparency)
This commit is contained in:
@@ -674,8 +674,12 @@ ShaderInfo ShaderSource::generateShader(const std::string &name,
|
||||
if (strstr(gl_renderer, "GC7000"))
|
||||
use_discard = true;
|
||||
#endif
|
||||
if (use_discard && shaderinfo.base_material != video::EMT_SOLID)
|
||||
shaders_header << "#define USE_DISCARD 1\n";
|
||||
if (use_discard) {
|
||||
if (shaderinfo.base_material == video::EMT_TRANSPARENT_ALPHA_CHANNEL)
|
||||
shaders_header << "#define USE_DISCARD 1\n";
|
||||
else if (shaderinfo.base_material == video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF)
|
||||
shaders_header << "#define USE_DISCARD_REF 1\n";
|
||||
}
|
||||
|
||||
#define PROVIDE(constant) shaders_header << "#define " #constant " " << (int)constant << "\n"
|
||||
|
||||
|
Reference in New Issue
Block a user