]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - shader_glsl.h
implemented use of GL_ARB_uniform_buffer_object for r_glsl_skeletal
[xonotic/darkplaces.git] / shader_glsl.h
index b0993440bc870434fbfec275eab69ecc4427814c..3e300d2207b72fd0bbbaca4df07909ce67f4d662 100644 (file)
@@ -18,7 +18,7 @@
 "# endif\n",
 "#endif\n",
 "\n",
-"#ifdef GLSL130\n",
+"#if defined(GLSL130) || defined(GLSL140)\n",
 "precision highp float;\n",
 "# ifdef VERTEX_SHADER\n",
 "#  define dp_varying out\n",
 "dp_attribute vec4 Attrib_TexCoord4; // lightmap texcoords\n",
 "#ifdef USESKELETAL\n",
 "//uniform mat4 Skeletal_Transform[128];\n",
-"uniform vec4 Skeletal_Transform12[768];\n",
+"// this is used with glBindBufferRange to bind a uniform block to the name\n",
+"// Skeletal_Transform12_UniformBlock, the Skeletal_Transform12 variable is\n",
+"// directly accessible without a namespace.\n",
+"// explanation: http://www.opengl.org/wiki/Interface_Block_%28GLSL%29#Syntax\n",
+"uniform Skeletal_Transform12_UniformBlock\n",
+"{\n",
+"      vec4 Skeletal_Transform12[768];\n",
+"};\n",
 "dp_attribute vec4 Attrib_SkeletalIndex;\n",
 "dp_attribute vec4 Attrib_SkeletalWeight;\n",
 "#endif\n",