2020-02-16 22:28:24 -08:00
|
|
|
#version 330 core
|
|
|
|
|
|
|
|
layout (location = 0) in vec3 VertPosition;
|
2020-02-17 18:10:15 -08:00
|
|
|
layout (location = 1) in vec3 VertNormal ;
|
2020-02-20 14:18:08 -08:00
|
|
|
layout (location = 2) in vec3 VertTexture ;
|
2020-02-18 14:19:55 -08:00
|
|
|
|
2020-02-18 11:37:17 -08:00
|
|
|
out vec3 FragPosition ;
|
|
|
|
out vec3 Normal ;
|
|
|
|
out vec3 LightViewPosition;
|
|
|
|
out vec3 LightRawPos;
|
2020-02-17 18:10:15 -08:00
|
|
|
|
2020-02-16 22:28:24 -08:00
|
|
|
uniform mat4 InverseModelSpace;
|
|
|
|
|
2020-02-18 11:37:17 -08:00
|
|
|
uniform mat4 ModelSpace;
|
|
|
|
uniform mat4 Viewport ;
|
|
|
|
uniform mat4 Projection;
|
|
|
|
|
|
|
|
uniform vec3 LightPosition;
|
|
|
|
|
2020-02-16 22:28:24 -08:00
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2020-02-18 11:37:17 -08:00
|
|
|
gl_Position = Projection * Viewport * ModelSpace * vec4(VertPosition, 1.0);
|
|
|
|
|
|
|
|
FragPosition = vec3(Viewport * ModelSpace * vec4(VertPosition, 1.0));
|
2020-02-16 22:28:24 -08:00
|
|
|
|
2020-02-18 14:19:55 -08:00
|
|
|
Normal = mat3(transpose(inverse(Viewport * ModelSpace))) * VertNormal;
|
2020-02-16 22:28:24 -08:00
|
|
|
|
2020-02-18 11:37:17 -08:00
|
|
|
LightViewPosition = vec3(Viewport * vec4(LightPosition, 1.0));
|
|
|
|
|
|
|
|
LightRawPos = LightPosition;
|
2020-02-16 22:28:24 -08:00
|
|
|
}
|