11 uniform mat4 projection;
16 uniform vec3 vLightPos;
17 uniform vec3 vViewPos;
24 vec4 pos = model * vec4(vPosition, 1.f);
28 vec3 T = normalize(vec3(model * vec4(tangent, 0.0)));
29 vec3 B = normalize(vec3(model * vec4(bitangent, 0.0)));
30 vec3 N = normalize(vec3(model * vec4(vNormal, 0.0)));
31 // convert TBN to world->tangent space
32 mat3 TBN = transpose(mat3(T, B, N));
34 lightPos = TBN * vLightPos;
35 viewPos = TBN * vViewPos;
36 fragPos = TBN * vec3(pos);
37 defNormal = TBN * mat3(transpose(inverse(model))) * vNormal;
39 gl_Position = projection * view * pos;