Workaround for the missing GL_ALPHA_TEST implementation in Mesa (etnaviv driver).
#endif
vec4 base = texture2D(baseTexture, uv).rgba;
+#ifdef USE_DISCARD
+ // If alpha is zero, we can just discard the pixel. This fixes transparency
+ // on GPUs like GC7000L, where GL_ALPHA_TEST is not implemented in mesa.
+ if (base.a == 0.0) {
+ discard;
+ }
+#endif
+
#ifdef ENABLE_BUMPMAPPING
if (use_normalmap) {
vec3 L = normalize(lightVec);
vec4 base = texture2D(baseTexture, uv).rgba;
+#ifdef USE_DISCARD
+ // If alpha is zero, we can just discard the pixel. This fixes transparency
+ // on GPUs like GC7000L, where GL_ALPHA_TEST is not implemented in mesa.
+ if (base.a == 0.0) {
+ discard;
+ }
+#endif
+
#ifdef ENABLE_BUMPMAPPING
if (use_normalmap) {
vec3 L = normalize(lightVec);
#include "gamedef.h"
#include "client/tile.h"
+#if ENABLE_GLES
+#ifdef _IRR_COMPILE_WITH_OGLES1_
+#include <GLES/gl.h>
+#else
+#include <GLES2/gl2.h>
+#endif
+#else
+#include <GL/gl.h>
+#endif
+
/*
A cache from shader name to shader path
*/
// Create shaders header
std::string shaders_header = "#version 120\n";
+#ifdef __unix__
+ // For renderers that should use discard instead of GL_ALPHA_TEST
+ const char* gl_renderer = (const char*)glGetString(GL_RENDERER);
+ if (strstr(gl_renderer, "GC7000")) {
+ shaders_header += "#define USE_DISCARD\n";
+ }
+#endif
+
static const char* drawTypes[] = {
"NDT_NORMAL",
"NDT_AIRLIKE",