Hello everyone, I’m facing a problem that I can’t resolve. When I increase the distance of the Dynamic Shadow Movable Light, some shadows of certain objects (even though they are identical) depending on their positions on the map, when I approach these objects, some lose their shadows while others do not. All my meshes have distance fields enabled. I have tried all possible values, but what steps have I missed?
Are you using LODs? If it is based on the distance to the camera it could be an issue with one of the higher LODs materials, though honestly not sure what could cause this (maybe it’s using the emissive output?)
You should probably also disable distance field shadows and the far shadow cascades while you debug, might make it easier to isolate the problem.
Dynamic Shadow Distance 20000, Distance Field On and Far Shadow On.
Dynamic Shadow Distance 7200, Distance Field On and Far Shadow On.
Dynamic Shadow Distance 20000, Distance Field On and Far Shadow Off ( This seems to have very little impact.)
Dynamic Shadow Distance 20000, Distance Field Off and Far Shadow Off.
It looks like the Distance Field is erased by the Dynamic Shadow Distance.
When I increase the dynamic shadow distance, the distance field appears even in the distance, but I lose the distance field close to the camera… Shouldn’t it do the opposite?
Another strange thing is that a certain part of my map is never affected by this shadow loss due to the dynamic shadow distance. Even when I move the camera closer to this area, there is no shadow loss.
So I tried loading a larger area in the World Partition, but it doesn’t change anything.
This is how they are intended to work. Distance field shadows are meant for objects far from the camera, this is because cascaded shadowmaps cost goes up and quality goes down the larger the area they have to cover is. Where as distance field shadows aren’t very good quality, but they stay sharp even when rendered far from the camera which makes them a good choice for distant shadows.
If you hover over the tooltip it will explain that distance field shadows cover the area between the end of cascaded shadowmaps, to the end of the distance field shadow distance.
If you disable your moon directional light, does the issue go away?
Failing that you’re going to need to post more information about your project. Maybe show the leaf material, engine version, platform, what template you started from if any…
Thank you for the clarifications. Even if my “moon directional light” is off, it doesn’t change anything. With the clarifications you provided, I was able to eliminate some doubts. Apparently, when I turn everything off, the disappearance of shadows still occurs with everything off, but only in the outermost areas of the map. It’s as if the shadows on my trees are not being considered, whether from afar or up close! I’d even go so far as to say it seems to start from a certain distance from the center of the world (location x:0 y:0).
Only the “distance field shadow” displays shadows everywhere. ( If I check it )
I don’t understand what I’m looking at here. According to your details panel you have shadows disabled (moveable shadow distance 0) and distance field shadows disabled, so how are the trees casting any shadows at all?
If you completely delete all of the lights in your scene and just add a regular directional light, does it work correctly?
Only real explanation I can think of is that you are using raytraced shadows, which dont fall back to DF shadows or far cascades, they just have a strict cutoff distance
Thanks to your clarifications and the tests you guided me through, I was able to find the cause of the disappearing shadows related to the “dynamic shadow distance”! It was indeed due to my “material”; specifically, something went wrong with the “opacity” input in the “material”. Thank you so much for helping me isolate all the elements! I still don’t know why the shadows are displayed even with everything disabled, but this is less of a visual issue for me now, which is already a big improvement. Thanks again! I really appreciate it.