From: lordhavoc Date: Wed, 27 Mar 2002 09:13:34 +0000 (+0000) Subject: removed fog shaderstage, merged it into the normal stage X-Git-Tag: RELEASE_0_2_0_RC1~547 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=d37e89803964a73d3c42b8a55587140d7c582ef4;ds=sidebyside removed fog shaderstage, merged it into the normal stage git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1687 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index ceae807b..e362a41a 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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) diff --git a/gl_rsurf.c b/gl_rsurf.c index 967ff07c..11741d35 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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); }