]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - shader_glsl.h
Build in subdirs
[xonotic/darkplaces.git] / shader_glsl.h
index 3e300d2207b72fd0bbbaca4df07909ce67f4d662..b8a441b0a4c3b5fd96761ff80c69d2a316ad1d87 100644 (file)
@@ -2,6 +2,25 @@
 "// written by Forest 'LordHavoc' Hale\n",
 "// shadowmapping enhancements by Lee 'eihrul' Salzman\n",
 "\n",
+"#ifdef USESKELETAL\n",
+"#  ifdef GL_ARB_uniform_buffer_object\n",
+"#    extension GL_ARB_uniform_buffer_object : enable\n",
+"#  endif\n",
+"#endif\n",
+"\n",
+"#ifdef USESHADOWMAP2D\n",
+"# ifdef GL_EXT_gpu_shader4\n",
+"#   extension GL_EXT_gpu_shader4 : enable\n",
+"# endif\n",
+"# ifdef GL_ARB_texture_gather\n",
+"#   extension GL_ARB_texture_gather : enable\n",
+"# else\n",
+"#   ifdef GL_AMD_texture_texture4\n",
+"#     extension GL_AMD_texture_texture4 : enable\n",
+"#   endif\n",
+"# endif\n",
+"#endif\n",
+"\n",
 "#ifdef USECELSHADING\n",
 "# define SHADEDIFFUSE myhalf diffuse = cast_myhalf(min(max(float(dot(surfacenormal, lightnormal)) * 2.0, 0.0), 1.0));\n",
 "# ifdef USEEXACTSPECULARMATH\n",
 "# define USEEYEVECTOR\n",
 "#endif\n",
 "\n",
-"#ifdef USESHADOWMAP2D\n",
-"# ifdef GL_EXT_gpu_shader4\n",
-"#   extension GL_EXT_gpu_shader4 : enable\n",
-"# endif\n",
-"# ifdef GL_ARB_texture_gather\n",
-"#   extension GL_ARB_texture_gather : enable\n",
-"# else\n",
-"#   ifdef GL_AMD_texture_texture4\n",
-"#     extension GL_AMD_texture_texture4 : enable\n",
-"#   endif\n",
-"# endif\n",
-"#endif\n",
-"\n",
-"//#ifdef USESHADOWSAMPLER\n",
-"//# extension GL_ARB_shadow : enable\n",
-"//#endif\n",
-"\n",
 "//#ifdef __GLSL_CG_DATA_TYPES\n",
 "//# define myhalf half\n",
 "//# define myhalf2 half2\n",
 "void main(void)\n",
 "{\n",
 "      dp_FragColor = dp_texture2D(Texture_First, TexCoord1);\n",
-"#ifdef USEBLOOM\n",
-"      dp_FragColor += max(vec4(0,0,0,0), dp_texture2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n",
-"#endif\n",
-"#ifdef USEVIEWTINT\n",
-"      dp_FragColor = mix(dp_FragColor, ViewTintColor, ViewTintColor.a);\n",
-"#endif\n",
 "\n",
 "#ifdef USEPOSTPROCESSING\n",
 "// do r_glsl_dumpshader, edit glsl/default.glsl, and replace this by your own postprocessing if you want\n",
 "      dp_FragColor.rgb = dp_FragColor.rgb * (1.0 + UserVec2.x) + vec3(max(0.0, sobel - UserVec2.z))*UserVec2.y;\n",
 "#endif\n",
 "\n",
+"#ifdef USEBLOOM\n",
+"      dp_FragColor += max(vec4(0,0,0,0), dp_texture2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n",
+"#endif\n",
+"\n",
+"#ifdef USEVIEWTINT\n",
+"      dp_FragColor = mix(dp_FragColor, ViewTintColor, ViewTintColor.a);\n",
+"#endif\n",
+"\n",
 "#ifdef USESATURATION\n",
 "      //apply saturation BEFORE gamma ramps, so v_glslgamma value does not matter\n",
 "      float y = dot(dp_FragColor.rgb, vec3(0.299, 0.587, 0.114));\n",