1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

shaders: Fix transparency on GC7000L (#10036)

Workaround for the missing GL_ALPHA_TEST implementation in Mesa (etnaviv driver).
This commit is contained in:
mntmn 2020-08-25 20:49:51 +02:00 committed by GitHub
parent f27cf47779
commit 44c98089cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View file

@ -190,6 +190,14 @@ void main(void)
#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);

View file

@ -129,6 +129,14 @@ void main(void)
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);