Making Depth For Water Shader In Godot 4 ( Depth Texture )

  Рет қаралды 6,540

Code It All

Code It All

Күн бұрын

Пікірлер: 35
@Code_It_All
@Code_It_All 6 ай бұрын
Hey guys, I just made a new Discord server, feel free to join: discord.gg/AGt8u2RABE
@3darts598
@3darts598 4 ай бұрын
Can you make a totrial in underwater breathing and swimming, and also adding it in random generation world
@amazingmation97
@amazingmation97 7 ай бұрын
Great video. I've just recently started learning about shader materials. This series is a great help to understand how they work. :D
@UKT_Xetarr
@UKT_Xetarr 8 күн бұрын
Quick idea for a tutorial that might help a lot of people for that (+ it's a little challenge 😊) "how to make the water interactable" (water moves with the mesh that goes in or out)
@Benjamin_Thio70
@Benjamin_Thio70 7 ай бұрын
This is the first time I subscribe to a channel that fast... The video content is ✨❤️❤️❤️✨ ... Hard to see good content like this in yt anymore, pls keep it up, I want more content like these 😊.
@Code_It_All
@Code_It_All 7 ай бұрын
Thanks for the feedback, Glad you liked the videos !
@edouardwinder661
@edouardwinder661 Ай бұрын
Awesome video keep up the good work. You are very talented to make clear explanation I must say. I would like also your opinion about movement of object on water like boat trail. No good tutorial updated works/ or explain it well like you do
@Frank_G_Finster
@Frank_G_Finster 7 ай бұрын
Very valuable content. Well explained and easy to follow for intermediate hobbyist coders like me. Thank you very much! Liked and subscribed.
@JimmyBriggs
@JimmyBriggs 7 ай бұрын
keep it up! these are great. I like that you focused on just depth. hoping to see you revisit refraction & reacting to objects in water in separate videos respectively.
@josioh5725
@josioh5725 7 ай бұрын
Extremely Cool and you can teach really nicely! You just gained a new subscriber ❤️. Keep it up 💪🏽
@MisterBr0wn
@MisterBr0wn 7 ай бұрын
awesome tutorial, thank you!
@bigedmundo8100
@bigedmundo8100 7 ай бұрын
Very nice. Very helpful. Thank you very much for this tutorial..
@kunal007kj
@kunal007kj 7 ай бұрын
well explained. great tutorial. thanks❤
@em4nuelis
@em4nuelis 7 ай бұрын
Thank you! Been waiting for this. Your videos have been very informative. After moving from Unity to Godot they gave me a kickstart. Would you mind posting the full code in the description in later videos? So as not to scroll through what was missed. And yes: please make a followup video on all the other details that were not included in this video. This is too interesting
@Code_It_All
@Code_It_All 7 ай бұрын
I'm super glad you find my videos helpful, There will be a github repo for projects in the future hopefuly...
@BenJTGER
@BenJTGER 7 ай бұрын
I didnt understand anything of the things you said because shaders are magic to me, but i reallllyy liked it
@richslonaker2768
@richslonaker2768 7 ай бұрын
Another great video. Thank you for doing this. I do have a question, how do you handle a player that walks into the water and can see underneath because the water has no depth it looks like normal instead of looking like water… Do you understand?
@Code_It_All
@Code_It_All 7 ай бұрын
You would probably need to apply another shader to the viewport when ever the player in under water and switch it off when it's not, the shader would be different than this one
@wizk875
@wizk875 23 күн бұрын
Can we process Fast Fourier transform on a shader ?
@MikeMcRoberts
@MikeMcRoberts 5 ай бұрын
Great but now make it react to objects such as a moving boat.
@Code_It_All
@Code_It_All 5 ай бұрын
Working on it !
@jethdaflip7741
@jethdaflip7741 4 ай бұрын
Is it possible to use c# for the shader textures?
@meccanizer
@meccanizer 7 ай бұрын
Did you ever figure out how to stop the screen_uv from refracting things not under water? Still haven't figured out a solution.
@Code_It_All
@Code_It_All 7 ай бұрын
I used your solution which was better than the original one, however it seemed like there was still a bit visible, The method I came up with was to use the depth texture to find the "wavy" part which would be white, all I had to do was to not sample from _suv in those parts, but there would be a thin outline around it which I tried to fix, since there is no way lerp between 0 and 1 in shader I had no idea what was the solution.
@meccanizer
@meccanizer 7 ай бұрын
​@@Code_It_All Do you have code for it. Also doesn't the mix() function act as a lerp? I checked the documentation and it says it acts the same as a lerp with the third value in the function being the weight. The solution I posted has an issue with distortion on the top of the screen, you can fix it by adding 0.010 to the screen_uv.y if you go too far it will start distorting on the bottom or sides. Only issue I found with the solution I posted is the screen uv is brought down the further away it is from the camera(which seems to also cause the distortion on the top problem). This seems realistic but I can't confirm. I don't know how to disable this effect without also removing the water distortion part of it.
@Code_It_All
@Code_It_All 7 ай бұрын
My depth code has the "wavy" parts in white and good parts in black, so how would you transition smoothly from 0 to 1 with mix ? The third argument of mix needs to change, where as third argumaent of Lerp can be the same. The code is similar to the one in this video, but depth texture is sampled using the _suv from the prev video, distance is very very low and then put the raw depth_blend ( without any beers law ) in the albedo.
@meccanizer
@meccanizer 7 ай бұрын
​@@Code_It_All I've managed to figure out how to cull the parts above the water using this code if(world.z > VERTEX.z){ ALBEDO = color * normal_screen* normal_depth_blend; }else{ ALBEDO = color * distorted_screen* distorted_depth_blend; } I see what you were talking about when you said there is a weird outline, there is like a thin whispy bit on the edge. I think I fixed it by setting the depth texture and or the screen texture to filter_nearest instead of filter_linear. See if that works.
@meccanizer
@meccanizer 7 ай бұрын
@@Code_It_All I've managed to figure out it using this code if(world.z >= VERTEX.z){ ALBEDO = color * normalScreen * normalDepthBlend; }else{ ALBEDO = color * distortedScreen* distortedDepthBlend; } I can see what you mean when there is a weird outline. I think I fixed it by setting the filter to filter_nearest to the depth texture, try that. If not, try playing around with the filters in the screen texture and depth to see which works better.
@darklord8793
@darklord8793 2 ай бұрын
how can you see trought the mesh if there is no alpha???
@Code_It_All
@Code_It_All 2 ай бұрын
We are not actually seeing through it, it's an illusion using the screen texture which is taken before the mesh itself was rendered
@toby58
@toby58 7 ай бұрын
Can the water surface reflect object above surface if view at low angle?
@semaph0re
@semaph0re 7 ай бұрын
You should provide a link in the description to the code so we can just copy-paste without watching the video 😛
Mirrors, Every Way You Can Make Them In A Video Game
8:14
Code It All
Рет қаралды 65 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 350 М.
Part 5. Roblox trend☠️
00:13
Kan Andrey
Рет қаралды 2,7 МЛН
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 720 М.
So I Made A Water Shader In Godot 4 And It Was Quite Simple
11:32
I Made An Endless Ocean in Godot 4
8:40
StayAtHomeDev
Рет қаралды 38 М.
Immersive Sim in Godot 4: COGITO - Overview
8:22
Philip D
Рет қаралды 43 М.
Hiding texture repetition in Godot 4 | Tutorial
16:05
quwatz_
Рет қаралды 19 М.
I Tried Godot VisualScript In 2024 ( And Found An Alternative )
8:19
MORE VFX Shader Techniques ft. Godot
8:43
onetupthree
Рет қаралды 26 М.
How to make things float in Godot 4
7:07
Crigz Vs Game Dev
Рет қаралды 28 М.
WATER SIMULATION in Godot 4
11:27
Crigz Vs Game Dev
Рет қаралды 122 М.