From: Mikko Rasa Date: Mon, 13 Aug 2012 21:26:21 +0000 (+0300) Subject: Tangent and binormal vectors should use custom transform as well X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=70b3d2475f229809b59d559ffaf4f95e8ea58f28;p=libs%2Fgl.git Tangent and binormal vectors should use custom transform as well --- diff --git a/source/program.cpp b/source/program.cpp index 02e0a1b4..ea1f30d2 100644 --- a/source/program.cpp +++ b/source/program.cpp @@ -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",