From: divverent Date: Mon, 29 Aug 2011 20:20:38 +0000 (+0000) Subject: set TEXF_ALPHA on shader stages only if necessary X-Git-Tag: xonotic-v0.5.0~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9796b95857824c822fcd0a903a9716a76f1b0b7d;p=xonotic%2Fdarkplaces.git set TEXF_ALPHA on shader stages only if necessary git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11310 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=d31a3f45714a81df5699a57c5b6099e5cd3b2231 --- diff --git a/model_shared.c b/model_shared.c index c10341dc..40e7b278 100644 --- a/model_shared.c +++ b/model_shared.c @@ -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))