[TUTORIAL] Quick Time-of-Day Setup

Hello All,

is such a great resource! Thanks for sharing!

I am fairly new to engine and I am also an architectural visualizer. (although game development could be a fun hobby!)

I will try to download as a starting point (and to learn).

I had some fresh ideas for features though. Lets see if anyone else would like them; if not, ill try them on my own.

  • It could be nice to have a compass with a north direction on it. sun would always rise in east and set in west.
  • sun only shines strait down at noon on equator at summer solstice, otherwise, “arc” that sun follows tilts south in north hemisphere and north in southern hemisphere. (Assuming we are on earth). So, we could set a location on earth, and rotate north direction and get a realistic day night cycle for that location on earth, but a hacky way that might work is to just have a “tilt” (public) variable. so we could tilt sun toward north or south. ( might help gimbal lock too?)
  • Maybe moon could show for a specified fraction of nights and/or have phases?

That’s what I could come up with off top of my head.

Fun stuff!

Thanks!
Ryan Dashkevicz
SmithgroupJJR

Hi Daniel. You can check my geographically correct sun system here: [BP] Geographically Correct Sun System - Game Development - Epic Developer Community Forums
It pretty much does what BP is trying to achieve. It’s built with arch viz requirements in mind.
Cheers,
George

Hey greg FYI I’m still workign to enhance BP I was going to post something as soon as i get clouds that I like. and other things

Hello,

@greg i didnt use premade TOD ive created my own based on another, but i think u can help me either!

I have Sunrays in my sunlight but there are not centered on actuall sun itsself. So if i look in sunn i cann see that rays are coming at least 5 unitsleft of it…
Is it possible that Suntexturemesh and lightsource didnt have a matched way at rotating? Its just a small problem but i have to fix that…

thx

@rdashkevicz, I like your tilt idea, I’ll see if I can do that. Although it seems that cgiteach has that under control, you could try his.

@Shoiko, I’m glad to hear you’re still working on clouds. I tried a ton of stuff, but it never looked nice. I suck at materials.

Hey,

For some time I am using your system. It was one of first things I did when I started with unreal 4. But from beginning I noticed that moon did not have any texture. moon is only a circle. When I opened sky material I noticed that texture node is disconnected. is strange because I tried reconnect it in various ways without success. How can I add texture on moon?

I hope what I have requested is possible.

New version: http://gregoryjb.blogspot.com/2015/06/time-of-day-v13.html

bright horizon has been fixed, among other things.

@lunyBunny, I was working on moon texture but ended up breaking everything, so I left it out of release. way I plan to do it in future is to have a separate plane around in front of dome with texture on it.

New version 1.4: http://gregoryjb.blogspot.com/2015/06/time-of-day-v14.html

Sun/moon lamps are now self-contained, sky lamp was added, and there is a moon texture.

Thank you so much , is a really great contribution to community. I have toyed for some time with your old version in past and it seems like you improved literally all of weaker parts of system - well done (though I have yet to try it)!

thanks @ for giving us update:)

I liked new moon.

but as @Zeiten said, moon is in front of clouds. To achieve a better effect I had to change moon’s material to translucent and modify it a little bit.

About point in center of textured moon.
There has to be a way to disable previous moon effect. Or combine scale control of effect to work together with textured moon.

But I found another problem, formed a cloudy spiral galaxy in center of sky

:B

My plan was to separate clouds from rest of sky so moon could go between them. Also you should be able to set moon disk size to zero to make it go away. I’ll make a better fix in next update.

As for clouds thing, that will be tricky, I’ll see if I can edit texture at all.

Hey Greg

thank you for community resource getting ready to use it in my project :slight_smile:

Hey,

I Think moon could be a sphere geometry. Once, I obtained an amazing result with a moon texture in good resolution applied in a sphere with glowing and FuzzyShading effect, then I used world composition to allocate “very big Moon” outside persistent level. I also had with decal a very good result, which I could animate as well as moon geometry.

On part of center of sky, you can to use animated particles bilboards for clouds closer to ground to cover empty area on center of sky, surrounded by transluscent or masked big semi-spheres to most distant clouds and finally a physically-accurate planetary sphere with a moon or sun over.

:B

Hey . First off, thanks for providing system for us to use.

I noticed with v. 1.4, I can’t get dynamic shadows going way I used to in 1.2. I’m making a mobile game and using mobile/html 5 preview rendering level, and I have gotten dynamic shadows to work previously, just FYI. I dug into blueprint itself, but can’t quite put my finger on it. screenshots below show how game looks in Editor, and in PIE, and you can see difference in lighting and shadows.


@RHopperArchimage

Are you sure is related to TOD system and not UE 4.8 itself? AFAIK UE 4.8 has several issues related to problem you are describing.

AlexW88, TOD v. 1.2 was still looking as intended as far as lighting and shadows go, even in 4.8. I could always go back to that version and post some screens if needed. I’ll also investigate more on my end and make sure lights match up inside new v. 1.4 BP to way I had my original lights in scene that were used in v. 1.2.

Edit: I can confirm that v. 1.3 keeps lighting matching editor and while playing too, brightly lit with shadows. I think it’s due to fact Sun and Moon directional lights (along with a Sky Light) are contained in BP for v. 1.4. I messed around with light settings in BP for 1.4 and could not recreate what I wanted. So keeping 2 directional lights outside of BP works for me for now. I also don’t have a sky light in my current scene.

That’s strange, in my testing fact that lights were in blueprint didn’t make any difference. Are you sure skylight in blueprint isn’t washing out shadows?

I think that might be case Greg…I’ll look into that.

Hai Greg, Thanks a ton for providing to us. It fulfills everything I need in a Day-Night cycle system.
I am though wondering how I would go about making a light turn on at a specific time of day.
Would really appreciate some help! :slight_smile:

You would need to check if CurrentMinute is greater than a specified value (not equals, since it’s a float). So say you wanted streetlights to turn on at 6PM, you could do “if CurrentMinute > 1080, turn on lights”, 1080 being number of minutes that correspond to 18 hours (18 hours from midnight is 6:00pm)