From fa218c9f4ce24e65b546c76c8b564e1e62e33fb5 Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Wed, 18 Oct 2023 20:35:51 -0300 Subject: [PATCH] Fixed gl1_overbrightbits limiter Allows values between 0 and 4. Updated documentation. --- doc/040_cvarlist.md | 8 ++++++-- src/client/refresh/gl1/gl1_main.c | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/040_cvarlist.md b/doc/040_cvarlist.md index 51632198..27f63781 100644 --- a/doc/040_cvarlist.md +++ b/doc/040_cvarlist.md @@ -287,6 +287,7 @@ Set `0` by default. * **cl_audiopaused**: If set to `1` the sounds pause when the game does. + ## Graphics (all renderers) * **cin_force43**: If set to `1` (the default) cinematics are displayed @@ -436,6 +437,7 @@ Set `0` by default. Other supported values: `GL_NEAREST_MIPMAP_NEAREST`, `GL_NEAREST_MIPMAP_LINEAR`, `GL_LINEAR_MIPMAP_LINEAR` + ## Graphics (OpenGL 1.4 only) * **gl1_intensity**: Sets the color intensity. Must be a floating point @@ -445,8 +447,9 @@ Set `0` by default. * **gl1_overbrightbits**: Enables overbright bits, brightness scaling of lightmaps and models. Higher values make shadows less dark. Possible values are `0` (no overbright bits), `1` (more correct lighting for - water), `2` (scale by factor 2) and `3` (scale by factor 3). Applied - in realtime, does not need `vid_restart`. + water), `2` (scale by factor 2), `3` (scale lighting by 3 only for the + dynamic meshes, like enemies and items), and `4` (scale lighting of + everything by 4). Applied in realtime, does not need `vid_restart`. * **gl1_particle_square**: If set to `1` particles are rendered as squares. @@ -589,6 +592,7 @@ Set `0` by default. `0`: Rumble feedback, `1`: Haptic feedback. + ## cvar operations cvar operations are special commands that allow the programmatic diff --git a/src/client/refresh/gl1/gl1_main.c b/src/client/refresh/gl1/gl1_main.c index fd89d69c..e0f3716e 100644 --- a/src/client/refresh/gl1/gl1_main.c +++ b/src/client/refresh/gl1/gl1_main.c @@ -1616,13 +1616,13 @@ RI_BeginFrame(float camera_separation) // Clamp overbrightbits if (gl1_overbrightbits->modified) { - if (gl1_overbrightbits->value > 2 && gl1_overbrightbits->value < 4) + if (gl1_overbrightbits->value < 0) { - ri.Cvar_Set("r_overbrightbits", "2"); + ri.Cvar_Set("gl1_overbrightbits", "0"); } else if (gl1_overbrightbits->value > 4) { - ri.Cvar_Set("r_overbrightbits", "4"); + ri.Cvar_Set("gl1_overbrightbits", "4"); } gl1_overbrightbits->modified = false;