#version 150 in vec3 position; in vec2 texCoord; in vec3 normal; in vec4 tangent; in vec4 color; uniform mat4 projectionTransform; uniform mat4 viewTransform; uniform mat4 modelTransform; uniform mat3 normalMatrix; uniform vec4 materialColor; out vec3 vertPosition; out vec2 vertTexCoord; out mat3 vertTBNMatrix; out vec4 vertColor; void main() { vec4 modelPosition = modelTransform * vec4(position, 1.0); vertPosition = vec3(modelPosition); vertTexCoord = texCoord; vertColor = color * materialColor; vec3 orientedNormal = normalMatrix * normal; vec3 tangentXYZ = normalMatrix * tangent.xyz; vec3 bitangent = tangent.w * cross(normal, tangentXYZ); vertTBNMatrix = mat3(tangentXYZ, bitangent, orientedNormal); gl_Position = projectionTransform * viewTransform * modelPosition; }