Fix normalmap too

This commit is contained in:
vlj 2014-04-06 23:26:45 +02:00 committed by Vincent Lejeune
parent 79c6424703
commit 858c8c7605

View File

@ -4,7 +4,7 @@ uniform sampler2D normalMap;
in vec3 tangent;
in vec3 bitangent;
in vec2 uv;
out vec2 EncodedNormal;
out vec3 EncodedNormal;
#else
varying vec3 tangent;
varying vec3 bitangent;
@ -26,5 +26,6 @@ void main()
vec3 Frag_bitangent = cross(Frag_normal, Frag_tangent);
vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent - TS_normal.z * Frag_normal;
EncodedNormal = 0.5 * EncodeNormal(normalize(FragmentNormal)) + 0.5;
EncodedNormal.xy = 0.5 * EncodeNormal(normalize(FragmentNormal)) + 0.5;
EncodedNormal.z = 1.;
}