]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
removed fog shaderstage, merged it into the normal stage
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Mar 2002 09:13:34 +0000 (09:13 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 Mar 2002 09:13:34 +0000 (09:13 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1687 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
gl_rsurf.c

index ceae807bf46b4b2efd07296d5b2d92b576459c1b..e362a41a68677b6fc77411b8112f9c1bc5cf7d1a 100644 (file)
@@ -663,7 +663,6 @@ void R_RenderView (void)
 
        R_DrawSurfaces(SHADERSTAGE_SKY);
        R_DrawSurfaces(SHADERSTAGE_NORMAL);
-       R_DrawSurfaces(SHADERSTAGE_FOG);
        R_TimeReport("surfdraw");
 
        if (r_drawportals.integer)
index 967ff07cb982be08729b9529621b3d1fb322efbc..11741d35c6db2799192be81b65f2cf0a6b82d94f 100644 (file)
@@ -1426,6 +1426,9 @@ static void RSurfShader_Wall_Fullbright(msurface_t *firstsurf)
        for (surf = firstsurf;surf;surf = surf->chain)
                if (surf->currenttexture->glowtexture)
                        RSurfShader_Wall_Pass_Glow(surf);
+       if (fogenabled)
+               for (surf = firstsurf;surf;surf = surf->chain)
+                       RSurfShader_Wall_Pass_Fog(surf);
 }
 
 static void RSurfShader_Wall_Vertex(msurface_t *firstsurf)
@@ -1439,6 +1442,9 @@ static void RSurfShader_Wall_Vertex(msurface_t *firstsurf)
        for (surf = firstsurf;surf;surf = surf->chain)
                if (surf->currenttexture->glowtexture)
                        RSurfShader_Wall_Pass_Glow(surf);
+       if (fogenabled)
+               for (surf = firstsurf;surf;surf = surf->chain)
+                       RSurfShader_Wall_Pass_Fog(surf);
 }
 
 static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
@@ -1454,6 +1460,9 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                for (surf = firstsurf;surf;surf = surf->chain)
                        if (surf->currenttexture->glowtexture)
                                RSurfShader_Wall_Pass_Glow(surf);
+               if (fogenabled)
+                       for (surf = firstsurf;surf;surf = surf->chain)
+                               RSurfShader_Wall_Pass_Fog(surf);
        }
        else if (r_multitexture.integer)
        {
@@ -1467,6 +1476,9 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                        for (surf = firstsurf;surf;surf = surf->chain)
                                if (surf->currenttexture->glowtexture)
                                        RSurfShader_Wall_Pass_Glow(surf);
+                       if (fogenabled)
+                               for (surf = firstsurf;surf;surf = surf->chain)
+                                       RSurfShader_Wall_Pass_Fog(surf);
                }
                else
                {
@@ -1481,6 +1493,9 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                        for (surf = firstsurf;surf;surf = surf->chain)
                                if (surf->currenttexture->glowtexture)
                                        RSurfShader_Wall_Pass_Glow(surf);
+                       if (fogenabled)
+                               for (surf = firstsurf;surf;surf = surf->chain)
+                                       RSurfShader_Wall_Pass_Fog(surf);
                }
        }
        else if (firstsurf->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1 || currentrenderentity->effects & EF_ADDITIVE)
@@ -1493,6 +1508,9 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                for (surf = firstsurf;surf;surf = surf->chain)
                        if (surf->currenttexture->glowtexture)
                                RSurfShader_Wall_Pass_Glow(surf);
+               if (fogenabled)
+                       for (surf = firstsurf;surf;surf = surf->chain)
+                               RSurfShader_Wall_Pass_Fog(surf);
        }
        else
        {
@@ -1508,6 +1526,9 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                        for (surf = firstsurf;surf;surf = surf->chain)
                                if (surf->currenttexture->glowtexture)
                                        RSurfShader_Wall_Pass_Glow(surf);
+                       if (fogenabled)
+                               for (surf = firstsurf;surf;surf = surf->chain)
+                                       RSurfShader_Wall_Pass_Fog(surf);
                }
                else
                {
@@ -1524,19 +1545,13 @@ static void RSurfShader_Wall_Lightmap(msurface_t *firstsurf)
                        for (surf = firstsurf;surf;surf = surf->chain)
                                if (surf->currenttexture->glowtexture)
                                        RSurfShader_Wall_Pass_Glow(surf);
+                       if (fogenabled)
+                               for (surf = firstsurf;surf;surf = surf->chain)
+                                       RSurfShader_Wall_Pass_Fog(surf);
                }
        }
 }
 
-static void RSurfShader_Wall_Fog(msurface_t *firstsurf)
-{
-       msurface_t *surf;
-       if (!fogenabled)
-               return;
-       for (surf = firstsurf;surf;surf = surf->chain)
-               RSurfShader_Wall_Pass_Fog(surf);
-}
-
 /*
 =============================================================
 
@@ -1862,11 +1877,11 @@ loc1:
                goto loc1;
 }
 
-Cshader_t Cshader_wall_vertex = {{NULL, RSurfShader_Wall_Vertex, RSurfShader_Wall_Fog}, NULL};
-Cshader_t Cshader_wall_lightmap = {{NULL, RSurfShader_Wall_Lightmap, RSurfShader_Wall_Fog}, NULL};
-Cshader_t Cshader_wall_fullbright = {{NULL, RSurfShader_Wall_Fullbright, RSurfShader_Wall_Fog}, NULL};
-Cshader_t Cshader_water = {{NULL, RSurfShader_Water, NULL}, NULL};
-Cshader_t Cshader_sky = {{RSurfShader_Sky, NULL, NULL}, NULL};
+Cshader_t Cshader_wall_vertex = {{NULL, RSurfShader_Wall_Vertex}, NULL};
+Cshader_t Cshader_wall_lightmap = {{NULL, RSurfShader_Wall_Lightmap}, NULL};
+Cshader_t Cshader_wall_fullbright = {{NULL, RSurfShader_Wall_Fullbright}, NULL};
+Cshader_t Cshader_water = {{NULL, RSurfShader_Water}, NULL};
+Cshader_t Cshader_sky = {{RSurfShader_Sky, NULL}, NULL};
 
 int Cshader_count = 5;
 Cshader_t *Cshaders[5] =
@@ -2125,5 +2140,4 @@ void R_DrawBrushModelNormal (void)
        if (!skyrendermasked)
                R_DrawSurfaces(SHADERSTAGE_SKY);
        R_DrawSurfaces(SHADERSTAGE_NORMAL);
-       R_DrawSurfaces(SHADERSTAGE_FOG);
 }