Making A Day & Night Cycle in Godot 4

preview_player
Показать описание
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

---------------------------------------------------

More Videos!

✅ 13 Godot Engine Hacks You Didn't Know

✅ The Official Unofficial Godot Engine Music Video

✅ My First Impressions of the Godot Engine

✅ I Ported My Unreal 5 Prototype to Godot 4

✅ This Week in Godot

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:

#skyshader #godotengine #godot4
Рекомендации по теме
Комментарии
Автор

💛 Get GodotSky - A Dynamic Sky System for the Godot Engine

stayathomedev
Автор

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!

JonHuhnMedical
Автор

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

crigz
Автор

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

maniksharma
Автор

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...

MichaelH-zbgg
Автор

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

lifeleft
Автор

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

devbre
Автор

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 );
}

Mrtargi
Автор

Thank you for sharing, this is badass!

ezzie_baby
Автор

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.

INeatFreak
Автор

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

nezbro
Автор

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.

CrushingJosch
Автор

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

_gamma.
Автор

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

morgan
Автор

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

ianhall
Автор

Can you make a tutorial on terrain in godot 4

YannAbdel
Автор

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

gnastygames
Автор

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

sarang-games
Автор

Great video but where can i get the look up texture

appleminecraft
Автор

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

friendlyfox