From c2d37dfb618dc6213bd2ce74990af094b1fd5396 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 9 Jan 2024 13:38:24 +0100 Subject: [PATCH] use og values for pal --- src/hardware/r_opengl/r_opengl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 37b291138..5f6d907b7 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -705,8 +705,7 @@ 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" \ - "float cap = (155.0 - light) * 0.26;\n" \ - "return max(startmap * STARTMAP_FUDGE - scale * 0.5 * SCALE_FUDGE, cap);\n" \ + "return (startmap * STARTMAP_FUDGE - scale * MULT_FUDGE * SCALE_FUDGE);\n" \ "}\n" #define GLSL_DOOM_LIGHT_EQUATION \ @@ -758,11 +757,13 @@ static float shader_leveltime = 0; #define GLSL_FLOOR_FUDGES \ "#define STARTMAP_FUDGE 1.06\n" \ + "#define MULT_FUDGE 0.5\n" \ "#define SCALE_FUDGE 1.15\n" #define GLSL_WALL_FUDGES \ "#define STARTMAP_FUDGE 1.05\n" \ - "#define SCALE_FUDGE 2.2\n" + "#define MULT_FUDGE 1.0\n" \ + "#define SCALE_FUDGE 1.1\n" #define GLSL_SOFTWARE_FRAGMENT_SHADER_FLOORS \ GLSL_SOFTWARE_UNIFORMS \ @@ -915,7 +916,7 @@ static float shader_leveltime = 0; "uniform int palette[768];\n" \ "void main(void) {\n" \ "vec3 texel = vec3(texture2D(tex, gl_TexCoord[0].st));\n" \ - "int pal_idx = int(texture3D(lookup_tex, vec3((texel * 63.0 + 0.5) / 64.0))[0] * 255.0);\n" \ + "int pal_idx = int(texture3D(lookup_tex, vec3((63.0/64.0) * texel + 1.0 / 128.0))[0] * 255.0);\n" \ "gl_FragColor = vec4(float(palette[pal_idx*3])/255.0, float(palette[pal_idx*3+1])/255.0, float(palette[pal_idx*3+2])/255.0, 1.0);\n" \ "}\0"