I’m working on a game where you have a large map and your character walks around it. What I want to do is to add shadows for the world and have the shadow map follow you around so that everything around you has shadows, but when you walk away, those things which are are no longer in view are removed from the shadow map, so they no longer take up performance.
One of the main reasons I want to do this is illustrated here:
In this playground, you see that the shadows are pixelated. It seems to be because the shadow map is small, but it tries to stretch to cover all the meshes added, which makes the shadows blocky. If you remove it from the shadow map, or make the shadow map size bigger:
the shadows are not nearly as pixelated.