Clamp the lightlevel at the start of HWR_Lighting()

Allows secbright to work without shaders
This commit is contained in:
chromaticpipe authored and Alug committed 2025-08-01 20:48:33 +02:00
1 parent 51725535bc
commit bef610d3ff
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -418,6 +418,9 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG;
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = CLAMP(SOFTLIGHT(light_level), cv_glsecbright.value, 255);
// Crappy backup coloring if you can't do shaders
if (!HWR_UseShader())
{
@@ -455,9 +458,6 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
poly_color.s.blue = (UINT8)blue;
}
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = CLAMP(SOFTLIGHT(light_level), cv_glsecbright.value, 255);
// in palette rendering mode, this is not needed since it properly takes the changes to the palette itself
if (!HWR_ShouldUsePaletteRendering())
{
+1 -1
View File
@@ -1026,7 +1026,7 @@ static const char* OP_OpenGLTooltips[] =
"Graphical Shaders.",
"Recreates the look of software mode.",
"Flash palettes for palette rendering.",
"Minimum shader brightness. This is set in sector brightness values.",
"Sets minimum sector brightness, useful for dark areas",
"Bit-depth of textures.",
"Filter to use on textures.",
"Anisotropic filtering.",