aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-10 21:59:29 +0200
committersfan5 <sfan5@live.de>2021-09-17 18:13:50 +0200
commitea250ff5c57301b6ea3e529c811484c743c1fde1 (patch)
treead42a856641992b7a32cc799a1cda155f6bbe715 /src/client
parentd1e0f73b770165fbd889b8298dec79c83107862e (diff)
downloadminetest-ea250ff5c57301b6ea3e529c811484c743c1fde1.tar.gz
minetest-ea250ff5c57301b6ea3e529c811484c743c1fde1.tar.bz2
minetest-ea250ff5c57301b6ea3e529c811484c743c1fde1.zip
Fix GLES2 discard behaviour (texture transparency)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/shader.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/shader.cpp b/src/client/shader.cpp
index 0b35c37af..dc9e9ae6d 100644
--- a/src/client/shader.cpp
+++ b/src/client/shader.cpp
@@ -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"