So I Made A Water Shader In Godot 4 And It Was Quite Simple

  Рет қаралды 37,751

Code It All

Code It All

5 ай бұрын

Making water in godot 4 is actually much simpler than you think, making it realistic, lighting and whatelese is taught in this tutorial.
• KNOWN ISSUES:
The refraction effect shown in this video is still an experiment, meaning sometimes if you put an object in front of the water you can see waves around it, the work around would be to lower the amplitude multiplier on _suv variable or just turning the effect off, it really depends on your game, however for like a small pond or surafce water this should work fine.
GDQuest's channel: ‪@Gdquest‬
You'll learn about normal maps, shaders, textures, noise, vertex shaders, fragment shaders, even if you're just starting oit on godot.
you can use this in your games or projects ( credit is appreciated ) for horror games, fps games, shooters, adventure, 3d and even 2d games.
Things We'll use in this shader:
ALBEDO
NORMAL MAP
ROUGHNESS
NORMAL
chromatic abberation
UV offseting
UV scaling
Check out my previous project ( Realistic Horror FlashLight ) :
• How To Make A Realisti...
Getting Started In Godot ?
check this out:
• How To Make A Simple F...
original godot logo in the thumbnail by Andrea Calabro, license (CC BY 4.0 International): creativecommons.org/licenses/...
#realism #realistic #fps #godot #game #gameplay #realistic #lighting
#water #shader #programming #gdscript #tutorial #howto

Пікірлер: 92
@Code_It_All
@Code_It_All 5 ай бұрын
PLEASE READ • KNOWN ISSUES: The refraction effect shown in this video is still an experiment, meaning sometimes if you put an object in front of the water you can see waves around it, the work around would be to lower the amplitude multiplier on _suv variable or just turning the effect off, it really depends on your game, however for like a small pond or surafce water this should work and I'll see if I can fix it in the second part. Your help would be appreciated.
@atirutwattanamongkol8806
@atirutwattanamongkol8806 5 ай бұрын
Can you up the volume in post pls I just can't 😭😭
@Code_It_All
@Code_It_All 5 ай бұрын
So sorry for the audio
@l3andfriends
@l3andfriends 10 күн бұрын
have you found a fix to this yet?
@user-qv1vl8bn2m
@user-qv1vl8bn2m 5 ай бұрын
The video is kinda quiet
@999satyam
@999satyam 5 ай бұрын
Same. I thought it was only me.
@Cunnah101
@Cunnah101 5 ай бұрын
what?
@blarvinius
@blarvinius 5 ай бұрын
Or the audio, you might say... 😊
@Xenthera
@Xenthera 5 ай бұрын
Plenty loud on my phone. Had to turn it down a bit
@timisafe809
@timisafe809 5 ай бұрын
Me when no adhd inducing video
@wukerplank
@wukerplank 5 ай бұрын
Thank you! Looking forward to the depth part as well 😊
@FriendshipMech
@FriendshipMech 5 ай бұрын
For a tutorial about something as complex as writing shaders you made this super easy and straightforward to understand. Great tutorial, I'm hoping you make that part two!
@whatsupbro3
@whatsupbro3 4 ай бұрын
This video was incredible!! I've always struggled with understanding shaders, but this video actually thoroughly went through what each function and variable does. I loved this tutorial, i haven't seen anything else on youtube describe shaders in this coherent of an explanation. I'll be sticking around for part two!
@jasoniswrongabouteverythin8230
@jasoniswrongabouteverythin8230 5 ай бұрын
This video is awesome. A few months ago I spent a couple days trying to write a similar shader but it didn't really work out. This is great! And very easy to follow! You've earned a new subscriber
@meccanizer
@meccanizer 5 ай бұрын
I highly recommend adding a second noise textures then blending it with the first one. Then scrolling it in the opposite direction to give the waves more life and to hide any warping. Looks much better then just using the single noise texture.
@user-ch2ou4tr1i
@user-ch2ou4tr1i 4 ай бұрын
yeah I was about to type this same piece of advice. Waves in general are always reflected off of the corners of the object containing the water. which creates and interference effect. scrolling two noises against each other mimics this.
@user-ch2ou4tr1i
@user-ch2ou4tr1i 4 ай бұрын
this same principle will give you much better water caustics as well.
@havocthehobbit
@havocthehobbit 5 ай бұрын
This was great, I learnt alot. Please keep making videos , you have a style that works well
@yannickbovier3915
@yannickbovier3915 5 ай бұрын
Going to tinker with this right now ! Subscribed for the water depth part
@lossynights
@lossynights 5 ай бұрын
Thanks a bunch for this, your explanations were very helpful and the demonstrations you did were also great.
@guilllexx
@guilllexx 5 ай бұрын
Amazing content ! keep up the good work :)
@Bread-qz3ht
@Bread-qz3ht 5 ай бұрын
Amazing tutorial, really helped me tp understand shaders more
@AlexanderPrussak
@AlexanderPrussak 5 ай бұрын
TYSM, good learning. love the jazz music
@Benjamin_Thio70
@Benjamin_Thio70 4 ай бұрын
just coming from the other videos, well explained... LOVE IT~
@ThalisUmobi
@ThalisUmobi 2 ай бұрын
This is the most painless shader tutorial i've ever seen! So simple and direct, mostly using the editor features, no alien math involved, chef's kiss!!!
@Code_It_All
@Code_It_All 2 ай бұрын
Thanks! Making it simple was the goal honestly even though it might not look the best shader out there...
@garffild
@garffild 4 ай бұрын
Great video! Thank you!
@Matrox473
@Matrox473 5 ай бұрын
Nice video ! keep it up :)
@YeeDevs
@YeeDevs 2 ай бұрын
besides the quiet video and the oily look to the aberration this was a rather good introduction to Shaders in Godot.
@635574
@635574 5 ай бұрын
Static surface normal map is kinda ugly, if you want something that appears to move youd need to blend 2 noise patterns that are in motion, IDK the details.
@Code_It_All
@Code_It_All 5 ай бұрын
I once did something similar with mix() function and switched between two noises with sine(TIME)
@leo_1487
@leo_1487 5 ай бұрын
Great video!
@Code_It_All
@Code_It_All 5 ай бұрын
Thanks!
@ld2studio675
@ld2studio675 5 ай бұрын
Very interesting. Thank you for sharing
@MelideProd
@MelideProd 3 ай бұрын
Thank you so much, I actually understand better shader coding thanks to this video! Also I love the little details from Godot renamed to « best engine out there » to the water mesh node called « wata », really fun !
@venetiria
@venetiria 5 ай бұрын
one of the best godot tutorıals in youtube. seviliyorsun
@anthonygg_
@anthonygg_ 5 ай бұрын
You deserve 10000 times the subscribers. Good video.
@Mcs1v
@Mcs1v 4 ай бұрын
Eyyy, you just won a subscriber with that goldsrc reference (just kidding). Keep up the good work! Back to that known issues: "if you put an object in front of the water you can see waves around it" Just pass the depth buffer too with the screen space buffer and sample from it with the calculated suv coords. If the sampled depth is bigger than the depth from the vertex shader, just skip the screen texture from the final result. Its not the best approach, but its solves the weird artifacts with the front objects. The more advanced version: do a binary search between the original screen space UV and the calculated screen space UV to find the edge of the object and use lerp to the edge (its fill up the holes with a nice transition and the holes will be less noticeable)
@Code_It_All
@Code_It_All 4 ай бұрын
Lol, thanks a lot. I played around with the depth buffer, and switched between calculated suv and original one, it kinda "works". Thanks for the tip man!
@rerere1569
@rerere1569 3 ай бұрын
Damn thank you so much, good stuff
@baq99
@baq99 2 ай бұрын
Water highlights on the ocean floor are called caustics. Interesting stuff in ray tracing with caustics as they're incredibly difficult to simulate using rays. U and V in UV are literally X and Y in XY. Someone super clever decided to rename the axes for pixels just to confuse everyone and now we all have to write UV.x and UV.y which when you think about it is like saying XY.x and XY.y which makes no sense. Otherwise, this is a super cool video. I'm always on the lookout for new videos about water shaders and this is an excellent example. Could you do a video delving into the vertex shader next and explore something like Gerstner waves. Currently trying to export a surface approximation for a Gerstner wave algorithm for buoyancy (which is harder than you'd first imagine). I'm also trying to transition between beach waves and ocean waves as the shader detects shallow water. Also a nightmare. Great stuff though! I'm looking forward to more.
@Code_It_All
@Code_It_All 2 ай бұрын
Thank you, yeah I had to approximate the caustics in a super simplified way that didn't require those stuff. As for the vertex waves I'm not sure if I can handle that yet lol, but I'm always on the lookout for new stuff...
@baq99
@baq99 2 ай бұрын
What you've produced is really good and you explained everything really well. Maybe go for a sin wave next as they're a bit easier than Gerstner waves? I think the second part of the video you referenced takes you through it. Either way keep at it boss! Great content!
@studiomalaka
@studiomalaka 5 ай бұрын
I also sometimes keep putting an "f" after float numbers like you did at 5:47! :D
@Code_It_All
@Code_It_All 5 ай бұрын
Lol
@studiomalaka
@studiomalaka 5 ай бұрын
@@Code_It_Allyears spent developing with Unity can't just be forgotten without any issues I'm afraid 🤣
@oplayer9846
@oplayer9846 5 ай бұрын
Wow shaders look like magic to me
@TheBendixSA
@TheBendixSA Ай бұрын
the effect at 8:33 is called "Water Caustics" or just Caustics... not that many years ago it was all the rage, today it's taken for granted.
@jRsqILVOY
@jRsqILVOY 2 ай бұрын
The caustics illusion is amazing for how relatively simple it is (physical simulation is very complicated).
@kairu_b
@kairu_b 5 ай бұрын
Nice vid!
@sturdyfool103
@sturdyfool103 5 ай бұрын
If you’re trying to make it look better with your caustics, you should change your chromatic aberration’s intensity based off of the water’s surface normal
@MikeMcRoberts
@MikeMcRoberts 5 ай бұрын
Now make the water react to things in the water such as boats
@drawmaster77
@drawmaster77 5 ай бұрын
nice tutorial. I've been using Unity for a decade, considering making a switch to Godot..
@boduzapho
@boduzapho 3 ай бұрын
good stuff but it does not scale up when you increase the planemesh size. I know there is a way to fix that but I am unsure how
@osaid56
@osaid56 5 ай бұрын
indeed a treasure this is.
@retrorimos5841
@retrorimos5841 4 ай бұрын
Thank you
@terrawest9500
@terrawest9500 4 ай бұрын
Thanks for this tutorial. I tried to figure out water ripples. (circles that goes and grows around an object interfering the water surface) but can't figure that out. Could you help me please?
@Code_It_All
@Code_It_All 4 ай бұрын
You are so welcome! You probably need water simulation, I think there are some tutorials for godot on youtube.
@WiseNoodleOfficial
@WiseNoodleOfficial 4 ай бұрын
990th sub, absolutely earned it good sir! Remember me in the future o7
@Code_It_All
@Code_It_All 4 ай бұрын
I will, Thanks for the sub!
@TheRanguna
@TheRanguna 5 ай бұрын
I don't know godot, but a way to make the water "move" when using noise textures is to increase one (or multiple) parameters on the noise function. Usually this creates a moving effect on the noise.
@Code_It_All
@Code_It_All 5 ай бұрын
You could do that in godot, and that would probably give you more unique waves 🤔
@Xenthera
@Xenthera 5 ай бұрын
Just a little note, your specular highlights should be constantly changing. They’re just kind of spinning around in circles. Maybe animate the fractal noise texture?
@mad_circuits
@mad_circuits 5 ай бұрын
Nice. But You have to calculte the normal map after translating the UVs. It looks kinda weird to have the highlights squeezed over the surface.
@Code_It_All
@Code_It_All 5 ай бұрын
This was my first attempt in making a water shader so yeah it's not perfect, but I'm reading more about shaders to hopefuly improve myself.
@LukeDupin
@LukeDupin 4 ай бұрын
I want subnautica water. The uneven surface is really engaging
@rosiethekitty8526
@rosiethekitty8526 4 ай бұрын
i hav subscribed pls part 2
@cycomkid
@cycomkid 3 ай бұрын
Good
@ayzhol9620
@ayzhol9620 6 күн бұрын
Niiiiice
@SvenHeidemann-uo2yl
@SvenHeidemann-uo2yl 5 ай бұрын
Not Bad 👍
@RussPainter8
@RussPainter8 5 ай бұрын
Seems good. But i couldn't bear the music.
@kishirisu1268
@kishirisu1268 4 ай бұрын
If you making anythin in Godot - be sure to put ugly blue robot heads every where, or people could not understand this is really a Godot engine..
@nowherebrain
@nowherebrain 4 ай бұрын
good video, but kinda quiet..really had to crank up my headphones.
@jasonwilliams8730
@jasonwilliams8730 4 ай бұрын
👍
@dominobuilder100
@dominobuilder100 Ай бұрын
Nice video, but almost couldn't hear anything...
@minnoxzmozzesmx8915
@minnoxzmozzesmx8915 4 ай бұрын
audio too low
@zherka_pill
@zherka_pill 4 ай бұрын
increase audio
@ভোমরা
@ভোমরা 4 ай бұрын
godot
@simpson6700
@simpson6700 5 ай бұрын
wow another perlin noise water tutorial...
@prathamreddyzindabad9176
@prathamreddyzindabad9176 5 ай бұрын
you earned a subscriber.
@kvdrr
@kvdrr 5 ай бұрын
its called caustics
@Code_It_All
@Code_It_All 5 ай бұрын
Hmm thanks for the info!
@bagboybrown
@bagboybrown 5 ай бұрын
Quiet AF. That's unfortunate, I was kinda interested in this.
@hldfgjsjbd
@hldfgjsjbd 4 ай бұрын
Thumbnail is misleading, it doesn’t look even close. Also, that is not water, that’s some kind of jelly
@Code_It_All
@Code_It_All 4 ай бұрын
The thumbnail was made using this water shader, adjust color slider untill you get rid of transparency, also there was some other light sources in my scene.
@Darkstrawberry15
@Darkstrawberry15 4 ай бұрын
@@Code_It_All As some other people have pointed out, the reason it looks like jelly instead of fluid is because the noise is warping but staying in the same shape and location. To give a better illusion of a liquid surface the noise itself should be animated instead of just the UVs.
@MerlasPaul
@MerlasPaul 4 ай бұрын
yeah its easy to build shit, its hard to make it realistic :)
@Gureenu
@Gureenu 5 ай бұрын
yo nice video man, just a thought please increase your sounds volume in the future just a bit and two tads other then that your video was amazing and you explain things pretty well
I Made An Endless Ocean in Godot 4
8:40
StayAtHomeDev
Рет қаралды 34 М.
Sky Shaders in Godot 4.0 | What You Should Know
5:42
StayAtHomeDev
Рет қаралды 37 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 55 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 7 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 30 МЛН
Mirrors, Every Way You Can Make Them In A Video Game
8:14
Code It All
Рет қаралды 63 М.
How Games Fake Water
22:52
Acerola
Рет қаралды 197 М.
The biggest lie in video games
15:18
AIA
Рет қаралды 1,6 МЛН
Hologram Shader - Godot 4
10:45
Pixezy
Рет қаралды 3,4 М.
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 721 М.
Using Terrain3D in Godot 4 - Part 1
23:48
Tokisan Games
Рет қаралды 38 М.
5 Games Made in Godot To Inspire You
5:02
StayAtHomeDev
Рет қаралды 30 М.
Переходишь с Unity на Godot? Посмотри это видео!
25:19
Тот Самый Келин
Рет қаралды 108 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 55 МЛН