Global light source switches between sun and moon at incorrect times

Reproduction Steps

Open up a baseplate and start adjusting the ClockTime property in Lighting to the hours before sunrise and after sunset.

Expected Behavior

Normally, the global light source would switch to the sun or moon when the other went below the horizon. If I remember correctly, the light source would switch to the sun at 06:00 and to the moon at 18:00.

Actual Behavior

The global light source seems to be changing to the sun earlier than it should, and it also is changing from the sun to the moon at a later time. By the time the global light source changes to the moon, it has already been night time for a decent amount of in-game time, and also causes the first few hours of night time to be much darker than it should be. I do remember experiencing this a long time ago when I was working on a project with a smooth day-night cycle in late 2021, so I am not sure how long it has been an issue for.

Here’s two gifs of this in action:

Here the global light source is changing from the moon to the sun at approximately 04:43:38, which is 1 hour and 17 minutes in-game before the sun actually comes above the horizon.
https://gyazo.com/91ae9e47b643dccd308400335f8f63fb.mp4

And here is the global light source changing back to the moon, which is happening at approximately 19:16:23, 1 hour and 16 minutes in-game after the sun goes below the horizon.
https://gyazo.com/72b774cee13846a3d62189bf9e1b986a.mp4

Issue Area: Engine
Issue Type: Display
Impact: High
Frequency: Often
Date First Experienced: 2021-10-15 00:10:00 (-07:00)
Date Last Experienced: 2023-02-01 00:02:00 (-08:00)

4 Likes

This probably had to do with using one directional light source for the daylight cycle. Once the sun/moon has set, the light source will flip in favor of the other rising body. It’s much less taxing to graphics performance than rendering two light sources for the sun and moon, and I doubt it’s noticeable most of the time. I haven’t seen something like this in live games, but it’s probably because the games I play have large maps.

Yeah, this is how the engine has always worked–the issue I’m describing here is just that the light source is apparently switching from the sun to the moon [and vice versa] at the incorrect clock times, not that it isn’t rendering from both at the same time.

Perhaps this incorrect timing is intentional so that sunlight can show up on tall structures long before the sun rises:

@ 04:48 AM:
image

1 Like

Thanks for the report. I filed a ticket to our internal database.

2 Likes