Okay here’s the deal, i have a world sized 16,215,777x16,215,777, a huge world, generated by chunks, the problem tho is that because the world is so big, the shadows disappear somewhere, i tried this:
Are your directional lights moving in real time?
In my case (terrain with static directional lights and trees/objects) I solved this by creating an offscreen scene working like a “photobooth” with similar light settings of the main scene.
before displaying the main scene, I move each instance of any tree/objects with their individual rotation in the “photobooth”, catch their projected shadows on canvas texture, then merge them with the terrain’s material at the correct UV/position. It’s super cheap and still allow realtime shadow (like moving characters) on top of it.
Depending the cases, you may use the lightmap layer of your terrain material.
this way you keep the shadows as separate image source.
This method is only good for very very large terrain with basic objects like trees, when even the most optimized light setup would kill the framerate, It doesn’t solve convoluted structures, I may provide some basic code if needed, it’s still quite tricky to pull off
To answer this specific part: you need to update light’s target matrix if you change it’s position. directionalLight.target.updateMatrixWorld();
it’s not mentioned anywhere in the docs tho
OMFG… dude i ignored it until u said that… how dumb can i be… anyways thanks, btw… anyway you know of to also make the light offset around so that i could make it rotate around the player based on the time?