Monday, June 23, 2014

Time of day blueprint guide

This is a guide on how to use this blueprint: http://gregoryjb.blogspot.com/2014/06/ue4-time-of-day-setup.html

After running the sample map, the first thing you'll notice is that the sun moves waaaay too fast.  To slow down the sun, change the "Time Speed" variable.  Time Speed is a ratio of game-time to real-world-time; e.g., setting it to 24 will make 24 game-hours go by in 1 real-world hour.

With that out of the way, let me go over how to set up this blueprint in your own maps:


Setting this blueprint up in your own maps

- Delete the default skydome;
- Drag-and-drop the day-cycle skydome into your map;
- Set the "Directional Light Actor (Sun)" variable to equal your sun lamp in the map;
- (Optional) Set the "Moon Actor" variable to your moon lamp in the map;
- Set your sun and moon lamps to "movable" and disable static shadows;
- (Recommended) In the World Settings, under "Lightmass," check "Force no precomputed shadows";
- Rebuild lighting.

That's it, you should be good to go!  I highly recommend using this setup with LPV GI, you can find more information on it here: https://wiki.unrealengine.com/Light_Propagation_Volumes_GI


Quick breakdown of the most important properties

Default Hour - The time that we start at when we play the map;

Time Speed - Speed of time in ratio of game-time/real-world-time;

Sun Speed Curve - ADVANCED:  This curve gives you precise control over the movement of the sun vs. the actual time.  For instance, if you wanted to make days last longer, you could use this to slow down the sun for the duration of the day.  Just ignore this property if you don't need such functionality.

Moonlight Intensity - The brightness of the light from your moon actor; note that this must be set here, and not in the moon lamp's settings;

Use Day/Night - Uncheck this if you want to disable the dynamic features of the blueprint;

Display WorldTime - Logs the current time to the screen every frame, uncheck to disable.

2 comments:

  1. Hey Greg! I have this lighting problem on my attempt to do the same as you http://puu.sh/aiy3r/a46a3382c9.jpg where the underside of my objects are being illuminated by the underground sun. I can't figure out how you fixed this problem in your example where it works just fine. Could we talk through Facebook or Skype or email? Thanks.

    ReplyDelete
  2. this is very nice post and this kind of information is very useful whenever i going to travel new journey of field.

    Hadoop Training in Chennai

    ReplyDelete