Adding a moon and stars | Day Night Cycle In UE 5 | Part 2

Поділитися
Вставка
  • Опубліковано 28 вер 2024

КОМЕНТАРІ • 84

  • @InsertNameHereGameDev
    @InsertNameHereGameDev  Рік тому +2

    I'm sorry for the mic quality, the next video will improve that. I also want to hear some feedback about this hyper cut style of tutorial. Is it too distracting? Hard to follow? Let me know in the comments.
    Also I am going to answer the moon mesh vs moon texture debate. It does not matter what you use. The mesh method is easier to customize lighting wise and also looks really great. The problem is that it requires a more complicated material setup and has problems with occlusion with volumetric cloud unless you set the distance to a massive distance away (which has it's own set of problems). The texture approach is very easy to implement, work with and doesn't produce most of the problems that a moon mesh has. No matter what, always take a look at your project and decide which one you want.

    • @MirrorsEdgeGamer01
      @MirrorsEdgeGamer01 11 місяців тому

      Thank you for these videos. I just wanted to let you know that *S* + *LMB* will create a scalar parameter.

    • @TheMechanoLab
      @TheMechanoLab 5 місяців тому

      @@MirrorsEdgeGamer01 No it will create Sequence

    • @MirrorsEdgeGamer01
      @MirrorsEdgeGamer01 5 місяців тому

      @@TheMechanoLabNot in the material editor; this is true for non-material-based blueprint editors.

  • @natetaylor8593
    @natetaylor8593 4 місяці тому

    Dude this is one of the most comprehensive, well executed and easy to follow tutorials I’ve ever seen. Thank you so much!!

  • @mungulor
    @mungulor Місяць тому

    you have single handedly inspired me to continue with my game dev with these easy tutorials

  • @alexpoc
    @alexpoc 9 місяців тому

    Awesomee duude tried for like a week to create a day night cycle scratched my head , saw lots and lots of videos even asked ai for help and still so farr away from your aproach witch i love it it's so elegant and "simple" comparing to what i tried before. Thank you a lot

  • @alekz6640
    @alekz6640 Рік тому +3

    Great tutorial. Outcome looks gorgeous, even better than some of the AAA games. Wish you luck with your videos!

  • @alfberht
    @alfberht Місяць тому

    Thank you so much!!! You just made my day! I hated the stars in the front of my moons)))

  • @freed3131
    @freed3131 6 місяців тому +1

    Hi, do you know how to deal with the conflicting shadows from the 2 directional lights?

  • @jacrossiter2097
    @jacrossiter2097 5 місяців тому +5

    I love how anytime you say "we have any issue" or "we need to do something" you instantly follow up with a reassuring "but that's actually very easy to do, here's how"

  • @Pricklesthebedbug
    @Pricklesthebedbug 4 місяці тому

    great Tutorial. at the end When I did the testing. my moon does a crazy 360 when it hits the top of the sky

  • @mitsunochihiragawa5049
    @mitsunochihiragawa5049 9 місяців тому

    Hello! This double parts tutorials of Night/Day is so cool, and ur english is so good with no akcent what i cant understand.
    Literally understand all what u say, and that made me to subscribe to ur chanel. Thank u bro, hope u will do more tutorials for AAA games
    (I wanna create some Withcer 3 type but in historical war of Poland-Ukraine-Russian Cossacs)

  • @denizaltay9275
    @denizaltay9275 Місяць тому

    Thanks for about this moon glare solution. I couldn't find any way to solve this problem.

  • @journeyoscar4346
    @journeyoscar4346 2 місяці тому

    Great tutorial, do you know how I could add chancing ambience audio for the day and night with the system?

  • @SolarCookie300
    @SolarCookie300 2 місяці тому

    You're a good man, thank yu

  • @MaxAWF
    @MaxAWF 6 місяців тому

    First of all, thanks for your work. This is the only video I could find that uses the same approach as I (without event tick or other non game implementation friendly ways). But, although that I deleted everything I had already done and try step by step your approach, unfortunately I run into the same 3 issues: A) The sky sphere does not have a unified directional movement, when the night's directional light reaches 90 degrees (at the center of the landscape) the sky sphere tilts/rotates 90 degrees, so having a milky way appearing from the east and ending in the west smoothly in linear movement does not happens. B) The element you have in the center of the texture, in my case a milky way nebula, presents problems caused by the texture's repetition. C) I can not add planets to the sky texture because they get distorted/stretched. Plus they appear more than once caused by the texture's repetition.
    Anyway, this has already eaten me an entire month and I can't find an optimized approach to add a day night cycle without some kind of issue. I may end up adding static planet meshes which I really wanted to avoid, and a sky without nebula, or even remove completely the day/night cycle from my project.
    It would be nice if you had a Discord server.
    Thank you again.

    • @MaxAWF
      @MaxAWF 6 місяців тому

      Update: I discover what is causing this sky box tilt, and it's not 90 degrees, but 180. It's caused by UE 'Sun Position Calculator', tested this on an other world's location and this weird issue happens only when you are near and in the middle of winter. I encountered this in Atacama desert on June - July, then tested this on Sahara desert December - January, and I got the same result. It gives you the impression that the planet rotates upside down, north becomes south when the moon reaches the highest point in the sky sphere.

  • @IrrelevanterUserTag
    @IrrelevanterUserTag 2 місяці тому

    Thank you so much for this super helpful tutorial series! I'm trying to make an eclipse with it, but the moon doesn't seem to dim the light from the sun! What could be the reason for this?

  • @larabatech1200
    @larabatech1200 8 місяців тому

    A very detailed video, thank you so much

  • @MrRellikdakiller
    @MrRellikdakiller 2 місяці тому

    okay! so im following your tutorial....perfection up to this point....after you have achieved the total result that you wanted, and during play, you can see the desired result except....when you turn the camera the moon stretches at the EDGE of the viewport...giving it a blurred/stretch affect. have you found a fix to this yet? the depth of field is affected at the edge of the viewport.

  • @caseynarrates1796
    @caseynarrates1796 11 місяців тому

    Another great tutorial! Thanks again!

  • @timjroughton9931
    @timjroughton9931 5 місяців тому

    (UE5.3) Wow a actual tutorial that works, congratulation you beat the Epic update "haha gotchya"
    The only thing that slightly disappointed me was the stars rotation with the moon, here is why; the 'stars' are light years away from the moon shouldn't the move slower than the moon does? otherwise it just looks like one giant sky sphere texture.

  • @shubhambloggs7789
    @shubhambloggs7789 5 місяців тому

    what is the name of the node after you click alt+1+left click

  • @pandascreationstation
    @pandascreationstation 8 місяців тому

    Hi, thank you for the awesome tutorials. I have followed them and created a day and night cycle with moon and stars, like you shows us, however how do I render these in the sequencer?

  • @mathiashollstensson8862
    @mathiashollstensson8862 5 місяців тому

    Very good! Thank you very much! ⭐

  • @xabunoxx2850
    @xabunoxx2850 4 місяці тому

    I dont know why but but my moon spins 180 when it reaches its highest point. Any ideas?

  • @konstantinewhite614
    @konstantinewhite614 7 місяців тому

    Thanks, this very cool!

  • @VoidVR-th2yv
    @VoidVR-th2yv 4 місяці тому

    hi, I have a problem at 10:19, when you press 1 then left click, I don't get block 0

    • @xabunoxx2850
      @xabunoxx2850 4 місяці тому

      If its still not working for you, your shortcuts may have been changed. This is just used to create a Constant value, so you can create this my right-clicking empty space on the material graph and typing the word 'constant".

  • @ashwinj9879
    @ashwinj9879 9 місяців тому +1

    my moon texture doesnt look clean when moving, not sure if medium graphics setting is causing it

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  9 місяців тому

      I talked about that in the video. The reason for this is because of the Temporal Super Resolution turned on by default. It makes most stuff blurry when moving. There are a few ways to reduce it, but even in Fortnite it's one of the most annoying things when playing the game.

  • @AdireetiVlogs
    @AdireetiVlogs 10 місяців тому

    thanks for the tutorial im ur new subscriber

  • @DivergentDroid
    @DivergentDroid Рік тому

    Are you standing on a flat plane or is the ground in your video a sphere that actually matches the size of Earth? I ask because it makes a difference to how we view it via perception. The sky sphere you use reminds me of the Celestial Sphere. I wonder if I can simulate real world Celestial Navigation with this.

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  Рік тому +1

      It's a flat plane. I'm not fully sure what you want, but I believe you would be looking into a video like this one, made by the official Unreal Engine channel:
      ua-cam.com/video/xz-XBPjd2OY/v-deo.html|
      This tutorial here is more stylized than accurate. We already failed at accuracy when the moon did full rotations in one night. I'm just warning you that what your looking for might be a deep dark rabbit hole, one you may not come back from. Good luck :-).

    • @DivergentDroid
      @DivergentDroid Рік тому

      @@InsertNameHereGameDev I see. Thanks for the video. I'll check it out. Celestial Navigation (Cel Nav) is a method that uses the celestial sphere to locate your position on a flat plane called The Equatorial Plane. It proves Earth is not a sphere but a flat plane. It does this by taking angle readings via a sextant to a heavenly body. The zenith of that body forms a right triangle between, the star, it's Ground Position (position directly under the star on the surface) and you the observer. Two other readings are done for different stars. Circles of equal elevation on the sea surface is drawn for each area around the GP. Using this information one can figure out exactly where they are. Celestial Navigation works to save lives daily and it Only works on a flat plane they call the Equatorial Plane (which extends to become the Celestial Equator) The problem is if we lived on a globe and took the angle readings from the surface of a sphere Cel Nav could never work because it deviates from the Equatorial Plane or Celestial Equator which both the observer and GP of the star Must be on. It's not an easy thing to demonstrate in 2d because the entire system is designed around a celestial or sky sphere which is 3d in nature. (not an actual sphere but it's a function of perspective and how we view the heavens from our flat plane.)

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  Рік тому +1

      That is totally possible to simulate a very basic version of it with this, but it wouldn't be accurate over large pieces of land. In that case I do agree that you would probably want to do some atmosphere stuff like Starfield and No Mans Sky does, where it simulates planets. That would also require a lot of math to make the landscape simulate a real planet. It's not that it isn't possible to do, it's just going to take a lot of knowledge of planets, celestial bodies and so much more.

  • @leonardorusso8035
    @leonardorusso8035 6 місяців тому

    last step add mesh to the moon made me crash everything why? i have this problem: " the material of the moon was missing the usage flag busesd with nanite." make me crazy i lost everything

  • @b.delacroix7592
    @b.delacroix7592 3 місяці тому

    Anyone else have the sky sphere mirroring the star texture rather than just using a single copy of it?

  • @xPancakes4lyf
    @xPancakes4lyf 2 місяці тому

    anyone having an issue at 13:15 where the stars are not showing at all?

    • @xPancakes4lyf
      @xPancakes4lyf 2 місяці тому

      to anyone having the same issue i fixed it by changing the 'Star Blend Transition' - - that plugs into the power node - - Parameter from 0.1 to 1

  • @eddy-readysteady-go9001
    @eddy-readysteady-go9001 9 місяців тому

    do we do this even after we've completed part 1, day/night cycle?

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  9 місяців тому

      If you are happy with the first part, then you don't have to do the next one :-).

  • @tacoisfried750
    @tacoisfried750 6 місяців тому +2

    Is there a way to offset the rotation of the stars and the moon so they don't rotate together?

    • @xPancakes4lyf
      @xPancakes4lyf 2 місяці тому

      i know this comment is 4 months old, but in case you didnt already figure it out, you can add a panner node to the UV's input node on the StarTexture Parameter in the Material Blueprint. i changed the speed on the x to 0.001

  • @JamesKellyWickerman123
    @JamesKellyWickerman123 7 місяців тому +4

    Great video, gets a really nice result really fast.
    However, there's one thing I would change - I wouldn't recommend setting the source angle of the Moon Directional Light to 0 as this has a direct impact on shadow calculation. An angle of 0 results in impossibly sharp shadows.
    What I would recommend is having a Switch in the material to allow you to turn off the LightDiskLuminance for Index 1 (Moon) as this will allow you to use a nice large Source Angle for those lovely soft shadows without ending up with the Disk overlapping the moon texture. You could also use the Moon Mask to mask out the Disk if for whatever reason you want to have both, but the texture takes priority.

    • @BeginnerDev
      @BeginnerDev 7 місяців тому +1

      Great tip!

    • @acesonfire
      @acesonfire 6 місяців тому +5

      I am trying this method but my Light Disk is still showing through my moon. Perhaps I am doing something wrong.
      *EDIT* : I was indeed doing something wrong, I was using my "Moon Mask" named reroute node in my switch instead of my "Moon" named reroute node.
      For anyone else wanting to implement this method:
      1. Under your LuminanceCalc section create a Switch node(Make sure it is the one under the Math Section.)
      2. Click on the Switch node, in your details panel, under the inputs section, create 2 array elements by pressing the + button. Expand the drop down index menus and name one of the indexes "Disk" and the other one "Moon" (or pick your own names)
      3. Disconnect your "SkyAtmosphereLightDiskLuminance[1]" from the B slot of the add node and connect it to the "Disk" input of your Switch node.
      4. Drag out from the "Moon" input of your switch node and get your "Moon" named reroute node (Make sure you don't use the "Moon Mask" reroute node like I did)
      5. Now connect the Output pin of your Switch node into the B slot of the add node.
      6. Hit Apply.
      (Bonus) You can also make the "SwitchValue" input take in a parameter to swap between the values: 0 (your light disk) and 1 (your moon texture) if you wanted to.
      Now you can tweak the Source Angle of your moon to get the soft shadows while still using your Moon Texture like James was recommending.

    • @mathiashollstensson8862
      @mathiashollstensson8862 5 місяців тому +3

      @@acesonfire Great, thanks! I had to change the SwitchValue to 1 for it to work but it works great! 😃

  • @lukelewis9927
    @lukelewis9927 11 місяців тому +4

    In addition to ending up with a great looking sky, I have learned so much about how to use Blueprints from you. That is possibly my favorite takeaway from this.

  • @Malhar
    @Malhar 3 місяці тому

    Amazing tutorial, just one beginner question, the sky material doesn't seem to work well with Path tracing, as soon as I switch to path tracing, the clouds disappear, the sky it lit but the ground becomes black. is there any way I an fix that? or that's just not compatible with path tracing ? I'm on Unreal Engine 5.4.2

  • @alettamsmith1908
    @alettamsmith1908 Місяць тому

    Hi. Great tutorial. Some issues thow. First I would like to add a clock to my viewport for only days, hours and minutes. How can I do this as my cycle only count up to days. please respond soon. Thanks

  • @HannahLawler
    @HannahLawler 28 днів тому

    Thank you so much for this video! This was the best source I could find on actually making a moon asset! Cheers!

  • @bigbasbeardegummiland2756
    @bigbasbeardegummiland2756 10 місяців тому +2

    I find this project quite beautiful and also your blueprint is very neat and organized. Thank you so much for sharing your work!

  • @moniqueoosthuizen7879
    @moniqueoosthuizen7879 5 місяців тому

    Great vid! Subbed ❤ How do you add a second moon or other planet with different location. I tried for hours but just couldn't figure it out

  • @b.delacroix7592
    @b.delacroix7592 3 місяці тому

    I know this is old but I've noticed I get a second sunrise when the moon comes up. Maybe I missed some setting to stop that happening.

  • @Fishos
    @Fishos 2 місяці тому

    Very good tutorial but i have one problem, the moon image is on the opposite side of the moon light. Any fixes?

  • @jackryan8588
    @jackryan8588 3 місяці тому

    16:30 You can, in fact, use world position offset on the moon material.

  • @b.delacroix7592
    @b.delacroix7592 3 місяці тому

    See knowing that kind of stuff about the star fading places you as a master. For me, a beginner, my approach is brute force with time and your technique is much better.

  • @Crowfly
    @Crowfly 7 місяців тому

    Hey man can you please please show us m=how you can add static meshes to the cycle? Like if I add a planet and its an object make it sync with it? I need this so bad. I will pay just give me the link to patreon

  • @TheBubbajuju
    @TheBubbajuju 6 місяців тому

    You are a genius. Thank you. So satisfying.

  • @kevinhoward9930
    @kevinhoward9930 11 місяців тому

    Very good tutorial. Just what I've been looking for, I previously had issues with the moon not being behind the clouds properly.this is a much better method 👍

  • @kalex07
    @kalex07 11 місяців тому

    Can't wait to test this out when I have time. Are you planning on adding a seasons tutorial? I have the leaves materials to my trees set up to change colour and disappear in the winter. Just hoping that I can link them up to this. With a time and date display.

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  11 місяців тому +1

      Can't guarantee when it will come out (or even if), but it is planned to take this further with features like those you mentioned :-).

  • @TheIslandFarmer321
    @TheIslandFarmer321 10 місяців тому

    Is there a way to set the directional light without light index or 1 or 2? I ask because I wanted multiply different moons on different light sources

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  10 місяців тому +1

      if you add directional lights, they will still work perfectly fine. You just need to set the forward shading priority and you're ready to go. Note that this texture based moon won't work out too great then, because it's harder to get the position of your custom moons if they do not use light indexes. In your case I would look at moon meshes, because you can make them children of the moons and make them rotate with the moon (no extra code needed). Also, directional lights are expensive, so don't go too overboard with it. :-).

    • @TheIslandFarmer321
      @TheIslandFarmer321 10 місяців тому

      @@InsertNameHereGameDev thanks for the quick response! My goal is to have a day night cycle but to still have the game playable. The few issues I've been having and many games seem to have this problem. The dusk and dawn are unplayable (too dark.) This is horrible if the cycle is set to 1 hour. The other popular issue in games is trying to make house/base interiors not pitch black also. The auto exposure is suppose to fix this but breaks too many things imo. Global illumination is another fix but seems to distort a lot of graphics and makes my caves way too bright. My 3rd and 4th directional light fixed all this perfectly it seemed as the side angles of light illuminated inside the buildings plenty(also giving me options to remove uv from meshes on buildings to add more light), the caves were slightly darker and the dusk and dawn had awesome transitions (setting the intensity of 3rd and 4th low.) I didn't notice a huge performance drop on my potato.. I turned shadows off for the 3rd and 4th is that why? I kept them for the moon since that does look realistic and I had it brighter. I was going to take it a step further and make my 3rd and 4th moons be planet images. I thought this would be cool to tie into your 3rd video with the colors ( planets would work better anyways since the light intensity was so low for 3rd and 4th moon.) But ofc I have the light index problem... I would prefer to avoid the moon mesh as the planet .pngs I made would be complex for meshes. I thought is it possible to assign 3 images to one index? And offset the 2 images 90 degrees. Or maybe one big image with 3 planets?.. is there no other way to get the directional light? I broke my whole night cycle last night trying stuff. I don't think I saved the BP on the right oops. After I redo it all today I will try more things. Also is there a less performance thing than directional light? Like a ambient glow that can circle also (less performance)? Sorry if this is a lot to read but I feel like you are very close to having a perfect day night cycle for survival games. I will figure seasons out later

    • @TheIslandFarmer321
      @TheIslandFarmer321 10 місяців тому

      Also if I set the light index of 3rd and 4th moon to 1 for moon light the image no longer appears for any moon I'm guessing because 3 different light directions are calling for the moon image. For now I set the index to 0 for sunlight and very low intensity. It's a sloppy fix for the dusk and dawn but turning off shadows on dusk and dawn seems to have very low performance impact. I also reduced cubemap to 64 or 32 bc I don't know any gamers that care how good shadows look. This made a performance difference for me (maybe because 2 directional lights, x2 shadows) I also made a giant sun block mesh out of a cube that is under my level and on the sides. Initially this was to prevent light bleeding through into my caves at dusk and dawn but this seems to help performance also maybe because there's a lot less light/shadow calculations for the bottom and sides of my level???? The giant box cube doesn't seem to lower performance I just stretched a smaller one and textured black.?

  • @icagames9543
    @icagames9543 11 місяців тому

    Really great video, thank you so much!! 😀

  • @Pindatje456
    @Pindatje456 11 місяців тому

    Awesome video! One question, i saw your other video with the day/night cycle. You didn’t use a sky-sphere there. Is it possible to have a static mesh moon that rotates with the sun and emits light without using a sky sphere?

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  11 місяців тому +2

      Yeah it is possible. In your day night cycle blueprint, just add a sphere as a child to your moon directional light. Then on that sphere you created, add the moon material you want. Then on the x value in location (the red one), set the value to a big value with a minus on the beginning (start with -10000000 and move it further away based on if it is behind the clouds or not). Then scale up as needed on every axis (start with 10000 on each axis and scale up based on how big you want the moon). In this case then you can skip part 2 and 3 of the tutorial series, but if you want dynamic lights (aka street lights that turn off based on the time of day) you can check part 4.

    • @Pindatje456
      @Pindatje456 11 місяців тому

      Thanks allot for your detailed answer, appreciate it. Keep making these tutorials, they are very good :)

  • @TXNNGVGX
    @TXNNGVGX Рік тому

    A very good lesson, but the moon without the source angle seems artificial, is it possible to somehow preserve the light aura around the moon or move the texture to the foreground so that it blocks the hard light of the source angle and leaves only this aura?

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  Рік тому +2

      You are absolutely right. I can't believe I forgot about that. The easiest way would be to add a glow to your moon texture in GIMP or Photoshop, but I'll be releasing a video on how to add a customizable glow for the moon using materials. That will release later today (about the same time this video released yesterday). Thanks for the suggestion :-).

    • @InsertNameHereGameDev
      @InsertNameHereGameDev  Рік тому +2

      And here it is:
      ua-cam.com/video/Et9ZS5xbeJs/v-deo.html

  • @Lit_BoY
    @Lit_BoY 9 місяців тому

    Very good tutorial. It helped me a lot, thank you