How to decrease dynamic shadow distance?

Hello, please is there a way to decrease movable light dynamic shadow distance?
I know there is the draw and fade setting in the light… but that makes the whole light go out. I do not need dynamic (or any) shadows at long distances. My game is whole in the underground so i do not need and i do not use directional light/skylight. Is that ok?

I would like to decrease dynamic shadow distance so the shadows disappear sooner… because of performance… It can be set for all light in the whole project for each light separatedly, it does not matter.

Im sure it is very simple but i did not find that setting anywhere and even this question on the forum (most people want the opposite).

Thank you for any tips

You can adjust the shadow distance for individual lights in Unreal Engine. To decrease the movable light dynamic shadow distance, you can use the following steps:

  1. Select the light in the level editor
  2. In the Details panel, under the Light Component section, find the Cast Shadows property
  3. Change the Shadow Distance value to the desired distance. This controls the maximum distance at which dynamic shadows will be cast by the light.

Note that decreasing the shadow distance can improve performance by reducing the number of shadow-casting objects and the amount of shadow data processed by the GPU. However, be careful not to set the shadow distance too low, as this can result in low-quality or inconsistent shadows.

As for your question about the absence of a sky light and directional light, it is fine to not use them in your underground environment as long as you have other sources of light in your scene. You can use other types of lights, such as point lights, spot lights, or area lights, to light your scene.

2 Likes

Thank you for your reply… unfortunately i do not have any option like that in the light component.

image
image

I am so sorry, I was thinking about the Max Draw Distance:

What the Max Draw Distance will do is to reduce shadows drawn based on the camera distance. It’s a great way to turn off shadows and optimize a level.

I am now slightly unsure if what you want is possible…

But this disables the whole light… not only the shadow. :frowning: So it makes the level very dark in the distance. Im using this now in combination with a light that does not cast shadows at all. So even when it does not draw the shadow casting light, some light stays… but it is darker anyway.

You could turn lights off using Blueprints, you can set it so that when the player enters a specific area or are X amount of distance away from a light the shadow turns off. However, I don’t think that is a great solution.

I think you probably want to look closer at reducing the graphical setting regarding Shadows, rather than manually tweaking or turning them off at a distance. It’s easier to let the game handle it. Have a look at this: Scalability Reference | Unreal Engine 4.27 Documentation

This is a reference from the Scalability Reference:

r.ShadowQuality=0
r.Shadow.CSM.MaxCascades=1
r.Shadow.MaxResolution=512
r.Shadow.RadiusThreshold=0.06
r.Shadow.DistanceScale=0.6
r.Shadow.CSM.TransitionScale=0

These will lower the graphical settings, you can tweak the shadows further using these. Still, I suggest reading the documentation.

Thank you. Im learning all about the scaling now… Only thing that works for me is r.Shadow.RadiusThreshold=0.06
But it sets the screen size of the mesh to be/or not to be influenced by shadows. So small meshes shadow pops in when i get closer…

None of those settings is actually based on distance from the light :frowning:
But i am somewhere where i wanted to be :slight_smile:
so thank you very much for the helpful information

No worries! Hopefully someone can help us out to find a more suitable solution for you!