diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 39e4e69d3..ae0adf943 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -121,8 +121,7 @@ extern double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdo extern double gcosang, gsinang, gcosang2, gsinang2; extern double gchang, gshang, gctang, gstang, gvisibility; -//#define FOGSCALE 0.0000768 -#define FOGSCALE ((0.0000768+0.0000128)/(1 + 0.5f*(getrendermode()==4))) +#define FOGSCALE 0.0000768 extern float fogresult, fogcol[4], fogtable[4*MAXPALOOKUPS]; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 3b081646c..7d329f364 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7755,7 +7755,27 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, i = mulscale16(xdimenscale,viewingrangerecip); globalpisibility = mulscale16(parallaxvisibility,i); - globalvisibility = getrendermode()==0 ? mulscale16(visibility,i) : scale(visibility<<2,4,3); + switch (getrendermode()) + { + // switch on renderers to make fog look almost the same everywhere + + case 0: + globalvisibility = mulscale16(visibility,i); + break; +#ifdef USE_OPENGL + case 3: + // I have no idea what the significance of this constant is, + // it was found out experimentally. v v + globalvisibility = scale(visibility<<2, xdimen, 1100); + break; +# ifdef POLYMER + case 4: + globalvisibility = visibility<<2; + break; +# endif +#endif + } + globalhisibility = mulscale16(globalvisibility,xyaspect); globalcisibility = mulscale8(globalhisibility,320);