surfvertex_t *v;
surfvert_t *sv;
rmeshinfo_t m;
- alpha = s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value;
+ alpha = currentrenderentity->alpha * (s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value);
memset(&m, 0, sizeof(m));
if (alpha != 1 || s->currenttexture->fogtexture != NULL)
{
m.transparent = true;
m.blendfunc1 = GL_SRC_ALPHA;
- m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA;
+ m.blendfunc2 = GL_ONE; //_MINUS_SRC_ALPHA;
}
else
{
}
if (s->dlightframe == r_framecount && !(s->flags & SURF_DRAWFULLBRIGHT))
RSurf_Light(s->dlightbits, m.numverts);
- if (fogenabled)
+ if (fogenabled/* && m.blendfunc2 == GL_ONE_MINUS_SRC_ALPHA*/)
{
for (i = 0, sv = svert;i < m.numverts;i++, sv++)
{
surfvertex_t *v;
surfvert_t *sv;
rmeshinfo_t m;
- alpha = s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value;
+ alpha = currentrenderentity->alpha * (s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value);
memset(&m, 0, sizeof(m));
m.transparent = alpha != 1 || s->currenttexture->fogtexture != NULL;
surfvert_t *sv;
rmeshinfo_t m;
vec3_t diff;
- alpha = s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value;
+ alpha = currentrenderentity->alpha * (s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value);
memset(&m, 0, sizeof(m));
m.transparent = alpha != 1 || s->currenttexture->fogtexture != NULL;
RSurfShader_Water_Pass_Glow(s);
return false;
case 2:
- if (fogenabled)
+ if (fogenabled && (s->flags & SURF_DRAWNOALPHA))
{
RSurfShader_Water_Pass_Fog(s);
return false;
m.blendfunc1 = GL_SRC_ALPHA;
m.blendfunc2 = GL_ONE;
}
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
{
m.transparent = true;
m.blendfunc1 = GL_SRC_ALPHA;
m.cr *= 4;
m.cg = m.cr;
m.cb = m.cr;
- m.ca = 1;
+ m.ca = currentrenderentity->alpha;
m.tex[0] = R_GetTexture(s->currenttexture->texture);
m.tex[1] = R_GetTexture(s->lightmaptexture);
m.texcoords[0] = &s->mesh.vertex->st[0];
m.blendfunc1 = GL_SRC_ALPHA;
m.blendfunc2 = GL_ONE;
}
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
{
m.transparent = true;
m.blendfunc1 = GL_SRC_ALPHA;
m.blendfunc1 = GL_SRC_ALPHA;
m.blendfunc2 = GL_ONE;
}
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
{
m.transparent = true;
m.blendfunc1 = GL_SRC_ALPHA;
memset(&m, 0, sizeof(m));
if (currentrenderentity->effects & EF_ADDITIVE)
m.transparent = true;
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
m.transparent = true;
else
m.transparent = false;
memset(&m, 0, sizeof(m));
if (currentrenderentity->effects & EF_ADDITIVE)
m.transparent = true;
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
m.transparent = true;
else
m.transparent = false;
memset(&m, 0, sizeof(m));
if (currentrenderentity->effects & EF_ADDITIVE)
m.transparent = true;
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1)
m.transparent = true;
else
m.transparent = false;
}
}
}
- else if (currentrenderentity != &cl_entities[0].render && (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1 || currentrenderentity->effects & EF_ADDITIVE))
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1 || currentrenderentity->effects & EF_ADDITIVE)
{
switch(stage)
{