Making A Day & Night Cycle in Godot 4

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

КОМЕНТАРІ •

  • @stayathomedev
    @stayathomedev  Рік тому +6

    💛 Get GodotSky - A Dynamic Sky System for the Godot Engine
    stayathomedev.com/product/dynamic-sky-system/?
    📣 Twitter - twitter.com/StayAtHomeDev
    🎮 Discord Server - discord.gg/dmYbvFYQRQ

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

    Outstanding work! I've been working on a VR flight sim in Unity as a hobby project, and I don't quite have the same mental prowess you have at figuring stuff out, so I had to come up with my own workarounds. I downloaded an eval version of Vue Esprit, and rendered a series of vertical slivers of sky. Basically one sliver for each altitude increment (starting at 0 feet and going up to 200k feet, in increments of 5k feet). And for each altitude, I also rendered several vertical slivers of sky representing different times of day, making sure to avoid rendering the sun or its bloom. Then in after effects I composited the slivers into one texture map. Then in Unity, I blend strips of the texture together based on the camera's altitude and the time of day, then take that final composited strip and stretch it across the sky dome to create the final base coloration of the sky. It's very crude and still needs some more elements, but that's what ya gotta do when you're much more right brain than left!

  • @crigz
    @crigz Рік тому +10

    What an amazing tutorial mate! Fantastic info in this one.

  • @maniksharma9736
    @maniksharma9736 Рік тому +5

    It will look even better with better environment to show cases it.
    You can use the new port of lumbard yard scene.

  • @01lifeleft
    @01lifeleft Рік тому +4

    Awesome! This gonna save me from a lot of headaches.

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

    i was going to build a daynight cycle myself... but you did such an amazing work here. Great stuff.

  • @MichaelH-zb8gg
    @MichaelH-zb8gg Рік тому +9

    This looks very interesting, well done
    The only thing Godot 4 is missing and that is stopping me from moving to it full time is the lack of a 3d terrain editor (like unity), maybe someone will address that in the future...

    • @stayathomedev
      @stayathomedev  Рік тому +4

      A terrain editor, or some form of external connection, would be great. Definitely something I'll be looking into in the future.

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

      They are working on a official c++ plugin for that.

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

      You can also create a landscape using something like blender. Which is currently outside my scope but if you can create the 3d model of a landscape you can just import that if the terrain is just to small for your liking. There are suggestions online about cutting your 3d object (landscape) into squares so that the game doe not try to load all of your 4,000 mile landscapes all at once on something like a mobile device loading your landscape piece by piece will save your program from slowing down trying to render it all

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

    Thank you for sharing, this is badass!

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

    I'd wished you would've added a bloom like high exposure effect to the sun during the day that reduces as it reaches to the horizon revealing the circular shape of the sun.

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

      You can by utilizing the volumetric fog option, setting the density relatively low and uping the anistropy!

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

    Thank you for this!!

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

    Phenomenal!

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

    Appears to be working in 4.2.2 see the itch link for further details.

  • @kuroganeyuu5928
    @kuroganeyuu5928 Рік тому +4

    Does this still work in 4.1?

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

    It would be great if you add README to your project. It took me a while to understand everything. Also you can add moon phases with smth like float sphere_intersect( vec3 view_dir, vec3 sphere_pos, float radius )
    {
    float b = dot( -sphere_pos, view_dir );
    float c = dot( -sphere_pos, -sphere_pos ) - pow( radius, 2 );
    float h = pow( b, 2 ) - c;
    return h < 0.0 ? -1.0 : -b - sqrt( h );
    }

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

    How do you generate or find the precalculated atmospheric scattering table?

  • @CrushingJosch
    @CrushingJosch Рік тому +4

    That's a really nice setup. Thanks for showing in detail how you made it and for offering it in your shop :)
    Ooooone question:
    Do you see any way to add shadows being cast from the clouds to the objects in the scene? I experimented with something like that back in UnrealEngine3 (there the system I used was called "light functions") and it added a whole lot of atmosphere to the scene.
    I am currently working on a top-down game where I also am implementing a day-night-cycle. I might use yours, as it is just set up a lot better than mine :D But then, as it's top-down, I don't see clouds or sun-disc anyways. BUT I would see moving shadows from clouds, which could look pretty neat.

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

      Thanks! If it's a 3D top-down...You could use the overall system still but because the sky isn't being shown, it doesn't get rendered, but you'd still get the cubemap reflections. For the cloud shadows...some games fake this by adding some cloud-like noise over the terrain, though they don't actually match up with what is overhead. You could, in theory place some basic meshes to get the actual shadows, since you're not going to see them, or overlay a moving noise texture to simulate the cloud shadows.

  • @_gamma.
    @_gamma. 5 місяців тому +1

    Does this work for 4.2? Did v2 ever come out?

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

    how do i get the stars and galaxies to work in godot 4.2?

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

    Can you make a tutorial on terrain in godot 4

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

    i think it would be more accurate to dot the sun vector with the sky dome vectors so that it’s redder near the sun and bluer on the other side

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

      more importantly i think it would look more realistic

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

      also i’m curious how difficult it would be to dynamically subdivide a section of the water that is around where the sun would reflect into the camera

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

      Good point...not too big of a change

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

    Great video but where can i get the look up texture

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

    Looks fantastic, but what is the game about? what kind of game is it? I look forward to the next devlog :)

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

      This is focused on a series of open world tools and assets...starting with a dynamic sky system. Terrain and auto-landscape material coming...

  • @sarang-games
    @sarang-games Рік тому

    keep going bro. godot sky must beat unity/unreal sky

  • @Godot-Bro
    @Godot-Bro 3 місяці тому

    Can anyone help--I bought GodotSky and put it in my project. I am using Godot 4.2.2.stable. It took some effort to get it to show up, but now I get massive lag spikes on an interval of about 3 seconds where I go from 60 fps to 0 fps, and it lasts for about 2 seconds each time.
    Anyone else struggle with this??

    • @stayathomedev
      @stayathomedev  3 місяці тому +1

      Send me an email contact [at] stayathomedev [dot] com

  • @franciscolopez-kw2xq
    @franciscolopez-kw2xq Рік тому

    No se si solo me pasa a mi pero cuando intento descargar me manda a la zona 404

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

      You can send me a msg on the site if you're having an issue!

    • @franciscolopez-kw2xq
      @franciscolopez-kw2xq Рік тому

      @@stayathomedev probe como a los 15 minutos de poner el comentario, no se a que se debio ese error

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

      Maybe a server issue?

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

    Does it works with Godot 4.2 ?

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

      I also want to know

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

      Im trying so hard to see if this works but I cant even get the sun and moon to rotate so im guessing no

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

      @@GeneralChrisGaming Do you know how to setup the shader for this? I've managed to get the moon and sun to rotate but i cant get the shader script to work

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

      @@minhduyhoang9118 nah i gaved up after doing a bunch of other stuff which didnt work