From 6ca2087dbcfd00772625b1df27e2fbf31d6215f1 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 20 Dec 2023 05:53:36 +0100 Subject: [PATCH] better wall and floor colormap calc values taken from based on https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1516 --- src/hardware/r_opengl/r_opengl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index da54f7d4a..6c478a047 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -693,11 +693,10 @@ static float shader_leveltime = 0; "float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \ "float startmap = (15.0 - lightnum) * 4.0;\n" \ "float scale = 160.0 / (lightz + 1.0);\n" \ - "return startmap * 1.06 - scale * 0.5 * 1.15;\n" \ + "float cap = (155.0 - light) * 0.26;\n" \ + "return max(startmap * 1.06 - scale * 0.5 * 1.15, cap);\n" \ "}\n" -// 1.06 and 1.15 were chosen when trying to match software lighting in a test map - #define GLSL_DOOM_COLORMAP \ "float R_DoomColormap(float light, float z)\n" \ "{\n" \ @@ -715,7 +714,8 @@ static float shader_leveltime = 0; "float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \ "float startmap = (15.0 - lightnum) * 4.0;\n" \ "float scale = 160.0 / (lightz + 1.0);\n" \ - "return startmap * 1.05 - scale * 1.0 * 1.1;\n" \ + "float cap = (155.0 - light) * 0.26;\n" \ + "return max(startmap * 1.05 - scale * 0.5 * 2.2, cap);\n" \ "}\n" #define GLSL_DOOM_LIGHT_EQUATION \