From: divverent Date: Tue, 18 Jan 2011 08:51:05 +0000 (+0000) Subject: fix wateralpha X-Git-Tag: xonotic-v0.5.0~438^2~133 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ae75d25abe8396429aa8c6bfe7521090e36527f;p=xonotic%2Fdarkplaces.git fix wateralpha git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10708 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 010818f5..e8f90ad3 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -5392,8 +5392,18 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, mode = SHADERMODE_WATER; if (rsurface.texture->r_water_waterscroll[0] && rsurface.texture->r_water_waterscroll[1]) permutation |= SHADERPERMUTATION_NORMALMAPSCROLLBLEND; - GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - allow_colormod = R_BlendFuncAllowsColormod(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + if((r_wateralpha.value < 1) && (rsurface.texture->currentmaterialflags & MATERIALFLAG_WATERALPHA)) + { + // this is the right thing to do for wateralpha + GL_BlendFunc(GL_ONE, GL_ZERO); + allow_colormod = R_BlendFuncAllowsColormod(GL_ONE, GL_ZERO); + } + else + { + // this is the right thing to do for entity alpha + GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + allow_colormod = R_BlendFuncAllowsColormod(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } } else if (rsurface.texture->currentmaterialflags & MATERIALFLAG_REFRACTION) {