diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 445cd6746..58d61d5ec 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -8505,9 +8505,11 @@ int32_t drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, 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(g_visibility<<2, xdimen, 1100); + // NOTE: In Polymost, the fragment depth depends on the x screen size! + if (r_usenewshading==2) + globalvisibility = scale(g_visibility<<2, xdimen, 1680); + else + globalvisibility = scale(g_visibility<<2, xdimen, 1100); break; # ifdef POLYMER case 4: diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 95d706bee..7d6fc8f84 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -411,7 +411,7 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = { " fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fragDepth * 1.442695);\n" #ifdef PR_LINEAR_FOG /* 0.65127==150/230, another constant found out by experiment. :/ - * (150 is Polymost's FOGDISTCONST.) */ + * (150 is Polymost's old FOGDISTCONST.) */ " } else {\n" " fogFactor = gl_Fog.scale * (gl_Fog.end - fragDepth*0.65217);\n" " fogFactor = clamp(fogFactor, 0.0, 1.0);" diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 473ba2837..d1737cc46 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -839,7 +839,7 @@ void polymost_glinit() extern char nofog; // in windows/SDL layers // For GL_LINEAR fog: -#define FOGDISTCONST 150 +#define FOGDISTCONST 600 #define FULLVIS_BEGIN 2.9e38 #define FULLVIS_END 3.0e38 @@ -849,7 +849,7 @@ static inline void fogcalc(int32_t shade, int32_t vis, int32_t pal) if (r_usenewshading==2) { - float combvis = (float)(g_visibility * (uint8_t)(vis+16)); + float combvis = (float)globalvisibility * (uint8_t)(vis+16); bglFogi(GL_FOG_MODE, GL_LINEAR);