Skip to content

Commit

Permalink
- don't clamp shade values in the setup pass.
Browse files Browse the repository at this point in the history
We need their proper values when setting up the lighting.
  • Loading branch information
coelckers committed Apr 21, 2021
1 parent 9092b5c commit dc0df7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/core/rendering/scene/hw_flats.cpp
Expand Up @@ -263,7 +263,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which)
{
// process the original floor first.

shade = clamp(frontsector->floorshade, 0, numshades-1);
shade = frontsector->floorshade;
palette = frontsector->floorpal;
stack = frontsector->portalflags == PORTAL_SECTOR_FLOOR || frontsector->portalflags == PORTAL_SECTOR_FLOOR_REFLECT;

Expand Down Expand Up @@ -303,7 +303,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which)
{
// process the original ceiling first.

shade = clamp(frontsector->ceilingshade, 0, numshades-1);
shade = frontsector->ceilingshade;
palette = frontsector->ceilingpal;
stack = frontsector->portalflags == PORTAL_SECTOR_CEILING || frontsector->portalflags == PORTAL_SECTOR_CEILING_REFLECT;

Expand Down Expand Up @@ -353,7 +353,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, spritetype* sprite, sectortype* s
{
this->sprite = sprite;
sec = sector;
shade = clamp(sprite->shade, 0, numshades - 1);
shade = sprite->shade;
palette = sprite->pal;
fade = lookups.getFade(sector->floorpal); // fog is per sector.

Expand Down
6 changes: 3 additions & 3 deletions source/core/rendering/scene/hw_walls.cpp
Expand Up @@ -783,7 +783,7 @@ void HWWall::DoLowerTexture(HWDrawInfo* di, walltype* wal, sectortype* frontsect
auto refwall = (wal->cstat & CSTAT_WALL_BOTTOM_SWAP) ? &wall[wal->nextwall] : wal;
refheight = (refwall->cstat & CSTAT_WALL_ALIGN_BOTTOM) ? frontsector->ceilingz : backsector->floorz;

shade = clamp(refwall->shade, 0, numshades - 1);
shade = refwall->shade;
palette = refwall->pal;
type = RENDERWALL_BOTTOM;
DoTexture(di, wal, refwall, refheight, topleft, topright, bottomleft, bottomright);
Expand Down Expand Up @@ -878,7 +878,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
glseg.fracright = 1;
flags = 0;
dynlightindex = -1;
shade = clamp(wal->shade, 0, numshades - 1);
shade = wal->shade;
palette = wal->pal;
fade = lookups.getFade(frontsector->floorpal); // fog is per sector.
visibility = sectorVisibility(frontsector);
Expand Down Expand Up @@ -1048,7 +1048,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect

flags = HWF_CLAMPX|HWF_CLAMPY;
dynlightindex = -1;
shade = clamp(spr->shade, 0, numshades - 1);
shade = spr->shade;
palette = spr->pal;
fade = lookups.getFade(sector->floorpal); // fog is per sector.
visibility = sectorVisibility(sector);
Expand Down

0 comments on commit dc0df7d

Please sign in to comment.