2014-04-10 11:34:57 -04:00
|
|
|
layout (std140) uniform MatrixesData
|
|
|
|
{
|
|
|
|
mat4 ViewMatrix;
|
|
|
|
mat4 ProjectionMatrix;
|
|
|
|
mat4 InverseViewMatrix;
|
|
|
|
mat4 InverseProjectionMatrix;
|
|
|
|
mat4 ShadowViewProjMatrixes[4];
|
|
|
|
};
|
2014-01-09 12:08:23 -05:00
|
|
|
|
2014-04-10 11:34:57 -04:00
|
|
|
uniform mat4 ModelMatrix;
|
|
|
|
uniform mat4 InverseModelMatrix;
|
2014-02-28 11:29:05 -05:00
|
|
|
|
|
|
|
#if __VERSION__ >= 130
|
2014-01-17 17:50:06 -05:00
|
|
|
in vec3 Position;
|
|
|
|
in vec2 Texcoord;
|
|
|
|
in vec3 Tangent;
|
|
|
|
in vec3 Bitangent;
|
2014-02-28 11:29:05 -05:00
|
|
|
out vec3 tangent;
|
|
|
|
out vec3 bitangent;
|
2014-01-09 12:08:23 -05:00
|
|
|
out vec2 uv;
|
2014-02-28 11:29:05 -05:00
|
|
|
#else
|
|
|
|
attribute vec3 Position;
|
|
|
|
attribute vec2 Texcoord;
|
|
|
|
attribute vec3 Tangent;
|
|
|
|
attribute vec3 Bitangent;
|
|
|
|
varying vec3 tangent;
|
|
|
|
varying vec3 bitangent;
|
|
|
|
varying vec2 uv;
|
|
|
|
#endif
|
|
|
|
|
2012-01-15 11:37:15 -05:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2014-04-10 11:34:57 -04:00
|
|
|
mat4 ModelViewProjectionMatrix = ProjectionMatrix * ViewMatrix * ModelMatrix;
|
|
|
|
mat4 TransposeInverseModelView = transpose(InverseModelMatrix * InverseViewMatrix);
|
2014-01-17 17:50:06 -05:00
|
|
|
uv = Texcoord;
|
|
|
|
tangent = (TransposeInverseModelView * vec4(Tangent, 1.)).xyz;
|
|
|
|
bitangent = (TransposeInverseModelView * vec4(Bitangent, 1.)).xyz;
|
|
|
|
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
|
2012-01-15 11:37:15 -05:00
|
|
|
|
2013-12-19 18:58:26 -05:00
|
|
|
}
|