diff --git a/data/shaders/shadow.vert b/data/shaders/shadow.vert index 0e26cdb4f..d1212e7ea 100644 --- a/data/shaders/shadow.vert +++ b/data/shaders/shadow.vert @@ -8,10 +8,8 @@ layout (std140) uniform MatrixesData }; uniform mat4 ModelMatrix; -uniform vec3 windDir; layout(location = 0) in vec3 Position; -layout(location = 2) in vec4 Color; layout(location = 3) in vec2 Texcoord; #ifdef VSLayer @@ -26,10 +24,10 @@ void main(void) #ifdef VSLayer gl_Layer = gl_InstanceID & 3; uv = Texcoord; - gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position + windDir * Color.r, 1.); + gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position, 1.); #else layerId = gl_InstanceID & 3; tc = Texcoord; - gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position + windDir * Color.r, 1.); + gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position, 1.); #endif } diff --git a/data/shaders/shadow_grass.vert b/data/shaders/shadow_grass.vert index d1212e7ea..0e26cdb4f 100644 --- a/data/shaders/shadow_grass.vert +++ b/data/shaders/shadow_grass.vert @@ -8,8 +8,10 @@ layout (std140) uniform MatrixesData }; uniform mat4 ModelMatrix; +uniform vec3 windDir; layout(location = 0) in vec3 Position; +layout(location = 2) in vec4 Color; layout(location = 3) in vec2 Texcoord; #ifdef VSLayer @@ -24,10 +26,10 @@ void main(void) #ifdef VSLayer gl_Layer = gl_InstanceID & 3; uv = Texcoord; - gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position, 1.); + gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position + windDir * Color.r, 1.); #else layerId = gl_InstanceID & 3; tc = Texcoord; - gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position, 1.); + gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position + windDir * Color.r, 1.); #endif }