From 9796b95857824c822fcd0a903a9716a76f1b0b7d Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 29 Aug 2011 20:20:38 +0000 Subject: [PATCH] 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 --- model_shared.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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)) -- 2.39.2