Day and Night Cycle

Hello,

in the attachment is a Day and Night Cycle Blueprint.

blueprint is not from me!

I need the following help: If i do a Skylight in Scene in the Night - with Skylight is it too bright it must be dark at the night.

My idea is to control Skylight with a “Color Curve” like the “Horizon color curve” or the “Sun color curve”.

The goal is, that we have no Skylight in the Scene during the night.

Can Someone please help me?
Kind regards,
Andreas

You dont need to adjust the color or the tint of the skylight; you just need to update the skylight when the sun goes down. You should actually update the skylight more often as the day passes but it is a considerably heavy process for real time so it may cause momentary lags when you do that depending on your target system.

Hello ,
is there any other solution for the “Nighttime” with Skylight? Because you say it’s a heavy process for real time.
Kind regards,
Andreas

In your situation you want to update the Skylight only twice a game-day so the performance cost for those updates every time the sun goes up and down may be ignorable depending on the game you are making. You should give it a try first and see how many FPS you lose as the skylight updates and how long it takes and see if it causes too much trouble. If it doesnt work as you like then you can look into other alternatives.

In my skydome blueprint (in the \Sky folder from the link in my signature) I update the Skylight every x amount of time. Anything above a 10min (game time, not actual time) interval while the light is changing intensity becomes really noticeable when the new capture occurs.

Calling Recapture Scene on Tick is a really bad idea. I recently had an with a migrated skydome blueprint that reset the value to a 0sec interval and it took my performance (on a GTX 980) from 120+fps to 40fps. It is an extremely costly function to call, so you need to space it out. Depending how fast time goes in your game, for example how long 1 hour in game vs actual time, you can set it fairly low without too much of an. In a game like GTA V where 1 hour is roughly 5 minutes, I would have it recapture every 2-4 minutes (game time) during sunset/sunrise and every 10-20 min during the day/night.

When the light is transitioning from day to night you should try to update more frequently, during the daytime you can update once per hour without any issues. Same with overnight it is just the sunset/sunrise time range where you will want to recapture fairly often to avoid sudden changes to the lighting.

You can also dynamically adjust the skylight intensity (I believe…) to turn it down lower at night if it is too bright, then turn it back up in the morning.

Hope that helps! You can download the project from the link below if you’d like to see how I set it up, but right now it is just a basic setup comparing current time by a variable for the last skylight update time, and a variable controlling the duration between captures.

Hello ,
thank you very much!
I would like to download your project - but i can’t see a Link?
Kind regards,
Andreas