From: uis Date: Wed, 3 Jan 2024 15:56:28 +0000 (+0300) Subject: Reduce amount of attributes for depth pass X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=212c9c1a9b23bbf1b084280526dcc47162ec7613;p=xonotic%2Fdarkplaces.git Reduce amount of attributes for depth pass Use fragment depth from built-in gl_FragCoord instead of our own depth attribute --- diff --git a/shader_glsl.h b/shader_glsl.h index 36542c53..10c4347b 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -172,7 +172,6 @@ "#endif\n", "\n", "#ifdef MODE_DEPTH_OR_SHADOW\n", -"dp_varying highp float Depth;\n", "#ifdef VERTEX_SHADER\n", "void main(void)\n", "{\n", @@ -192,7 +191,6 @@ "#ifdef USETRIPPY\n", " gl_Position = TrippyVertex(gl_Position);\n", "#endif\n", -" Depth = gl_Position.z;\n", "}\n", "#endif\n", "\n", @@ -200,7 +198,7 @@ "void main(void)\n", "{\n", "#ifdef USEDEPTHRGB\n", -" dp_FragColor = encodedepthmacro(Depth);\n", +" dp_FragColor = encodedepthmacro(gl_FragCoord.z);\n", "#else\n", " dp_FragColor = vec4(1.0,1.0,1.0,1.0);\n", "#endif\n",