]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
set TEXF_ALPHA on shader stages only if necessary
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Aug 2011 20:20:38 +0000 (20:20 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 3 Sep 2011 15:00:52 +0000 (17:00 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11310 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=d31a3f45714a81df5699a57c5b6099e5cd3b2231

model_shared.c

index c10341dc0a0e0084ce01d40ac697832ae92662b7..40e7b278512194b6dd8d3957ee061e9499e29d2e 100644 (file)
@@ -1970,7 +1970,23 @@ void Mod_LoadQ3Shaders(void)
                                                        shader.textureblendalpha = true;
                                                }
                                        }
-                                       layer->texflags = TEXF_ALPHA;
+                                       layer->texflags = 0;
+                                       if (layer->alphatest)
+                                               layer->texflags |= TEXF_ALPHA;
+                                       switch(layer->blendfunc[0])
+                                       {
+                                               case GL_SRC_ALPHA:
+                                               case GL_ONE_MINUS_SRC_ALPHA:
+                                                       layer->texflags |= TEXF_ALPHA;
+                                                       break;
+                                       }
+                                       switch(layer->blendfunc[1])
+                                       {
+                                               case GL_SRC_ALPHA:
+                                               case GL_ONE_MINUS_SRC_ALPHA:
+                                                       layer->texflags |= TEXF_ALPHA;
+                                                       break;
+                                       }
                                        if (!(shader.surfaceparms & Q3SURFACEPARM_NOMIPMAPS))
                                                layer->texflags |= TEXF_MIPMAP;
                                        if (!(shader.textureflags & Q3TEXTUREFLAG_NOPICMIP))