Making A Day & Night Cycle in Godot 4

  Рет қаралды 20,733

StayAtHomeDev

StayAtHomeDev

Күн бұрын

In this DEVLOG 0, I create a dynamic sky system with atmospheric light scattering and a full day and night cycle in the Godot Engine using the new sky shaders in Godot 4.0.
💛 Get GodotSky - A Dynamic Sky System for the Godot Engine
stayathomedev.com/product/dyn...
---------------------------------------------------
✅ Website - stayathomedev.com/?...
📣 Twitter - / stayathomedev
🎮 Discord Server - / discord
More Videos!
✅ 13 Godot Engine Hacks You Didn't Know
• 13 Godot Engine HACKS ...
✅ The Official Unofficial Godot Engine Music Video
• "I Can't Pronounce God...
✅ My First Impressions of the Godot Engine
• Godot Engine - My Firs...
✅ I Ported My Unreal 5 Prototype to Godot 4
• I Ported My Unreal 5 P...
✅ This Week in Godot
• 7 Indie Games This Wee...
0:00 Intro
0:12 GodotSky
0:38 Understanding Atmosphere Physics
1:40 The Shader
2:54 Establishing a Day and Night Cycle
3:32 Creating Atmospheric Scattering
5:03 Using EYEDIR Variable
5:56 Creating the Sun Disc and Adjusting Sun Characteristics
6:33 Day Night Cycle Test
Resources:
Godot - godotengine.org/
Godot Documentation - docs.godotengine.org/en/stable/
Download Godot - godotengine.org/download
Nvidia Accurate Atmospheric Scattering - developer.nvidia.com/gpugems/...
#skyshader #godotengine #godot4

Пікірлер: 43
@stayathomedev
@stayathomedev Жыл бұрын
💛 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
@crigz
@crigz Жыл бұрын
What an amazing tutorial mate! Fantastic info in this one.
@stayathomedev
@stayathomedev Жыл бұрын
Thanks!
@JonHuhnMedical
@JonHuhnMedical 10 ай бұрын
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!
@01lifeleft
@01lifeleft Жыл бұрын
Awesome! This gonna save me from a lot of headaches.
@stayathomedev
@stayathomedev Жыл бұрын
Great to hear!
@maniksharma9736
@maniksharma9736 Жыл бұрын
It will look even better with better environment to show cases it. You can use the new port of lumbard yard scene.
@stayathomedev
@stayathomedev Жыл бұрын
Just did that on Twitter!
@MichaelH-zb8gg
@MichaelH-zb8gg Жыл бұрын
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 Жыл бұрын
A terrain editor, or some form of external connection, would be great. Definitely something I'll be looking into in the future.
@maniksharma9736
@maniksharma9736 Жыл бұрын
They are working on a official c++ plugin for that.
@billielynploof9317
@billielynploof9317 Жыл бұрын
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
@INeatFreak
@INeatFreak Жыл бұрын
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 Жыл бұрын
You can by utilizing the volumetric fog option, setting the density relatively low and uping the anistropy!
@devbre
@devbre 8 ай бұрын
i was going to build a daynight cycle myself... but you did such an amazing work here. Great stuff.
@stayathomedev
@stayathomedev 8 ай бұрын
Thanks!
@CrushingJosch
@CrushingJosch Жыл бұрын
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 Жыл бұрын
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.
@erikdong
@erikdong Жыл бұрын
Phenomenal!
@stayathomedev
@stayathomedev Жыл бұрын
Thanks!
@ianhall7513
@ianhall7513 Жыл бұрын
How do you generate or find the precalculated atmospheric scattering table?
@kuroganeyuu5928
@kuroganeyuu5928 10 ай бұрын
Does this still work in 4.1?
@appleminecraft
@appleminecraft Жыл бұрын
Great video but where can i get the look up texture
@_gamma.
@_gamma. 13 күн бұрын
Does this work for 4.2? Did v2 ever come out?
@Mrtargi
@Mrtargi Ай бұрын
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 ); }
@nezbro2011
@nezbro2011 29 күн бұрын
Appears to be working in 4.2.2 see the itch link for further details.
@YannAbdel
@YannAbdel Жыл бұрын
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
@sarang-games
@sarang-games 9 ай бұрын
keep going bro. godot sky must beat unity/unreal sky
@projectavalongame
@projectavalongame Жыл бұрын
Looks fantastic, but what is the game about? what kind of game is it? I look forward to the next devlog :)
@stayathomedev
@stayathomedev Жыл бұрын
This is focused on a series of open world tools and assets...starting with a dynamic sky system. Terrain and auto-landscape material coming...
@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 5 ай бұрын
Does it works with Godot 4.2 ?
@valotharion
@valotharion 3 ай бұрын
I also want to know
@GeneralChrisGaming
@GeneralChrisGaming 2 ай бұрын
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 Ай бұрын
@@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 Ай бұрын
@@minhduyhoang9118 nah i gaved up after doing a bunch of other stuff which didnt work
5 Games Made in Godot To Inspire You
4:14
StayAtHomeDev
Рет қаралды 19 М.
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 942 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 105 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 38 МЛН
Do THIS Before You Publish Your Godot Game
3:33
StayAtHomeDev
Рет қаралды 153 М.
Hiding texture repetition in Godot 4 | Tutorial
16:05
quwatz_
Рет қаралды 16 М.
Improving Environment Graphics in Godot 4 - Tutorial
6:54
Wrobot
Рет қаралды 2,1 М.
Godot 4 3D Day Night Cycle Using Physical Sky
4:28
Robin Lamb
Рет қаралды 8 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
10+2 AWESOME ADDONS for GODOT 4
8:36
MrElipteach
Рет қаралды 131 М.
Godot Custom Post Processing : A Comprehensive Guide !
17:34
Sky Shaders in Godot 4.0 | What You Should Know
5:42
StayAtHomeDev
Рет қаралды 38 М.
How Bugatti's New Electric Motor Bends Physics
9:25
Ziroth
Рет қаралды 77 М.