- move more of the light calculation code to the drawerargs
This commit is contained in:
parent
a73c065811
commit
efb8e39aa9
26 changed files with 202 additions and 279 deletions
|
|
@ -134,29 +134,14 @@ namespace swrenderer
|
|||
|
||||
planeheight = fabs(pl->height.Zat0() - Thread->Viewport->viewpoint.Pos.Z);
|
||||
|
||||
basecolormap = colormap;
|
||||
|
||||
// [RH] set foggy flag
|
||||
foggy = (level.fadeto || basecolormap->Fade || (level.flags & LEVEL_HASFADETABLE));
|
||||
foggy = (level.fadeto || colormap->Fade || (level.flags & LEVEL_HASFADETABLE));
|
||||
lightlevel = pl->lightlevel;
|
||||
|
||||
CameraLight *cameraLight = CameraLight::Instance();
|
||||
if (cameraLight->FixedLightLevel() >= 0)
|
||||
{
|
||||
drawerargs.SetLight(basecolormap, 0, cameraLight->FixedLightLevelShade());
|
||||
plane_shade = false;
|
||||
}
|
||||
else if (cameraLight->FixedColormap())
|
||||
{
|
||||
drawerargs.SetLight(cameraLight->FixedColormap(), 0, 0);
|
||||
plane_shade = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
plane_shade = true;
|
||||
lightlevel = pl->lightlevel;
|
||||
}
|
||||
plane_shade = cameraLight->FixedLightLevel() < 0 && !cameraLight->FixedColormap();
|
||||
|
||||
drawerargs.SetStyle(masked, additive, alpha);
|
||||
drawerargs.SetStyle(masked, additive, alpha, colormap);
|
||||
|
||||
light_list = pl->lights;
|
||||
|
||||
|
|
@ -200,7 +185,7 @@ namespace swrenderer
|
|||
if (plane_shade)
|
||||
{
|
||||
// Determine lighting based on the span's distance from the viewer.
|
||||
drawerargs.SetLight(basecolormap, (float)Thread->Light->FlatPlaneVis(y, planeheight, foggy, viewport), lightlevel, foggy, viewport);
|
||||
drawerargs.SetLight((float)Thread->Light->FlatPlaneVis(y, planeheight, foggy, viewport), lightlevel, foggy, viewport);
|
||||
}
|
||||
|
||||
if (r_dynlights)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue