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.
asked Jul 25 '14 at 02:29 PM in Rendering
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
answered Jul 28 '14 at 07:52 PM
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.
answered Jul 25 '14 at 05:49 PM
This post may better answer your question:
If you are still having issues feel free to post here and I'll have a look.
answered Jul 25 '14 at 10:20 PM
Tim Hobson ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here