Defucked defucked rendering

This commit is contained in:
2014-05-07 22:34:38 +02:00
parent b1b60bce61
commit 62ca923821
13 changed files with 207 additions and 113 deletions
+5 -3
View File
@@ -1,7 +1,9 @@
#version 430
uniform mat4 MVP;
uniform mat4 ModelMatrix;
uniform mat4 M;
uniform mat4 V;
uniform mat4 P;
layout (location = 0) in vec3 Position;
layout (location = 1) in vec3 Normal;
@@ -18,7 +20,7 @@ void main()
{
gl_Position = MVP * vec4(Position, 1.0);
Output.Position = gl_Position.xyz;
Output.Normal = normalize((ModelMatrix * vec4(Normal, 0.0)).xyz);
Output.Position = vec3(V * M * vec4(Position, 1.0));
Output.Normal = normalize(vec3(inverse(transpose(V * M)) * vec4(Normal, 0.0)));
Output.TextureCoord = TextureCoord;
}