Hello everyone,
I have been working on a project to recreate the Moon to scale using Unreal Engine 5.
However, I have an issue with the shadows. The crater you can see here is 21 km in diameter and 4 km deep.
I am using Virtual Shadow to achieve the best shadow effect with long-distance shadows, but, as you can see, the shadows end in a circle around the crater.
How can I increase the shadow distance? I need to cast a shadow over thousands of kilometres.
It is also worth mentioning that the terrain you see is generated using many tiles and the RealtimeMeshComponent.
I hope you will have a solution to my problem.
Hi StarkTech47,
did you try âr.Shadow.Virtual.Clipmap.LastLevelâ? Increasing this value should increase the range.
Maybe raytraced shadows would also do the trick.
1 Like
Hello SinnPhilipp,
I have tried this some hours ago by set it at 42 and it crashed the game. I just tried with 32 and it works great!
It is been a while I am have been looking for a solution, thank you for this answer.
In case, I also set r.Shadow.Virtual.ResolutionLodBiasDirectional
to -4, it also increase the area of the virtual shadows.
I have heard about raytracing but did not know if it could help in this situation. If yes, I am curious to know more about it. Also, when I set âCast Ray Traced Shadowsâ to âEnabledâ on my directional Light, the shadows disappear. I donât understand why.
I have noticed that each time I restart Unreal, I have to redo the command. Is there a way to save the command or automatically execute it when Unreal starts.
Hi,
Please check that Hardware Ray Tracing is enabled in the Project Settings.
You might also need to adjust r.RayTracing.Shadows.LODTransitionStart and r.RayTracing.Shadows.LODTransitionEnd
You can add the console commands to the DefaultEngine.ini in your projectâs config folder to have them auto-execute on project startup.
1 Like