2014-10-20 15:31:26 +00:00
|
|
|
#version 150
|
|
|
|
|
2014-11-13 00:22:33 +00:00
|
|
|
uniform mat4 modelMatrix;
|
2014-12-15 10:45:31 +00:00
|
|
|
uniform mat4 modelViewProjectionMatrix;
|
2014-12-15 12:23:35 +00:00
|
|
|
uniform mat4 shadowMVPs[5];
|
2014-10-20 15:31:26 +00:00
|
|
|
|
|
|
|
in vec3 aPosition;
|
2014-11-14 17:32:23 +00:00
|
|
|
in vec3 aNormal;
|
2014-10-20 15:31:26 +00:00
|
|
|
in vec2 aTexCoord;
|
|
|
|
|
|
|
|
out vec3 vNormal;
|
|
|
|
out vec2 vTexCoord;
|
2014-11-03 23:47:35 +00:00
|
|
|
out vec4 fragPosition;
|
2015-02-28 13:40:54 +00:00
|
|
|
out vec4 shadowCoord0;
|
|
|
|
out vec4 shadowCoord1;
|
|
|
|
out vec4 shadowCoord2;
|
2015-05-31 15:36:21 +00:00
|
|
|
out vec4 shadowCoord3;
|
|
|
|
out vec4 shadowCoord4;
|
2014-10-20 15:31:26 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-11-13 00:22:33 +00:00
|
|
|
fragPosition = modelMatrix * vec4(aPosition, 1.0);
|
|
|
|
vNormal = inverse(transpose(mat3(modelMatrix))) * aNormal;
|
2014-10-20 15:31:26 +00:00
|
|
|
vTexCoord = aTexCoord;
|
2015-02-28 13:40:54 +00:00
|
|
|
shadowCoord0 = shadowMVPs[0] * vec4(aPosition, 1.0);
|
|
|
|
shadowCoord1 = shadowMVPs[1] * vec4(aPosition, 1.0);
|
|
|
|
shadowCoord2 = shadowMVPs[2] * vec4(aPosition, 1.0);
|
2015-05-31 15:36:21 +00:00
|
|
|
shadowCoord3 = shadowMVPs[3] * vec4(aPosition, 1.0);
|
|
|
|
shadowCoord4 = shadowMVPs[4] * vec4(aPosition, 1.0);
|
2014-12-15 10:45:31 +00:00
|
|
|
gl_Position = modelViewProjectionMatrix * vec4(aPosition, 1.0);
|
2014-10-20 15:31:26 +00:00
|
|
|
}
|