From 598038b7f210165337573faacde962a5a9476f41 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sun, 12 Jan 2020 07:45:10 +0000 Subject: [PATCH] Remove some fixed-function logic from the worldsurf glsl. --- Quake/r_world.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Quake/r_world.c b/Quake/r_world.c index 4f10525b..b192d9c6 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -840,12 +840,14 @@ void GLWorld_CreateShaders (void) "attribute vec2 LMCoords;\n" "\n" "varying float FogFragCoord;\n" + "varying vec2 tc_tex;\n" + "varying vec2 tc_lm;\n" "\n" "void main()\n" "{\n" - " gl_TexCoord[0] = vec4(TexCoords, 0.0, 0.0);\n" - " gl_TexCoord[1] = vec4(LMCoords, 0.0, 0.0);\n" - " gl_Position = gl_ModelViewProjectionMatrix * Vert;\n" + " tc_tex = TexCoords;\n" + " tc_lm = LMCoords;\n" + " gl_Position = gl_ModelViewProjectionMatrix * vec4(Vert, 1.0);\n" " FogFragCoord = gl_Position.w;\n" "}\n"; @@ -861,17 +863,19 @@ void GLWorld_CreateShaders (void) "uniform float Alpha;\n" "\n" "varying float FogFragCoord;\n" + "varying vec2 tc_tex;\n" + "varying vec2 tc_lm;\n" "\n" "void main()\n" "{\n" - " vec4 result = texture2D(Tex, gl_TexCoord[0].xy);\n" + " vec4 result = texture2D(Tex, tc_tex.xy);\n" " if (UseAlphaTest && (result.a < 0.666))\n" " discard;\n" - " result *= texture2D(LMTex, gl_TexCoord[1].xy);\n" + " result *= texture2D(LMTex, tc_lm.xy);\n" " if (UseOverbright)\n" " result.rgb *= 2.0;\n" " if (UseFullbrightTex)\n" - " result += texture2D(FullbrightTex, gl_TexCoord[0].xy);\n" + " result += texture2D(FullbrightTex, tc_tex.xy);\n" " result = clamp(result, 0.0, 1.0);\n" " float fog = exp(-gl_Fog.density * gl_Fog.density * FogFragCoord * FogFragCoord);\n" " fog = clamp(fog, 0.0, 1.0);\n"