2018-04-10 14:08:28 +02:00
|
|
|
#version 150 core
|
|
|
|
|
|
|
|
in vec4 inCoord;
|
|
|
|
in vec3 inNormal;
|
|
|
|
in vec2 inUV;
|
|
|
|
in vec4 inColor;
|
|
|
|
|
|
|
|
uniform mat4 uModelMatrix;
|
|
|
|
uniform mat4 uViewMatrix;
|
|
|
|
uniform mat4 uProjectionMatrix;
|
2019-04-23 23:17:10 +02:00
|
|
|
uniform mat4 uLightSpaceMatrix;
|
2018-04-10 14:08:28 +02:00
|
|
|
|
|
|
|
out vec3 ioFragPosition;
|
|
|
|
out vec3 ioFragNormal;
|
|
|
|
out vec2 ioFragTexCoords;
|
|
|
|
out vec4 ioFragColor;
|
2019-04-23 23:17:10 +02:00
|
|
|
out vec4 ioFragPosLightSpace;
|
2018-04-10 14:08:28 +02:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
mat4 model_view_matrix = uViewMatrix * uModelMatrix;
|
|
|
|
|
|
|
|
ioFragPosition = (model_view_matrix * inCoord).xyz;
|
|
|
|
ioFragNormal = transpose(inverse(mat3(model_view_matrix))) * inNormal;
|
|
|
|
ioFragTexCoords = inUV;
|
|
|
|
ioFragColor = inColor;
|
2019-04-23 23:17:10 +02:00
|
|
|
ioFragPosLightSpace = uLightSpaceMatrix * uModelMatrix * inCoord;
|
2018-04-10 14:08:28 +02:00
|
|
|
|
|
|
|
gl_Position = uProjectionMatrix * model_view_matrix * inCoord;
|
|
|
|
}
|