Why does my sun shine through my terrain and meshes?

I will borrow another user’s screenshots because they show our common problem best:

Now, I have dug the entire internet for day / night cycle and found many tutorials that seem to copy oneanother. I used a timeline, set the light to be movable, updated the sun, etc. I even dimmed the sun through a curve so its brightness is off at night and max at noon. Played with this quite a bit.

But overall the result is still ugly and unnatural. I want to know why this is happening and how can I fix it. I will still turn it completely off when its totally dark to save processor power & such but at sundown and sunup its messed up: either the shadows pop in and out respectively, or there is too much sun in that transition period, or you can see sun shining through the ground.

I may be wrong about this. But I think the reason why sun shines through the terrain is becuase the terrain mesh issingle sided. IE The terrain is opaque from the normal side. But from the other side its completely ‘transparent’ (though a better term would be ‘non-existant’). The reason for this is, as you probably know is the facing of a triangle is determined from the order in whcih triangle vertices are given. So from the opposite side the rotation is wrong and it will be treated as a back-face (which is expected).
Now probably due to this reason those area covered byt terrain (when viewed from other side) wont write anything to the depth buffer. Ths might probably make the lighting to think taht there is no blocking obecjts between the light-source and thoser other obejcts (trees,etc.).

So I would suggest you to set the terrian material to two-sided and see if that makes any kind of difference to the sun-penetration issue. But even if this does work, it will make the rendering slower. Becuase two sided materials are expensive and will bypass the optimization we get from ignoring back-faces

But this is an assumption and I might be completely wrong about this.

I figured as much. But after adding a normal box from prefabs, same behavior. I even flipped the ground mesh, same problem. weird

Hi,

This post may better answer your question:

https://answers.unrealengine.com/questions/56230/sun-still-lights-objects-when-night-time-help-me.html

If you are still having issues feel free to post here and I’ll have a look.

Thank you!

Tim

Its the post I borrowed the screenshots from :slight_smile: And no, it did not help.

You’ll probably want to make sure that you have “cast shadows as two-sided” for landscapes. this will help with any light leak.

If you’re having a specific issue it’s probably best going forward to post relevant screen shots of your scene/blueprints that are causing issues along with the details panels for the landscape.

Tim

You stole my pics… Nah idc lol if you want your objects to not light up when it thrns night, click on the landscape and enable “Two-Sided lighting” u have to get unreal engine 4.3 tho

Im having this issue too and I tried the two sided lighting thing. Someone please figure this out, its really mesing with my day night cycle.

1 Like

If you have found the answer after 6 years, please tell it. Because “two-sided” doesn’t help

Thanks youu