]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Reduce amount of attributes for depth pass
authoruis <uis9936@gmail.com>
Wed, 3 Jan 2024 15:56:28 +0000 (18:56 +0300)
committeruis <uis9936@gmail.com>
Wed, 3 Jan 2024 15:56:28 +0000 (18:56 +0300)
Use fragment depth from built-in gl_FragCoord instead of our own depth attribute

shader_glsl.h

index 5a4b224a2e88b31b1363444828ed5c824cb78317..c729bc6fc8fe0e435930d99f4e763ad8d22a4aa5 100644 (file)
 "#endif\n",
 "\n",
 "#ifdef MODE_DEPTH_OR_SHADOW\n",
-"dp_varying highp float Depth;\n",
 "#ifdef VERTEX_SHADER\n",
 "void main(void)\n",
 "{\n",
 "#ifdef USETRIPPY\n",
 "      gl_Position = TrippyVertex(gl_Position);\n",
 "#endif\n",
-"      Depth = gl_Position.z;\n",
 "}\n",
 "#endif\n",
 "\n",
 "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",