#version 150 in vec3 position; in vec2 texCoord; in vec3 normal; in vec4 color; uniform mat4 projectionTransform; uniform mat4 viewTransform; uniform mat4 modelTransform; uniform mat3 normalMatrix; uniform vec4 frontColor; uniform vec4 backColor; out vec3 vertPosition; out vec2 vertTexCoord; out vec3 vertNormal; out vec4 vertColor; void main() { vec4 modelPosition = modelTransform * vec4(position, 1.0); vertPosition = vec3(modelPosition); vertColor = backColor + vec4(color.r * color.a, color.g * color.a, color.b * color.a, color.a) * frontColor * (vec4(1.0, 1.0, 1.0, 1.0) - backColor); vertTexCoord = texCoord; vertNormal = normalMatrix * normal; gl_Position = projectionTransform * viewTransform * modelPosition; }