]> git.tdb.fi Git - libs/gl.git/commitdiff
Tangent and binormal vectors should use custom transform as well
authorMikko Rasa <tdb@tdb.fi>
Mon, 13 Aug 2012 21:26:21 +0000 (00:26 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 13 Aug 2012 21:26:21 +0000 (00:26 +0300)
source/program.cpp

index 02e0a1b4dea75ca5e3768bac82ab5be5311b01b3..ea1f30d2aea724cc9e9b10e2bcdf531accc48bb7 100644 (file)
@@ -30,8 +30,10 @@ const char *standard_vertex_src[] =
        "lr",  "\tvec3 eye_normal = transform_normal(gl_Normal);\n",
        "l!r", "\tvec3 eye_normal = gl_NormalMatrix*gl_Normal;\n",
        "l!n", "\tv_normal = eye_normal;\n",
-       "n",   "\tvec3 eye_tangent = gl_NormalMatrix*tangent;\n",
-       "n",   "\tvec3 eye_binormal = gl_NormalMatrix*binormal;\n",
+       "nr",  "\tvec3 eye_tangent = transform_normal(tangent);\n",
+       "n!r", "\tvec3 eye_tangent = gl_NormalMatrix*tangent;\n",
+       "nr",  "\tvec3 eye_binormal = transform_normal(binormal);\n",
+       "n!r", "\tvec3 eye_binormal = gl_NormalMatrix*binormal;\n",
        "l",   "\tvec3 eye_light_dir = normalize(gl_LightSource[0].position.xyz-eye_pos.xyz*gl_LightSource[0].position.w);\n",
        "n",   "\tv_light_dir = vec3(dot(eye_tangent, eye_light_dir), dot(eye_binormal, eye_light_dir), dot(eye_normal, eye_light_dir));\n",
        "l!n", "\tv_light_dir = eye_light_dir;\n",