From 70b3d2475f229809b59d559ffaf4f95e8ea58f28 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 14 Aug 2012 00:26:21 +0300 Subject: [PATCH] Tangent and binormal vectors should use custom transform as well --- source/program.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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", -- 2.45.2