Working shadows, however ugly they are.

This commit is contained in:
Tleety
2014-05-12 18:03:39 +02:00
parent d9ca9ac1f7
commit 4639a6e4c3
8 changed files with 136 additions and 55 deletions
+3
View File
@@ -4,6 +4,7 @@ uniform mat4 MVP;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
uniform mat4 DepthMVP;
layout (location = 0) in vec3 Position;
layout (location = 1) in vec3 Normal;
@@ -14,6 +15,7 @@ out VertexData
vec3 Position;
vec3 Normal;
vec2 TextureCoord;
vec4 ShadowCoord;
} Output;
void main()
@@ -23,4 +25,5 @@ void main()
Output.Position = vec3(V * M * vec4(Position, 1.0));
Output.Normal = normalize(vec3(inverse(transpose(V * M)) * vec4(Normal, 0.0)));
Output.TextureCoord = TextureCoord;
Output.ShadowCoord = DepthMVP * vec4(Position, 1.0);
}