Skip to content

Commit

Permalink
formulate smooth lighting values relative to Vanilla values
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiangreffrath committed Sep 5, 2024
1 parent 2f18803 commit ecafde8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/doom/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ void P_SegLengths (boolean contrast_only)
li->fakecontrast = -LIGHTBRIGHT;
else
if (abs(finesine[li->r_angle >> ANGLETOFINESHIFT]) < rightangle)
li->fakecontrast = -(LIGHTBRIGHT >> 1);
li->fakecontrast = -LIGHTBRIGHT / 2;
else
if (!dx)
li->fakecontrast = LIGHTBRIGHT;
else
if (abs(finecosine[li->r_angle >> ANGLETOFINESHIFT]) < rightangle)
li->fakecontrast = LIGHTBRIGHT >> 1;
li->fakecontrast = LIGHTBRIGHT / 2;
else
li->fakecontrast = 0;
}
Expand Down
48 changes: 24 additions & 24 deletions src/doom/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,39 +704,39 @@ void R_InitLightTables (void)
if (crispy->truecolor)
{
// [crispy] if in TrueColor mode, use smoothest diminished lighting
NUMCOLORMAPS = 256;
LIGHTLEVELS = 256;
LIGHTSEGSHIFT = 0;
LIGHTBRIGHT = 15;
MAXLIGHTSCALE = 376;
LIGHTSCALESHIFT = 9;
MAXLIGHTZ = 1024;
LIGHTZSHIFT = 17;
NUMCOLORMAPS = 32 * 8;
LIGHTLEVELS = 16 * 16;
LIGHTSEGSHIFT = 4 - 4;
LIGHTBRIGHT = 1 * 16;
MAXLIGHTSCALE = 48 * 8;
LIGHTSCALESHIFT = 12 - 3;
MAXLIGHTZ = 128 * 8;
LIGHTZSHIFT = 20 - 3;
}
else
#endif
{
// [crispy] else, use paletted approach
NUMCOLORMAPS = 32;
LIGHTLEVELS = 32;
LIGHTSEGSHIFT = 3;
LIGHTBRIGHT = 2;
MAXLIGHTSCALE = 48;
LIGHTSCALESHIFT = 12;
MAXLIGHTZ = 1024;
LIGHTZSHIFT = 17;
NUMCOLORMAPS = 32 * 1;
LIGHTLEVELS = 16 * 2;
LIGHTSEGSHIFT = 4 - 1;
LIGHTBRIGHT = 1 * 2;
MAXLIGHTSCALE = 48 * 1;
LIGHTSCALESHIFT = 12 - 0;
MAXLIGHTZ = 128 * 8;
LIGHTZSHIFT = 20 - 3;
}
}
else
{
NUMCOLORMAPS = 32;
LIGHTLEVELS = 16;
LIGHTSEGSHIFT = 4;
LIGHTBRIGHT = 1;
MAXLIGHTSCALE = 48;
LIGHTSCALESHIFT = 12;
MAXLIGHTZ = 128;
LIGHTZSHIFT = 20;
NUMCOLORMAPS = 32;
LIGHTLEVELS = 16;
LIGHTSEGSHIFT = 4;
LIGHTBRIGHT = 1;
MAXLIGHTSCALE = 48;
LIGHTSCALESHIFT = 12;
MAXLIGHTZ = 128;
LIGHTZSHIFT = 20;
}

scalelight = malloc(LIGHTLEVELS * sizeof(*scalelight));
Expand Down

0 comments on commit ecafde8

Please sign in to comment.