[TUTORIAL] Quick Time-of-Day Setup

Sounds great to me! I’m looking forward to it :slight_smile:

is really neat. Thanks for sharing your findings with us :slight_smile:

thanks alot for , really helpful :smiley:

Glad to see that you guys want it! It might take a few more days, I want to clean everything up and document it properly. Should be done soon though :slight_smile:

Alright, pre-made blueprint is available for download! Get it here: https://d26ilriwvtzlb.cloudfront.net/7/70/Skydome.

Instructions to get it working:

  1. Copy “Skydome” folder into your project folder, under “Blueprints.”

  2. Open your project & map.

  3. Make sure that your Directional Light (sun) has “Cast static shadows” OFF and that its mobility is set to “Movable.”

  4. Delete default skydome. Drag-and-drop “BP_Skydome_DayNight” from content browser into level. ( is asset you downloaded.)

  5. In BP_Skydome_DayNight’s properties, under “Sun” category, set “Directional Light Actor” to be directional light in your level. (Just click on property, a menu should pop up. Select thing called “Directional” something.)

  6. REBUILD LIGHTING. is important.

  7. Now play/simulate. sun should move, and shadows should change! :smiley:

first thing you probably noticed is that it was changing way too fast. “Day Cycle Time” property (in “Time of Day” category) controls how many seconds = one day. So make higher if you want a slower sun (longer days). Feel free to experiment with other properties as well!

If it isn’t working, please make sure that you followed all of steps above correctly. They are all necessary!

Finally, please give feedback! Was it useful? Not useful? Too complicated? Broken? Let me know below!

When I get a I am so going to play with . Quick question have you tested it with LPV GI enabled? Just cause I planned on trying it that way anyways just thought I would ask.

Oh man I just got around to messing with it and I LOVE IT. Only thing that’s missing is a moon with light cause I noticed once sun drops below and goes to night it puts you in unlit mode. Though that can be fixed easy with just adding any light besides “sun”. Awesome work man. Do you mind if I PM you a question concerning BP and something I am working on?

I got it to actually run in LPVGI after a little tweaking even with some Dynamic Particle Lighting as well. Amazing BluePrint man although one thing I did notice if you go higher then 60seconds for a cycle sometimes it seems to get stuck at noon and then change access. Not sure if it’s from a setting I messed with or a bug still looking in to it but amazing BP man.

Dang it, you’re right, it is getting stuck at noon. That shouldn’t be happening, I’ll see if I can figure it out.

Okay, it seems to not happen if you simulate instead of play, so it seems like an engine problem. Not sure if I can do anything about it :frowning:

I tried messing around with intended settings and Blueprint, but I couldn’t seem to either reduce or remove gradient from horizon. Even after building lighting, it wouldn’t. What am I doing wrong?

w/o using LPV

Is it not suppose to cast shadows (i disabled shadows on directional light, but shadows work if i enable it)

then at night it basically goes into unlit mode, so u can still see everything.

Just curious if is as intended

im having same.

white area is in horizon color. Look at Horizon color array and note that it doesn’t exactly goes to black at right point in timeline. variable is linked in engine so you might have to expose engine section of content browser to find it.

Sorry for not replying guys, haven’t been checking thread :slight_smile:

@KRushin, without LPV you can still have shadows, but it will be much lower quality of lighting overall. reason everything goes into unlit at night means you probably have an ambient cubemap set up in your post process, and because of Eye Adaptation, it makes light really bright at night.

@tehwave and @Alexarg: Like Shoiko said, colors of sky are controlled by various gradients. Also, you can try disabling fog. Eye Adaptation will also make everything really bright at night, so try turning that off and see what happens.

A good mod of for single player games would be to match player’s local time and adjust sky dome to current real time of day. Helps a lot with immersion and I think all games should do that.

would be cool, but singleplayer campaign missions are often designed around time of day they need for that mission. Also, it would be really annoying if you could only play at night after you got home from work, and you never saw daytime in game.

That said, it would be neat to implement, just for fun. I’m guessing that you’d need to compile your own engine to create a way to access PC clock, unless UE4 already has functionality built-in. (Actually, is there already a BP node that does ?)

I think there is no built-in blueprint, but engine have in C++ side: .unrealengine.com/latest/INT/API/Runtime/Core/Misc/FDateTime/Now/index.html
If you want venture on creating custom Blueprint for , they have a how-to on Wiki xD: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
Also have somewhere a guide of how to create Blueprints as a plugin so you can distribute them and users don’t have to recompile whole engine source code. I didn’t mess around with that yet.

Adding a moon option for night time light source would round thing out perfectly. I’m going to see what I can come up with, but just started looking into bp code so will take me some time. Just would really make it complete feeling, as even at night there are light sources from stars / moons etc. I did cheat and make a stationary planet provide some night time lighting, but having a dynamic aspect of that would be great. Possibly option to attach a mesh, and provide a height value or such. Or at least case scenario ability for it to not have light ray etc.

Anyways amazing work and thank you all for time into it.

I just stumbled upon thread and I was digging through blueprint and I have to say that it looks pretty amazing, however it is not working for me. I have tried multiple times and i can get time of day to print, but day night cycle sticks at what appears to be darkest portion of night from moment level is played in both “play” and “simulate”. Any suggestions?