- move visibility calculation to LightVisibility

This commit is contained in:
Magnus Norddahl 2018-12-17 05:10:26 +01:00
commit f35aeec6c3
11 changed files with 14 additions and 17 deletions

View file

@ -137,9 +137,7 @@ namespace swrenderer
basecolormap = colormap;
// [RH] set foggy flag
bool foggy = (level.fadeto || basecolormap->Fade || (level.flags & LEVEL_HASFADETABLE));
GlobVis = Thread->Light->FlatPlaneGlobVis(foggy) / planeheight;
foggy = (level.fadeto || basecolormap->Fade || (level.flags & LEVEL_HASFADETABLE));
CameraLight *cameraLight = CameraLight::Instance();
if (cameraLight->FixedLightLevel() >= 0)
@ -202,7 +200,7 @@ namespace swrenderer
if (plane_shade)
{
// Determine lighting based on the span's distance from the viewer.
drawerargs.SetLight(basecolormap, (float)(GlobVis * fabs(viewport->CenterY - y)), planeshade);
drawerargs.SetLight(basecolormap, (float)Thread->Light->FlatPlaneVis(y, planeheight, foggy, viewport), planeshade);
}
if (r_dynlights)