x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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:

alt text


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:

alt text


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.

alt text


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.

alt text

Product Version: UE 4.9
Tags:
erscrn1.png (556.0 kB)
erscrn2.png (777.4 kB)
erscrn3.png (704.9 kB)
erscrn4.png (649.8 kB)
more ▼

asked Dec 08 '15 at 10:24 PM in Rendering

avatar image

HuntaKiller
165 10 12 19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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 ;)

more ▼

answered Dec 09 '15 at 02:37 PM

avatar image

vipeout
379 14 10 25

avatar image HuntaKiller Dec 09 '15 at 07:27 PM

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.

alt text

alt text This is the plane under the landscape in picture 1

erra.png (744.5 kB)
errb.png (1.8 MB)
avatar image vipeout Dec 10 '15 at 08:02 AM

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'.

Material'/Engine/EngineMaterials/DefaultMaterial.DefaultMaterial'

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

avatar image HuntaKiller Dec 10 '15 at 08:28 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question