In my scene, I have a few models rendered under a directional light. I currently have one of the models rotating on it's own axis and translating, but the problem I'm running into is that the shadow on that model is not being projected properly. Only models that aren't rotating have shadows in the correct position. How would I go about updating the light so that it would project correctly?
For my general vertex shader:
gl_Position = MVP * vec4(Translation + (Rotate * vec4(Position, 1.0)).xyz, 1.0);
for my shadow vertex shader:
gl_Position = gWVP * vec4(Position, 1.0);
TexCoordOut = TexCoord;
In my constructor, I initialize the directional light as such:
m_directionalLight.Color = COLOR_DAY_CLEARBLUE; // Light color
m_directionalLight.AmbientIntensity = 0.1f;
m_directionalLight.DiffuseIntensity = 1.005f;
m_directionalLight.Direction = glm::vec3(-1.0f, 1.0, 0.0);
The resulting screenshots as follow: