Download

Distance Field lighting, sky light shadows dark spots on terrain

Hello,

In my project I have an issue that if there is distance field lighting enabled on landscape and a sky light is setup in scene, my terrain have weird black spots all over it.


Disabling “casts shadows” in sky light or “affect distance field lighting” in landscape seems to hide the issue, but both of the options are not viable for me.
It also seems that those black spots seem to be just not refreshed parts of the world as they appear only around the place I load into the map, if I will fly away some distance and get back to the same spot everything will be fine.
Unfortunately this is not editor only issue and appears in my built game :c

Anyone has some idea what might be causing this issue?

It’s really hard to tell from your picture what’s going on. It just looks like a shadow, and you have the directional light on about 2?

Everything should be fine if you leave the directional light and skylight on defaults, to start with…

Hi, distance field ambient occlusion is causing this.
Basically disabling distant field ambient occlusion (so setting the skylight to stationary instead of movable or setting the Occlusion Exponent in the sky light to 0) will remove those black spots.

Otherwise the distance fields only get generated near the camera, so if you would move the camera far out and back in again, this will cause the distance fields to be refreshed and this removes the black spots on the landscape (therefore it seems like a bug to me that they appear in the first place).

[HR][/HR]
Another problem you will have when using distance field ambient occlusion will be one sided meshes. You could solve the black spots there by generating two sided mesh distance fields for those meshes (but this will be a strain on performance), or not use such shaped one sided meshes that cause those black spots.

[HR][/HR]
So basically it seems to me that mesh distance fields have a problem with one sided meshes/ specific mesh forms and I hope epic will solve this in the future.

Ah that hit the spot, changing sky light to movable instead of dynamic was a perfect solution for me. Thank you!