Download

Landscape Contact Shadow Issue

Hi guys,

I am playing with foliage and added contact shadows for the directional light. The grass looks great for the start…

CS3.jpg

…however …

… I get these ugly artifacts on the landscape. This has nothing to do with the foliage, since they are still there when I delete all foliage.

What can I do to remove this issue?

Thanks,
Marcus

Doesn’t seem like a contact shadow derived artifact.

What light method are you using?

If it was due to contact shadows the borders of the scene would be faded out to the same color as the ground, not the shadow color as your image shows.

all contact shadow is, is a post processing effect in screen space, so it doesn’t affect the entirety of the screen and has a very obvious vignetting entry point from the edge to where the shadows start.

Hi,

thanks for the answer. I am using …

  • Directional light (movable) with
  • Skylight (movable)

When I turn directional off the issue is gone. When I turn the skylight off the darker “problem areas” will render completely black.

Also I am using Post Process Volume, Exponential Height Fog and a Reflection Capture (spherical).

Maybe that information helps a little bit.

Thanks, Marcus

Try disabling prevomputed lighting via project settings. Then Play with the shadow bias in the directional light.

Set cascaded shadows to 1500 or so.
​​enable distance field in project settings. Set the distance to 1500 as well - same as cascaded, when cascade is off, dfao needs to take over.

Wait until to you have a finished scene to play with the light mote than this, otherwise you are just wasting time.

There’s also a limit on number of materials displayed in a landscape. Not sure if this is related. Landscape material layer limit? - UE4 AnswerHub

Have you tried isolating the problem by just turning contact shadows off on the directional light? That seems like the easiest way to troubleshoot this…

@Arkiras Hey, yes I did, definitly coming from the contact shadows.

Thing is, I really need those contact shadows. They give the grass such a better look.

Thanks to everyone so far, tested everything and it seems even a clean and fresh Directional light causes these issues on every material (not the sky sphere however) as soon as contact shadows are enabled and as soon as you look kind of into direction of Directional light.

Whats your contact shadow length set to?

It is set to 5±

Yeah that’s way too high

From the documentation:

(note this only applies if you do not have worldspace units enabled for contact shadows, personally I find having worldspace enabled makes it extremely unreliable.)

I would suggest you keep it at 0.25 to 0.3

The whole thing is a joke, not just world space units…

@Arkiras Sadly also a value below 1.0 didn´t solve the issue…

yes, this happens when using worldspace units and setting contact shadow length to low world space (< 100cm) value.
there is no way around this other than to avoid using these settings. unfortunately by some oversight it is not possible to turn off contact shadow casting on landscape (static and skeletal meshes have this option)