From 1371cfb247b7f64e58ddab4ec7d1aa2ac43699f7 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 20 Nov 2026 12:16:21 +0100 Subject: [PATCH] Revert "scale the ripple shader in gl" This reverts commit 89f226dde50fa748aca019733c8ddd0f5c919368. --- src/hardware/hw_defs.h | 1 - src/hardware/hw_main.cpp | 2 ++ src/hardware/hw_shaders.h | 11 +++++------ src/hardware/r_opengl/r_opengl.c | 15 --------------- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 67a90f468..40e8af249 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -339,7 +339,6 @@ enum hwdshaderinfo HWD_SHADERINFO_LIGHT_Z, HWD_SHADERINFO_LIGHT_CONTRAST, HWD_SHADERINFO_LIGHT_BACKLIGHT, - HWD_SHADERINFO_FLATSIZE, }; typedef enum hwdshaderinfo hwdshaderinfo_t; diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index dc4b70d13..6e950d0b5 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -733,7 +733,9 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool if (PolyFlags & PF_Fog) shader = SHADER_FOG; else if (cv_ripplewater.value && (PolyFlags & PF_Ripple)) + { shader = SHADER_WATER; + } else shader = SHADER_FLOOR; diff --git a/src/hardware/hw_shaders.h b/src/hardware/hw_shaders.h index 202565f43..0e65dd0b5 100644 --- a/src/hardware/hw_shaders.h +++ b/src/hardware/hw_shaders.h @@ -235,16 +235,17 @@ #define GLSL_WATER_CONST \ "const float freq = 0.07;\n" \ "const float amp = 0.07;\n" \ - "const float speed = 3.8;\n" \ + "const float amp_t = 0.025;\n" \ + "const float speed = 4.0;\n" \ "const float pi = 3.14159;\n" \ - "const float falltresh = 0.007;\n" + "const float falltresh = 0.007;\n" \ #define GLSL_WATER_TEXEL \ "float water_z = (gl_FragCoord.z / gl_FragCoord.w) / 2.0;\n" \ "float a = -pi * (water_z * freq) + (leveltime * speed);\n" \ "float falloff = 1.0 / (1.0 + water_z * falltresh);\n" \ - "float distort = sin(a) * amp * falloff * (64.0 / flat_size);\n" \ - "vec4 texel = texture2D(tex, vec2(gl_TexCoord[0].s - distort, gl_TexCoord[0].t));\n" + "float distort = sin(a) * amp * falloff;\n" \ + "vec4 texel = texture2D(tex, vec2(gl_TexCoord[0].s - distort, gl_TexCoord[0].t));\n" \ #define GLSL_WATER_FRAGMENT_SHADER \ "#version 120\n" \ @@ -257,7 +258,6 @@ "uniform vec4 poly_color;\n" \ "uniform float lighting;\n" \ "uniform float leveltime;\n" \ - "uniform float flat_size;\n" \ GLSL_DOOM_COLORMAP \ "void main(void) {\n" \ GLSL_WATER_TEXEL \ @@ -272,7 +272,6 @@ "uniform float fade_start;\n" \ "uniform float fade_end;\n" \ "uniform float leveltime;\n" \ - "uniform float flat_size;\n" \ GLSL_DOOM_COLORMAP \ GLSL_DOOM_LIGHT_EQUATION \ "void main(void) {\n" \ diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 0318eec2c..8d6626791 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -771,8 +771,6 @@ typedef enum // misc. gluniform_leveltime, - gluniform_flatsize, - gluniform_scr_resolution, // postprocess stuff @@ -814,8 +812,6 @@ static float shader_light_z = 0.0f; static INT32 shader_light_contrast = 0; static INT32 shader_light_backlight = 0; -static INT32 shader_flatsize = 64; - static float shader_vhs_rewind = 1.0f; static float shader_vhs_time = 0.0f; @@ -1115,9 +1111,6 @@ void GL_SetShaderInfo(hwdshaderinfo_t info, INT32 value) case HWD_SHADERINFO_LIGHT_BACKLIGHT: shader_light_backlight = value; break; - case HWD_SHADERINFO_FLATSIZE: - shader_flatsize = value; - break; default: break; } @@ -2251,7 +2244,6 @@ void GL_SetTexture(GLMipmap_t *pTexInfo) if (!pTexInfo) { GL_SetNoTexture(); - GL_SetShaderInfo(HWD_SHADERINFO_FLATSIZE, 0); return; } @@ -2285,8 +2277,6 @@ void GL_SetTexture(GLMipmap_t *pTexInfo) else // initialization of the linked list TexCacheTail = TexCacheHead = newTex; } - - GL_SetShaderInfo(HWD_SHADERINFO_FLATSIZE, (INT32)pTexInfo->width); } static void GL_Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade) @@ -2362,9 +2352,6 @@ static void GL_Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRG UNIFORM_2(shader->uniforms[gluniform_scr_resolution], (GLfloat)screen_width, (GLfloat)screen_height, pglUniform2f); - // super annoying, if only we could ditch glsl 1.20 and older..... - UNIFORM_1(shader->uniforms[gluniform_flatsize], (GLfloat)shader_flatsize, pglUniform1f); - // grrrrr stupid 2.0 support.. used similar to yfix, xfix UNIFORM_2(shader->uniforms[gluniform_scr_tex_size], (GLfloat)screen_texsizew, (GLfloat)screen_texsizeh, pglUniform2f); @@ -2503,8 +2490,6 @@ static boolean GL_Shader_CompileProgram(gl_shader_t *shader, GLint i) // misc. shader->uniforms[gluniform_leveltime] = GETUNI("leveltime"); - shader->uniforms[gluniform_flatsize] = GETUNI("flat_size"); - // postprocessor stuff (water/heat effect) shader->uniforms[gluniform_scr_tex_size] = GETUNI("scr_tex_size");