User Tag List

Page 1 of 4 123 ... LastLast
Results 1 to 40 of 159

Thread: [TUTORIAL] Quick Time-of-Day Setup

  1. #1
    2

    [TUTORIAL] Quick Time-of-Day Setup

    UPDATE: The pre-made blueprint is available for download! Get it here: http://gregoryjb.blogspot.com/2015/06/time-of-day-v14.html

    - 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 about this blueprint, go here: http://gregoryjb.blogspot.com/2014/06/time-of-day-blueprint-guide.html

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

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

    [EDIT Updated to v1.2]


    Original Post:

    Hey all,

    I've created a quick tutorial on how to set up a dynamic day-night cycle on the wiki:
    https://wiki.unrealengine.com/Tutorial:_Time_of_Day

    I noticed that there wasn't much info on this, so after figuring it out I decided to share it with you all.

    Hope this helps some people! And feedback is welcome

    EDIT: Updated the tutorial to include a section on environment customization events. Now you can change things based on the level being day or night!
    Last edited by gregdumb; 08-19-2016 at 03:35 AM.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  2. #2
    0
    Patron
    Join Date
    Mar 2014
    Posts
    33
    One question. How did you get "Light Source" as the target for Add Actor Local Rotation?

  3. #3
    0
    Quote Originally Posted by ParadodxCTRL View Post
    One question. How did you get "Light Source" as the target for Add Actor Local Rotation?
    In the 3D viewport, select your sun lamp, then right-click in the level blueprint editor and choose "Add reference to light source."

    This should work for you
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  4. #4
    0
    Samaritan

    Join Date
    Mar 2014
    Posts
    121
    Thanks gregdumb, this is great. Nice and simple!

  5. #5
    0
    Thanks Tesla!
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  6. #6
    0
    Patron
    Join Date
    Mar 2014
    Posts
    33
    Quote Originally Posted by gregdumb View Post
    In the 3D viewport, select your sun lamp, then right-click in the level blueprint editor and choose "Add reference to light source."

    This should work for you
    Ha, so simple, no wonder I didn't think of it. This is really cool now that I have it working. Now I'm trying to think about how I can cause events to trigger based on it being "night time".

  7. #7
    0
    Quote Originally Posted by ParadodxCTRL View Post
    Ha, so simple, no wonder I didn't think of it. This is really cool now that I have it working. Now I'm trying to think about how I can cause events to trigger based on it being "night time".
    I would go about it by, in the blueprint, check your sun's rotation and see if it is in the "night" range (aka below the horizon). Then cause events to happen if it is. If you check the skydome's blueprint (select it and click "Edit BP_Sky_Sphere" in the details panel) they have the setup for this, which they used to blend in the stars.

    EDIT: I'll update the tutorial to include something like this when I have the time
    Last edited by gregdumb; 03-30-2014 at 08:26 PM.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  8. #8
    0
    Very good, congratulations, I really liked it.
    It was easy to understand and quick to implement.
    [Compatibility List] Unreal 4 - Hardware Feedback (Leave your feedback on how the Unreal runs on your computer)

  9. #9
    0
    Quote Originally Posted by Weskey View Post
    It was easy to understand and quick to implement.
    Thanks! That's good to hear, means I did my job right
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  10. #10
    0
    Hi i have this working but I am looking for a way to get night to look correctly is this in engine or in the editor itself? I am also getting light from under terrain that i believe i can fix via BP but i need a better night sky but i can not find the sky settings for night anywhere.

  11. #11
    0
    Quote Originally Posted by Shoiko View Post
    Hi i have this working but I am looking for a way to get night to look correctly is this in engine or in the editor itself? I am also getting light from under terrain that i believe i can fix via BP but i need a better night sky but i can not find the sky settings for night anywhere.
    You can make changes to the sky in the skydome blueprint (just select it and, in the details panel, click "Edit BP_Sky_Sphere"). The underground lighting could probably be fixed by turning off the sun when it goes below the horizon, I'm working to update the tutorial in relation to demonstrate how to set up something like this
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  12. #12
    0
    Holy **** did not think that was a BP ... now i said it it starts with bp.... But yes i turn on and off the Sun brightness at 0.1 adn that works i just need to change the night settings now thanks.

  13. #13
    0
    Okay, to see where the sun is, just check your light's "Pitch" rotation value. If that's positive, it means it's nighttime. Here's the blueprint setup I used:



    (Just look at the bottom section, starting with "Get Actor Rotation.") You can then make decisions based on the "Night" boolean. The "Night Threshold" float determines how many degrees the sun must be below the horizon for it to count as night.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  14. #14
    0
    Alright, I've added the new section to the tutorial. This should fix the "sun coming through the ground" problem, and also give you a way to customize the environment to day or night.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  15. #15
    0
    you could use sun height to tell day and night at night the height is <0 To get the sky to actually change to night i had to modify the lerp to make my own night lery color and transition to that but now if i use a sky light my terrain gets bright at night. I'm going to see if yours does the same... are u using a terrain?

  16. #16
    0
    Also I think im going to add skylight behavior to the Sky sphere. its still weird that when night starts the skylight seems to illuminate like mad

  17. #17
    0
    Quote Originally Posted by Shoiko View Post
    you could use sun height to tell day and night at night the height is <0 To get the sky to actually change to night i had to modify the lerp to make my own night lery color and transition to that but now if i use a sky light my terrain gets bright at night. I'm going to see if yours does the same... are u using a terrain?
    I don't think height<0 will work, the sun in UE4 goes by rotation, not height. No, I'm not using a terrain in the tutorial, but I have used it before and it should work.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  18. #18
    0
    I see now I dont know what changed but the sun height does not even get to the top of or or -1 now. but i have it working. I'm adding the ability to control day cycle based on a total Seconds for cycle also I'm making a get Time function that works for 24 or 12 hour days., I've also integrated your change into the BP it self. Would you want me to share once I'm done? I'm brain storming adding Day night cycle and stor cycle to be able to blend to a weather environment state machine at random of on call.

  19. #19
    0
    Wow, nice work man! Sounds like you've made progress Feel free to add it to the wiki page if you want of course!
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  20. #20
    0
    Awesome job man! I really liked the way you added in the parts to trigger events for at day/night. The much simpler version I created ( https://forums.unrealengine.com/showthread.php?1237-Working-Basic-Day-Night-Cycle-w-Updating-sun ) didnt have that, but I'll likely be adding it.

  21. #21
    0
    Quote Originally Posted by gregdumb View Post
    Wow, nice work man! Sounds like you've made progress Feel free to add it to the wiki page if you want of course!

    No Clue on how to update wiki but:









  22. #22
    0







  23. #23
    0







  24. #24
    0







  25. #25
    0







    Updated the BP_Sky_Sphere with the changes for Day / Night, Also added adjustable Day night transitions based on seconds, configurable start time for the sun based on initial sun rotation is set to 0 0 0. I also updated the organization of the BP_Sky_Sphere to have better readable flow.

  26. #26
    0
    Man, that's a sweet setup. I like the fact that you put all the logic on the skydome instead of the level blueprint, so you can mirror it between levels. Also, I love your time setup Thanks for sharing!
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  27. #27
    0
    Hope it helps and most of the sectioning is my OCD kicking in. It should make it easier to read.

  28. #28
    0
    Quote Originally Posted by Shoiko View Post
    No Clue on how to update wiki but:
    I have some experience with MediaWiki, would you mind terribly if I handled that?

  29. #29
    0
    Quote Originally Posted by Shoiko View Post
    Hope it helps and most of the sectioning is my OCD kicking in. It should make it easier to read.
    **** dude, that's amazing! I have a few questions though.

    1. I noticed there's a Sky Light Variable in the default category, what exactly goes there?
    2. I also noticed that your terrain/scene gets a lot darker at night than mine does, how would I make mine darker?

    Thanks a bunch!

  30. #30
    0
    Quote Originally Posted by Axtel Sturnclaw View Post
    I have some experience with MediaWiki, would you mind terribly if I handled that?
    Feel free to update the page I made, guys! I'm definitely no expert in this subject. I just wanted a way to test out the dynamic GI, and realized there were no tutorials on a dynamic sun. So after I figured it out I posted it here. But anybody who knows more about this stuff (such as Shoiko ) can add to the wiki page if they want!
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  31. #31
    0
    Quote Originally Posted by leonn3k View Post
    **** dude, that's amazing! I have a few questions though.

    1. I noticed there's a Sky Light Variable in the default category, what exactly goes there?
    2. I also noticed that your terrain/scene gets a lot darker at night than mine does, how would I make mine darker?

    Thanks a bunch!


    1. I use a sky light for ambient lighting. The script brings that in to change the sky light to almost 0 at night because it some how made my texture red... now that i think about it my terrain material may be messing up my day and night lighting as im using an over lay... this might be it but blah...

    2. As before it might be my setting because my character gets dark but still visible.

  32. #32
    0
    Banned
    Join Date
    Mar 2014
    Posts
    34
    Hey guys,

    This is incredible. Nice work!

    Gregdumb, Tesla, Shoiko, Axtel: would you consider working together to update the wiki into a full tutorial, including details for default settings and variables that need to be created (and what each are for), in a step-by-step fashion? I know it would be some work, but many people would benefit from this information, and you guys have done a fantastic job with this.

    I would also suggest some information on optional additions, such as including a second directional light to act as a moon.

    And please continue to post here to let people know of the things you learn in the process!

    Again, fantastic work.

    Ben Halliday

  33. #33
    0
    Quote Originally Posted by Ben Halliday View Post
    Hey guys,

    This is incredible. Nice work!

    Gregdumb, Tesla, Shoiko, Axtel: would you consider working together to update the wiki into a full tutorial, including details for default settings and variables that need to be created (and what each are for), in a step-by-step fashion? I know it would be some work, but many people would benefit from this information, and you guys have done a fantastic job with this.

    I would also suggest some information on optional additions, such as including a second directional light to act as a moon.

    And please continue to post here to let people know of the things you learn in the process!

    Again, fantastic work.

    Ben Halliday
    Hi Ben,

    Thanks for the kind words, they are very encouraging! I will definitely update the page over time to include more detail. I'm still learning the stuff myself though, so it might take a while I originally intended it as a quick setup to admire the dynamic GI, but I guess I really should turn it into more of a full tutorial/reference.

    And thanks for being so interactive with the community. The support we are getting from you guys is awesome

    -Greg
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  34. #34
    0
    Quote Originally Posted by Shoiko View Post
    1. I use a sky light for ambient lighting. The script brings that in to change the sky light to almost 0 at night because it some how made my texture red... now that i think about it my terrain material may be messing up my day and night lighting as im using an over lay... this might be it but blah...
    The sky light is convenient, but in UE4 you should prefer to use an ambient cubemap, which will also give you specular reflections.

    It's a PostProcessVolume property, which is painful to use in BluePrint right now due to having to set all post process settings at once. I worked around that by adding a second PostProcessVolume that just overrides the ambient cubemap + intensity, and then setting the blend weight of that volume based on the time of day.
    Andrew - Twitter - Web

  35. #35
    0
    Quote Originally Posted by Ben Halliday View Post
    Hey guys,

    This is incredible. Nice work!

    Gregdumb, Tesla, Shoiko, Axtel: would you consider working together to update the wiki into a full tutorial, including details for default settings and variables that need to be created (and what each are for), in a step-by-step fashion? I know it would be some work, but many people would benefit from this information, and you guys have done a fantastic job with this.

    I would also suggest some information on optional additions, such as including a second directional light to act as a moon.

    And please continue to post here to let people know of the things you learn in the process!

    Again, fantastic work.

    Ben Halliday

    I will have to make a fully dynamic environment BP with random weather. I will post my process here. But I am in the learning phase right now. I'm just trying to get an understanding of environment and foliage and architectural design, but I'm learning in phases next week I'll be on Character, AI, and weapon development so it will all come together slowly.



    Quote Originally Posted by AndrewJSch View Post
    The sky light is convenient, but in UE4 you should prefer to use an ambient cubemap, which will also give you specular reflections.

    It's a PostProcessVolume property, which is painful to use in BluePrint right now due to having to set all post process settings at once. I worked around that by adding a second PostProcessVolume that just overrides the ambient cubemap + intensity, and then setting the blend weight of that volume based on the time of day.
    I have seen this parameter but even comming from Torque Game Engine I have yet to get into this aspect.

  36. #36
    0
    Quote Originally Posted by AndrewJSch View Post
    The sky light is convenient, but in UE4 you should prefer to use an ambient cubemap, which will also give you specular reflections.
    If you look here: https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/AmbientCubemap/index.html It says

    Note: The Ambient Cubemap has very limited local shadowing (SSAO only). Use a Sky Light instead when representing the sky's lighting.
    So I'm not too sure which is right.

    In other news, I've made my skydome blueprint completely self-contained, with the directional light built in. I'm thinking that we should make a fully-featured sky blueprint that people could just drag-and-drop into their levels and treat it like a built-in time of day feature (like cryengine's).
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  37. #37
    0
    That's a good point for static lighting, but afaik sky lights are only shadowed when baked into a light map; if you're changing the sky brightness dynamically, the ambient cube map should still be the highest quality option.
    Andrew - Twitter - Web

  38. #38
    0
    Quote Originally Posted by Ben Halliday View Post
    Hey guys,

    This is incredible. Nice work!

    Gregdumb, Tesla, Shoiko, Axtel: would you consider working together to update the wiki into a full tutorial, including details for default settings and variables that need to be created (and what each are for), in a step-by-step fashion? I know it would be some work, but many people would benefit from this information, and you guys have done a fantastic job with this.

    I would also suggest some information on optional additions, such as including a second directional light to act as a moon.

    And please continue to post here to let people know of the things you learn in the process!

    Again, fantastic work.

    Ben Halliday
    Sure, why not?

  39. #39
    0
    Quote Originally Posted by AndrewJSch View Post
    That's a good point for static lighting, but afaik sky lights are only shadowed when baked into a light map; if you're changing the sky brightness dynamically, the ambient cube map should still be the highest quality option.
    Ah thanks, didn't know skylights were static-only.
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

  40. #40
    0
    Okay, I have been working on more advanced time-of-day setups (no, I didn't quit ), but it's a bit hard to put into a tutorial, it can be quite a complicated setup. I feel that maybe I should make a map template that people could use, and just treat it like a built-in TOD feature. I'd put all the documentation for it on the wiki. The flip side is that it can be mistake-prone to use something you didn't make. What does everybody think?
    Fully dynamic Time of Day System blueprint: https://forums.unrealengine.com/show...e-of-Day-Setup Download it for free now!

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •