Shadow Draw-Distance

Hey there :smiley:
i changed a couple of meshes in my project to movable so i can rotate them etc. but that did cost me the shadows below them :confused: Now i only see the shadows of the meshes if i stand directly in front of them (directly means no player will ever do it on their own X-D)

Is there a way to set this up so i can see the shadows with a higher distance between the player and the meshes? FYI,
the meshes are irradiated with a spotlight from above

Hello BeeHive,

If you changed your meshes to movable, this means they need their light source to cast a dynamic shadow. What you could be seeing is the static ‘baked’ shadow draw distance. In other words, your static shadows disappear at a certain distance from your meshes.

Try changing your light source to ‘Stationary’ or ‘Movable’, this will allow your objects to cast a dynamic shadow.

Let me know if you get your issue figured out, or if you need further assistance.

Cheers,

Hi ,
changing the spotlight from stationary (was already set as default) to movable enhanced the result a lot as you can see:

But as you can see on the second image its not yet “perfect”, is there a way to crank up the distance a little bit?! :slight_smile:

What is the resolution of your Static Mesh objects in the scene? Sometimes increasing this can help with the crispness and accuracy of your shadows.

Would you mind clarifying for me what you mean by “distance”?

Another thing to look at would be your ‘Engine Scalability’ settings. This controls the overall rendering quality of your editor.

Thanks,

With distance i mean the distance between the player and the shadow. Do you mean with resolution the lightmap resolution or is there something else? The resoltution for the floor is already at 4096 and should be high enough and the scalability is set on epic.

that would only be a viable solution if i could set the directional light source to look like a spotlight. i already have a directional light source for the map itself and it works great, but it looks nothing like the spot and i can not find a option to get the behavior i want from it

If you are using a ‘Directional Light’ you can use the ‘Cascaded Shadow Maps’ feature which is a shadowing method that divides the view frustum into a series of distance-based shadow cascades, each of which with steadily lower resolution as you move farther from the camera.

“This means that shadows nearest the player’s view have the highest resolution while those farthest away have the lowest. Beyond the range of the Dynamic Shadow Distance property, the system blends back into static baked shadows. In this way, you can take a scene with baked lighting and smoothly transition it to static baked shadows as you move away from objects.”

To find these settings click on your ‘Directional Light’ and look for the section labeled ‘Cascaded Shadow Maps.’ Use the image below as a reference.

Directional Light Details

For more information on this shadowing technique and its individual settings, have a read over the documentation.

Dynamic Scene Shadows

Let me know if this resolved your issue, or if you need a bit more help.

Cheers,

No problem, would you mind showing me the settings for one of your spotlights?

You also might want to look into ‘Ray Traced Distance Field Shadows’. This is a fairly new shadowing technique which can yield very smooth and accurate shadows while also potentially increasing your performance.

The documentation shows you how to implement this technique and lets you know its limitations as well. One thing to point out would be the ‘non-uniform scaling’ which can cause artifacts in your shadows.

In order to use this shadowing approach, you need to enable the option via the ‘Project Settings’ within the ‘Rendering’ section. In this section you will see an option that says, ‘Generate Mesh Distance Fields’. Check this box, save your project, close the project, and then re-open to have your changes applied.

Have a look at this feature because it can greatly improve your dynamic scene shadows as well as improving performance. It will also give you some valuable insight on how the engine calculates shadows and an idea on different shadowing approaches for different situations.

Ray Traced Distance Field Shadows

There are also other links on this page to other things like ‘Distance Field Ambient Occlusion’ which can also improve the quality of your shadows and shadowing transition distance.

Let me know if you are able to get this technique to work for you, or if you have some questions on how this works.

Cheers,