From 212c9c1a9b23bbf1b084280526dcc47162ec7613 Mon Sep 17 00:00:00 2001 From: uis Date: Wed, 3 Jan 2024 18:56:28 +0300 Subject: [PATCH] Reduce amount of attributes for depth pass Use fragment depth from built-in gl_FragCoord instead of our own depth attribute --- shader_glsl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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", -- 2.39.2