2014-07-13 15:33:44 -04:00
|
|
|
uniform mat4 ModelMatrix;
|
2014-07-13 15:37:12 -04:00
|
|
|
uniform vec3 windDir;
|
2014-07-13 15:33:44 -04:00
|
|
|
|
2014-07-16 20:17:49 -04:00
|
|
|
#if __VERSION__ >= 330
|
2014-07-13 15:33:44 -04:00
|
|
|
layout(location = 0) in vec3 Position;
|
2014-07-13 15:37:12 -04:00
|
|
|
layout(location = 2) in vec4 Color;
|
2014-07-13 15:33:44 -04:00
|
|
|
layout(location = 3) in vec2 Texcoord;
|
2014-07-16 20:17:49 -04:00
|
|
|
#else
|
|
|
|
in vec3 Position;
|
|
|
|
in vec4 Color;
|
|
|
|
in vec2 Texcoord;
|
|
|
|
#endif
|
2014-07-13 15:33:44 -04:00
|
|
|
|
|
|
|
#ifdef VSLayer
|
|
|
|
out vec2 uv;
|
|
|
|
#else
|
|
|
|
out vec2 tc;
|
|
|
|
out int layerId;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
#ifdef VSLayer
|
|
|
|
gl_Layer = gl_InstanceID & 3;
|
|
|
|
uv = Texcoord;
|
2014-07-13 15:37:12 -04:00
|
|
|
gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position + windDir * Color.r, 1.);
|
2014-07-13 15:33:44 -04:00
|
|
|
#else
|
|
|
|
layerId = gl_InstanceID & 3;
|
|
|
|
tc = Texcoord;
|
2014-07-13 15:37:12 -04:00
|
|
|
gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position + windDir * Color.r, 1.);
|
2014-07-13 15:33:44 -04:00
|
|
|
#endif
|
|
|
|
}
|