Skip to content

Commit 3cd5d86

Browse files
committed
Don't draw global fog twice
The global fog (used by ET maps) was being drawn twice for opaque surfaces: once with the fogGlobal shader, and again with the fogQuake3 shader. Don't do that. Besides being redundant, the fogQuake3 shader doesn't seem to render it correctly (some parts are randomly more shaded than others).
1 parent bf25cd7 commit 3cd5d86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/engine/renderer/tr_main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,11 @@ void R_AddDrawSurf( surfaceType_t *surface, shader_t *shader, int lightmapNum, i
17231723
R_AddDrawSurf( surface, shader->depthShader, 0, 0, bspSurface );
17241724
}
17251725

1726-
if( !shader->noFog && fogNum >= 1 ) {
1726+
// don't draw the global fog twice on opaque surfaces
1727+
// allow global fog with the fogLE shader although drawing the global fog with the
1728+
// volumetric (fogQuake3) shader looks kind of buggy
1729+
if ( !shader->noFog && fogNum >= 1 &&
1730+
( fogNum != tr.world->globalFog || shader->fogPass == fogPass_t::FP_LE ) ) {
17271731
R_AddDrawSurf( surface, shader->fogShader, 0, fogNum, bspSurface );
17281732
}
17291733
}

0 commit comments

Comments
 (0)