]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.cpp
Provide the necessary uniforms from ShadowMap
[libs/gl.git] / source / program.cpp
index adbb5c4cfd1a4ccf7ffd3fe41dc75646c33a1a6c..f11206677b94890ebe7d89dfdeefbc5af425e7f4 100644 (file)
@@ -17,6 +17,7 @@ namespace {
 
 const char *standard_vertex_src[] =
 {
+       "s",   "uniform int shadow_unit;\n",
        "n",   "attribute vec3 tangent;\n",
        "n",   "attribute vec3 binormal;\n",
        "t|n", "varying vec2 v_texcoord;\n",
@@ -46,7 +47,7 @@ const char *standard_vertex_src[] =
        "p|en",  "\tv_eye_dir = vec3(dot(eye_tangent, eye_dir), dot(eye_binormal, eye_dir), dot(eye_normal, eye_dir));\n",
        "p|e!n", "\tv_eye_dir = eye_dir;\n",
        "t|n", "\tv_texcoord = gl_MultiTexCoord0.xy;\n",
-       "s",   "\tv_shadowcoord = vec3(dot(gl_EyePlaneS[3], eye_pos), dot(gl_EyePlaneT[3], eye_pos), dot(gl_EyePlaneR[3], eye_pos));\n",
+       "s",   "\tv_shadowcoord = vec3(dot(gl_EyePlaneS[shadow_unit], eye_pos), dot(gl_EyePlaneT[shadow_unit], eye_pos), dot(gl_EyePlaneR[shadow_unit], eye_pos));\n",
        "!lm", "\tv_color = gl_Color;\n",
         0,    "}",
        0, 0