I am trying to shadowmap a large terrain, I position my light that it is always at the position of the player and looking at the player, the problem is that the shadows now move with the player, I tried to set the position to 0 1000 500 and look at the player always and its a good improvement however the player moves out of the light there are now no shadows :(

How am I supposed to make the light so it covers the entire terrain and everything has shadows all the time without the shadow moving effect?

I am really stuck right now, do I need to somehow calculate scene bounds? would that help at all?

• Why should I use an orthographic viewport? Because it's assumed that a directional light ( i.e the sun ) has all of its light rays in one parallel direction. – Sidar Nov 20 '17 at 15:23