Landscape Directional Light Shadow Stripes

Hi there,

I have the issue that my directional light creates strange striped shadows on my landscape (and other flat meshes), when lighting from a very flat angle. If the angle is steeper, it works just fine. Take a look at the pictures (and yes, it’s not only in the preview, it’s when i build the lighting as well).
What causes this issue and how can i fix it?

This is with a flat angle:

This is with a steep angle:

1 Like

Hi Priareos,

I’ve been trying to reproduce this on my end with the information you’ve provided, but have been unsuccessful.

Can you provide some more information and screenshots, please?

I’ll need to see the details panel with your light selected. In the top right select the eye and check the box that says “Show only modified properties.” This will condense the details panel so that you can grab a screen shot of only settings I’ll need to adjust and test on my end.

Also, if you use the same settings for your light and landscape in another new project does this happen as well?

Thank you!

Tim

Sorry it took me so long to answer, here is another shot in which you can see my issue and my light properties.

I will test it in another project asap and report back here.

Thanks for getting back to me with your exact settings. I was able to see the cascades (the lines), but not as bad in my scene.

Since you’re using Dynamic lighting only there is going to be some trade-offs that will cause this type of effect.

The two settings I tweaked to reduce the cascades was “Cascade Distribution Exponent” (set to a lower setting. I used 1.4 in my scene) and “Num Dynamic Shadow Cascades” (I set mine to 2).

It will be tweaking these settings to get rid of the cascade shadow map lines.

Thanks!

Tim

Hi Tim,

thx for your answer.
I tried your settings and the stripes are indeed better, although they are not completely gone (just larger distance between the lines).
Furthermore changing those values significantly lowers the quality of my shadows (e.g. no shadows on my pebbles anymore).

Is there no other solution? Why is this happening?

Is it unwise to use one Dynamic Stationary Light only? Is there a better way?

That’s really the trade off with using Dynamic Lighting. There are going to be limitations and you’ll need to find a way to work within those limitations to get the results that work.

You can try using Ray Traced Distance Field Soft Shadows, but there are limitations with that at the moment as well. It doesn’t work with Landscapes. It’s a fully dynamic lighting solution for shadows at far distances but the landscape cannot cast any shadows but it can receive them.

It’s worth having a look: Distance Field Soft Shadows in Unreal Engine | Unreal Engine 5.1 Documentation

You can use this in conjunction with Cascaded shadow maps (Standard Dynamic Lighting method) to help as well.

I’m not sure what you mean by One Dynamic stationary light. Do you mean one directional light? If so, I would not recommend using more than one since it will cause a performance hit, although you do have that option. I don’t think it will help though, to be honest.

Thanks!

Tim

In case anyone else has this issue, i fixed it by increasing the Shadow Bias (played with Shadow Filter Sharpen as well to get better results). It has some minor drawbacks, but my stripes are gone now.

25795-fix.jpg

Using Ray Traced Distance Field Soft Shadows might work as well, but i can’t use them in my particular case.

I have one last question:
I have a lot of static geometry, which not necessarily requires dynamic lighting. Baked lighting would be totally fine.
How can i ‘flag’ some of my objects to only use baked lighting, while others (characters etc.) should use dynamic?
Do i need one Directional Light, set to Stationary, and another one set to Static?

Cheers

2 Likes

Using dynamic lighting only there is not a way to bake any static shadows. If you switch to use a Stationary light this is possible to bake static lighting for movable objects though.

If you use the stationary lighting for your directional, it will only cast static shadows until you set the Dynamic Shadow Distance for stationary. By default it is set to 0. What this will do is bake static shadows for all static objects and when you’re within the distance that you set for the distance will be dynamic lighting. If you want to have a movable object cast a static shadow this is possible by changing the lighting settings for the mesh. Make sure it is movable (otherwise the option is grayed out) and then check the box for Light as if Static.

The same is not true for stationary point or spot lights though. They will cast a dynamic shadow for movable objects, but all static objects get static lighting. There is now way to set the distance that dynamic lighting should work for these lights.

Tim

Thank you , i will check it out :slight_smile: