You can clearly see the reflections off the landscape and lightshafts coming through from a lightsource behind the landscape tile. True In this image the sun would be below the horizon, but that’s really irrelevant and the light shafts best pointed to the problem at this angle.
I used a stock third person template and added a landscape tile read from a .r16 file, my Sun and lightsource, and atmospheric fog :
Also, if you are attempting to set up a ‘Time of Day’ rotation for your Sun take a look at this information on the Forums. Technically as soon as the sun dips below the horizon line i.e. your landscape, the Sun should switch off as it is considered night.
Time of Day Set Up
Let me know if you are still having troubles or if you have additional questions.
My landscape includes both mountains and plains, so the sun can’t switch off until it goes below the plains ( 0 and 180 degrees) and I want to see the lighting spreading over the landscape as it emerges from behind the mountains. I suppose to get the moon properly lit I could put a spotlight directly on it but I’m not sure it would be a good idea to introduce another lightsource? Anyway that’s not important at the moment. The light should not shine through the back of the landscape tiles.
The previous images were taken from a minimal setup just to isolate the bug. Here’s a scene from my game under development with the settings you recommended :
So no real change. You can see the sun cresting the mountains and still clearly see light shafts coming through the landscape. Note also that it is shining through the landscape tile on the other side of the mountains. I get the same light shafts from the landscape even when the sun is completely eclipsed by the moon - so again, it’s shining through a solid object. Just before the sun crests the mountains the light shafts and inappropriate lighting of the landscape are very pronounced.
What other information can I provide in helping to resolve this? I would be happy to upload my test case that reproduces the problem for you to review ?
In the Time of Day tutorial that I linked you to, there is a variable labeled “Night Threshold” which allows you to set the threshold in which the sun is turned off when it reaches a certain height. This variable is what you want to change and will be specific to projects since it is based of physical position of the sun disk relative to the origin of the map or level.
For my test bed project I have the variable set to 0.5. It turns off the sun right at the point in which it dips below my mountains and landscape. Keep in mind if you would like this effect to be perfect it is going to take some trial and error as to the value you will want for this variable.
Also be sure to add a ‘Skylight’ actor to your scene for your ambient fill light. This light actor is very powerful and has a lot of great features to help add realism to your project/scene as well. Let me know if you are still struggling to find an appropriate solution.
I have reviewed the workarounds for this issue and there are many problems with turning off the sun. If my character is standing on a peak then the level at which the sun turns on will be very different than if they are in a valley or an a flat plain. I have single landscape tiles that span all three of these cases.
I’m trying to find a delicate way to ask this as I don’t want to be offensive, but I assume that having light bleed through the landscape is not what the developers intended…so is this not considered a serious bug?
Have you attempted to apply a two sided material to your landscape material and landscape hole material slots?
I have the sun shinning directly from the underside of my landscape and am not receiving any light bleeding. Mind you I am using Cascaded Shadow Maps and a fully dynamic directional light. I have turned off precomputed lighting so my scene is fully dynamic.
As for getting the sun to turn off at the correct time based on the players position in your level. That is going to take a more intuitive approach and might even require some light coding to work correctly.
If you would like to send me a test project to help you with your issue then take your Config, Content, and UProject files and zip them into a folder. Then you can upload them to dropbox and provide me with the link here.
So firstly, I deleted about half of the extra objects in your scene from the default starting map labeled “Arena Geometry”, just to avoid the possibility of any discrepancies when testing.
I also deleted all of the Directional Light Blueprints you had in your scene, which was around 4 light actors. You only need one dominant directional light. This is why you were still seeing light, because although you were rotating one actor, the other three were still illuminating your scene from the default angle.
Then after deleting these actors, I added a single Directional Light and angled it so it illuminated your landscape from above. I then rotated it 180 degrees so it was shinning up from underneath the landscape. I made sure to check the option I mentioned earlier, which you must have overlooked, ‘Shadow Two Sided’.
As you can see there is absolutely no light bleed and no light is present on the surface of your landscape. Adding a ‘Skylight’ will provide you with your nighttime ambient fill light without the need of your Directional Light. Let me know if you are still a bit lost or need help.
Hey Andrew, Thanks for all your helpon this I really appreciate it.
I did seem to miss the ‘double sided Shadow’ option. sorry for that. However, now that I have it checked I am seeing the same behavior - not with the light directly below the landscape, but with it close to the horizontal. If you could animate your light in some fashion so that it goes through a full 360 degree cycle I feel sure you’ll see what I mean.
By this I mean, there is going to be an area below the horizon line where it will still light up your landscape. You will want to find this area and turn off your Directional Light Actor around this point. This is where the, night threshold variable comes into play.
I agree. Is there no solution to this? All of my objects have Shadow Two Sided enabled, including the landscape and the far horizon object. And the picture is clearly indicating the angle of the light is upward so there definitely should be no lit polygons in the middle of the landscape. I chose to post here instead of making a new topic because this is the same unresolved issue.
And now finally way later it the ground gets lit properly.
as you can see in this last screen shot, the light does not shine through the landscape when it is pointing directly up at it from the bottom, i.e. nighttime (those few brights things you see are foliage being lit from the bottom