]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.c
fix interaction of blendfunc with rtlights
[xonotic/darkplaces.git] / model_shared.c
index 5018ab9f150ceede63d2d309e95a56f5bd9cdbb8..c4907d069621a0ac034ebdf8ef04fb88d1797b28 100644 (file)
@@ -1816,7 +1816,7 @@ void Mod_LoadQ3Shaders(void)
                                                                        else if (!strcasecmp(parameter[k+1], "GL_DST_COLOR"))
                                                                                layer->blendfunc[k] = GL_DST_COLOR;
                                                                        else if (!strcasecmp(parameter[k+1], "GL_DST_ALPHA"))
-                                                                               layer->blendfunc[k] = GL_ONE_MINUS_DST_ALPHA;
+                                                                               layer->blendfunc[k] = GL_DST_ALPHA;
                                                                        else if (!strcasecmp(parameter[k+1], "GL_ONE_MINUS_SRC_COLOR"))
                                                                                layer->blendfunc[k] = GL_ONE_MINUS_SRC_COLOR;
                                                                        else if (!strcasecmp(parameter[k+1], "GL_ONE_MINUS_SRC_ALPHA"))
@@ -1970,10 +1970,6 @@ void Mod_LoadQ3Shaders(void)
                                                        shader.textureblendalpha = true;
                                                }
                                        }
-#if 1
-                                       // LordHavoc: use this code until divVerent is able to fix the other code
-                                       layer->texflags = TEXF_ALPHA;
-#else
                                        layer->texflags = 0;
                                        if (layer->alphatest)
                                                layer->texflags |= TEXF_ALPHA;
@@ -1995,7 +1991,6 @@ void Mod_LoadQ3Shaders(void)
                                        // nasty hack because DP treats this the same as GL_SRC_ALPHA GL_ONE
                                        if(layer->blendfunc[0] == GL_ONE && layer->blendfunc[1] == GL_ONE)
                                                layer->texflags |= TEXF_ALPHA;
-#endif
 
                                        if (!(shader.surfaceparms & Q3SURFACEPARM_NOMIPMAPS))
                                                layer->texflags |= TEXF_MIPMAP;