From a7e3676dd7fef874433785e95b4077b24e555840 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 5a4b224a..c729bc6f 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -173,7 +173,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", @@ -193,7 +192,6 @@ "#ifdef USETRIPPY\n", " gl_Position = TrippyVertex(gl_Position);\n", "#endif\n", -" Depth = gl_Position.z;\n", "}\n", "#endif\n", "\n", @@ -201,7 +199,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