Landscape directional light + shadowing issue

I’ve taken a few screen shots that demonstrate the problem I’m having with the incorrect shadowing on the landscape during a sunrise/sunset. I’ve seen a few people with the suggestion that the light must be turned off at night; this does not solve my problem. The problem is the landscape shadowing at ~7-8 AM, not midnight. This problem occurs with two-sided-shadows enabled on the landscape.

TLDR: Picutre 1-3 shows incorrect lighting on the landscape, picture 4 shows correct lighting.

As you can see in this first screenshot, early dawn the landscape starts to reflect light that is coming from below the landscape. The landscape has 2 sided shadowing, but either way, the top face of the landscape shouldn’t be getting lit. Yes turning the light off here would stop this problem:

Here in the second picture you can see the effect get intensified as the sunrise progresses. If the light was turned off here to fix the landscape lighting issue, the sky wouldn’t have the sunrise effect. So disabling the light is not the solution:

Here in this third picture, this is the apex of the sunrise, the furthest into it while the landscape is lit wrong. Again, if I had to turn off the light to fix this problem, there would be no sunrise.

Finally here in this final picture, at a certain point during the sunrise, the angle just gets to a certain level and then the landscape stops its weird lighting/shadowing. This final picture is how the landscape should appear, it should not be lit like the previous 3 pictures. And again, the problem is not light coming through the landscape at midnight, it is only in the dawn/dusk hours that this occurs, and turning the light off up until picture 4 would remove the entire sunrise effect up until this point.

I had the same issue when I did my own system. The solution is simple and I realized what was going on thanks to the mountains on the edge of my landscape. The light goes through the ‘down’ side of the landscape, because there are no faces to block the light. So, when there was sunrise and I had a mountain on the side where the light came from, the shadows were incredibly distorted and some areas were lit, while they should not be.

The simplest fix is to model a staticmesh that perfectly matches the lower side of the landscape, like a ground beneath the ground, with it’s tris faced downwards (normal pointing down). It could be a plane, but then it would only fix the issue during the night hours and the sunrise/dawn would be still broken.

Make the mesh hidden in game but cast hidden shadow, no collision and everything will be fine. You could also try going with ‘Shadow Two Sided’ on the landscape, or similar option in the landscape material, but I’m worried that this could be a possible perf killer for something as big and occupying space (pixel shaders) as landscape so I went with fake shadow caster solution.

I’d like to know what works for you :wink:

I appreciate the idea but unfortunately this solution does not work. The pictures I showed are actually with “two sided shadow” enabled. To further test your idea I put a plane on the other side of the landscape, facing down, to ensure it would cast a shadow onto the landscape when lit from below.

As you can see the problem still persists even with a face on the other side AND two sided shadow enabled.

This is the plane under the landscape in picture 1

Weird. For me that was it. I mean I could post you a pic with a landscape that is perfectly black when it is lit from below by a movable directional light.

Maybe it’s something in your landscape material? Mine is pretty basic - diffuse + normal textures, calculated spec and roughness. All settings are at defaults, except for usage flags of course.

I checked the default material and it does work with light from beneath, even without ‘Shadow Two Sided’.


In the screen you’ve posted with the plane - is the directional light perfectly straight up (light direction vector)?

apparently if I change the material of the under-side-shadow-caster to something flat, i.e. no normals, it will cast a proper shadow. However if it does have normals, certain normal angles still let light through.

I have submit a bug report, as materials are letting directional light through based on the normal, and ignoring the “Shadow Two Sided” flag, on both static mesh planes and landscapes. For tracking, follow this thread