- factor in xdimenscale and viewingrangerecip when calculating renderSetVisibility().

* Changes performed in 0bd460d9e3 didn't take into account xdimenscale and viewingrangerecip like the days of old and this wasn't picked up in d80a32d379 or d80a32d379, where the applied fixes only appeared to work because they worked for me at 2560x1440p.
This commit is contained in:
Mitchell Richters 2020-07-03 17:38:42 +10:00 committed by Christoph Oelckers
parent fc017f5868
commit bbacc9e816
3 changed files with 3 additions and 2 deletions

View file

@ -108,5 +108,6 @@ EDUKE32_STATIC_ASSERT(DAMETH_NARROW_MASKPROPS(DAMETH_MASKPROPS) == DAMETH_MASK);
extern float fcosglobalang, fsinglobalang;
extern float fxdim, fydim, fydimen, fviewingrange;
extern int32_t viewingrangerecip;
#endif

View file

@ -1104,7 +1104,7 @@ static int32_t globaluclip, globaldclip;
//char globparaceilclip, globparaflorclip;
int32_t xyaspect;
static int32_t viewingrangerecip;
int32_t viewingrangerecip;
static char globalxshift, globalyshift;
static int32_t globalxpanning, globalypanning;

View file

@ -266,7 +266,7 @@ static void polymost_updaterotmat(void)
};
multiplyMatrix4f(matrix, tiltmatrix);
renderSetViewMatrix(matrix);
renderSetVisibility(((float)(g_visibility) / r_ambientlight) * fviewingrange * (7.5f / (65536.f * 65536.f)));
renderSetVisibility(mulscale16(g_visibility, mulscale16(xdimenscale, viewingrangerecip)) * fviewingrange * (1.f / (65536.f * 65536.f)) / r_ambientlight);
}
static void polymost_flatskyrender(vec2f_t const* const dpxy, int32_t const n, int32_t method, const vec2_16_t& tilesiz);