RSurfShader_Water_Pass_Base(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Water_Pass_Glow(s);
+ if (fogenabled)
+ {
+ if (currentrenderentity->alpha * (s->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value) >= 1.0f)
+ RSurfShader_Water_Pass_Fog(s);
+ return false;
+ }
+ else
+ return true;
+ default:
+ return true;
+ }
+}
+
+static int RSurfShader_Water_Glow(int stage, msurface_t *s)
+{
+ switch(stage)
+ {
+ case 0:
+ RSurfShader_Water_Pass_Base(s);
+ return false;
+ case 1:
+ RSurfShader_Water_Pass_Glow(s);
return false;
case 2:
if (fogenabled)
static int RSurfShader_Wall_Fullbright(int stage, msurface_t *s)
{
if (stage == 0)
+ {
c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseFullbright(s);
+ return false;
+ }
+ return true;
+}
+
+static int RSurfShader_Wall_Fullbright_Glow(int stage, msurface_t *s)
+{
switch(stage)
{
case 0:
+ c_brush_polys++;
RSurfShader_Wall_Pass_BaseFullbright(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
static int RSurfShader_Wall_Vertex(int stage, msurface_t *s)
{
if (stage == 0)
+ {
c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseVertex(s);
+ return false;
+ }
+ return true;
+}
+
+static int RSurfShader_Wall_Vertex_Glow(int stage, msurface_t *s)
+{
switch(stage)
{
case 0:
+ c_brush_polys++;
RSurfShader_Wall_Pass_BaseVertex(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
}
static int RSurfShader_Wall_Lightmap(int stage, msurface_t *s)
+{
+ if (r_vertexsurfaces.integer)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseVertex(s);
+ return false;
+ }
+ return true;
+ }
+ else if (r_multitexture.integer)
+ {
+ if (r_dlightmap.integer)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseMTex(s);
+ return false;
+ }
+ return true;
+ }
+ else
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseMTex(s);
+ return false;
+ case 1:
+ if (s->dlightframe == r_framecount)
+ RSurfShader_Wall_Pass_Light(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ }
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1 || currentrenderentity->effects & EF_ADDITIVE)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseVertex(s);
+ return false;
+ }
+ return true;
+ }
+ else
+ {
+ if (r_dlightmap.integer)
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseTexture(s);
+ return false;
+ case 1:
+ RSurfShader_Wall_Pass_BaseLightmap(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ else
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseTexture(s);
+ return false;
+ case 1:
+ RSurfShader_Wall_Pass_BaseLightmap(s);
+ return false;
+ case 2:
+ if (s->dlightframe == r_framecount)
+ RSurfShader_Wall_Pass_Light(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ }
+}
+
+static int RSurfShader_Wall_Lightmap_Glow(int stage, msurface_t *s)
{
if (stage == 0)
c_brush_polys++;
RSurfShader_Wall_Pass_BaseVertex(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
RSurfShader_Wall_Pass_BaseMTex(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
RSurfShader_Wall_Pass_Light(s);
return false;
case 2:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
RSurfShader_Wall_Pass_BaseVertex(s);
return false;
case 1:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
RSurfShader_Wall_Pass_BaseLightmap(s);
return false;
case 2:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
RSurfShader_Wall_Pass_Light(s);
return false;
case 3:
- if (s->currenttexture->glowtexture)
- RSurfShader_Wall_Pass_Glow(s);
+ RSurfShader_Wall_Pass_Glow(s);
return false;
default:
return true;
}
Cshader_t Cshader_wall_vertex = {{NULL, RSurfShader_Wall_Vertex, RSurfShader_Wall_Fog}, NULL};
+Cshader_t Cshader_wall_vertex_glow = {{NULL, RSurfShader_Wall_Vertex_Glow, RSurfShader_Wall_Fog}, NULL};
Cshader_t Cshader_wall_lightmap = {{NULL, RSurfShader_Wall_Lightmap, RSurfShader_Wall_Fog}, NULL};
+Cshader_t Cshader_wall_lightmap_glow = {{NULL, RSurfShader_Wall_Lightmap_Glow, RSurfShader_Wall_Fog}, NULL};
Cshader_t Cshader_wall_fullbright = {{NULL, RSurfShader_Wall_Fullbright, RSurfShader_Wall_Fog}, NULL};
+Cshader_t Cshader_wall_fullbright_glow = {{NULL, RSurfShader_Wall_Fullbright_Glow, RSurfShader_Wall_Fog}, NULL};
Cshader_t Cshader_water = {{NULL, RSurfShader_Water, NULL}, NULL};
+Cshader_t Cshader_water_glow = {{NULL, RSurfShader_Water_Glow, NULL}, NULL};
Cshader_t Cshader_sky = {{RSurfShader_Sky, NULL, NULL}, NULL};
int Cshader_count = 5;
{
shader = Cshaders[i];
if (shader->chain && shader->shaderfunc[type])
+ // shader->shaderfunc[type](shader->chain);
for (stage = 0;stage < 1000;stage++)
for (surf = shader->chain;surf;surf = surf->chain)
if (shader->shaderfunc[type](stage, surf))