More fog/visibility tweaking. This makes Polymost's not depend on the screen width.

git-svn-id: https://svn.eduke32.com/eduke32@1944 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-07-24 18:40:10 +00:00
parent 7e9b2eae0f
commit 13dde60ccd
2 changed files with 22 additions and 3 deletions

View file

@ -121,8 +121,7 @@ extern double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdo
extern double gcosang, gsinang, gcosang2, gsinang2; extern double gcosang, gsinang, gcosang2, gsinang2;
extern double gchang, gshang, gctang, gstang, gvisibility; extern double gchang, gshang, gctang, gstang, gvisibility;
//#define FOGSCALE 0.0000768 #define FOGSCALE 0.0000768
#define FOGSCALE ((0.0000768+0.0000128)/(1 + 0.5f*(getrendermode()==4)))
extern float fogresult, fogcol[4], fogtable[4*MAXPALOOKUPS]; extern float fogresult, fogcol[4], fogtable[4*MAXPALOOKUPS];

View file

@ -7755,7 +7755,27 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
i = mulscale16(xdimenscale,viewingrangerecip); i = mulscale16(xdimenscale,viewingrangerecip);
globalpisibility = mulscale16(parallaxvisibility,i); 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); globalhisibility = mulscale16(globalvisibility,xyaspect);
globalcisibility = mulscale8(globalhisibility,320); globalcisibility = mulscale8(globalhisibility,320);