mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix GLES2 discard behaviour (texture transparency)
This commit is contained in:
parent
d1e0f73b77
commit
ea250ff5c5
3 changed files with 18 additions and 8 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue