Thursday, June 19, 2014

UE4 Time of Day Setup

My blueprint for a fully dynamic day-night cycle setup.  Download here.

Quick setup instructions:

- Extract archive;
- Copy the "Content" folder into your project folder (it should merge with the content folder already there);
- When it asks if you want to merge folders, say yes;
- Launch UnrealEd, and load the project you copied that folder to;
- Go to 'File > Open Level' and choose "TimeOfDayTemplate.umap" (it should be located under \YourProject\Content\Maps);
- Hit simulate, and watch the sun move!

Experiment with the properties in the blueprint.  I've written comments for all of them (I think), so it shouldn't be too hard to figure it out.  Quick tip: If you want to change the speed of time, "Time Speed" is what you're looking for.

For more details and information, see here: http://gregoryjb.blogspot.com/2014/06/time-of-day-blueprint-guide.html

Versions/Updates:

Version 1.2, 6/23/14, http://www.filedropper.com/daycycleskydome12
Added support for a moon;
Improved organization of variables, added new "ToD - Debug" section;
Fixed sun to move from East to West;
Sun's rotation is now calculated from a curve, use this to set sunrise/sunset times;
Added sample map;

Version 1.1, 6/19/14, https://drive.google.com/file/d/0B08tl8_2TWd1RzM3TE01VFlzYzQ/edit?usp=sharing
Changed sun's rotation to be based on time, not vice versa;
Split into multiple functions, for readability;
Various minor improvements;

7 comments:

  1. Hello, thanks for the time of day tutorials and the files. I got a question and perhaps something you could add in the future. How do you implement a moon into the time of day? I tried adding a second directional light sun but cannot figure out how to change the second sun to look like a moon? Any help would be appreciated. Thank you for the great article.

    ReplyDelete
    Replies
    1. Wish granted, new release has support for a moon in it! :)

      Delete
    2. Hello Greg,
      My sky and night is split in the middle and my sun and moon are not moving but my lights are...What am I needing to do? Can you post a youtube step by step video? OR email me a step by step? I am VERY new to BP's and I installed it right I just don't know how to setup in my map...Sirhope@gmail.com is my email.

      Delete
  2. Awesome work, this is what I was looking for!!

    I'm stepping through each peace of your blueprint to understand the concept behind your work. I want to add the T_Moon texture in the M_Sky_Panning_Clouds2_Custom material. I found the Texture Sample for the moont texture, but this node is unpinned. Can you give me a hint where to pin this texture sampler to get the moon texture in the final result?

    Thanks in advance!!

    ReplyDelete
  3. Hey I think 4.6 broke this :( I downloaded it and did everything the directions said, including rebuilding my lighting, and the sun still doesnt move and is stuck at the horizon :(

    ReplyDelete
  4. The site contains a very great article. the information present in this site will be very useful for us. thank you for sharing the blog with us.
    ROI Services in Chennai

    ReplyDelete