]> 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>
Fri, 5 Jan 2024 15:25:32 +0000 (18:25 +0300)
Use fragment depth from built-in gl_FragCoord instead of our own depth attribute

shader_glsl.h

index 36542c53810ab34c673013cdc3d583e3ce4a7d7d..10c4347b6a4dbe3922888828311e526ceb123a9f 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",