Depth Texture explained - Godot

  Рет қаралды 4,933

mohsen zare

mohsen zare

10 ай бұрын

At first when you open godot shader and get the value for depth texture it is hard to understand how to use the data which godot provide to us in shader, In this video I tried to clear everything about depth texture or depth buffer in godot
depth buffer is useful in many cases like for water shader

Пікірлер: 24
@mohsenzare2511
@mohsenzare2511 10 ай бұрын
I noticed that in Matrix indices I made a mistake I wrote M33, instead I should write M22, But the math and the rest is correct
@Chevifier
@Chevifier 10 ай бұрын
This is amazing, I knew about depth textures but never had someone explained the math behind it.👏
@mohsenzare2511
@mohsenzare2511 10 ай бұрын
Thanks Chevifier
@williamgodwin5582
@williamgodwin5582 10 ай бұрын
What interests me most is how much depth sampling affects performance. Some people write that this is not significant today, while others, on the contrary, believe that it significantly reduces performance.
@mohsenzare2511
@mohsenzare2511 10 ай бұрын
Yeah William, I think as it should grab the depth behind the plane it render the plane in a separate render like a transparent object, I am not sure maybe it the plane will behave like a transparent object But for making the a realistic water you have to use it And you are right if you make a mobile game it is better to not use this stuff
@williamgodwin5582
@williamgodwin5582 10 ай бұрын
@@mohsenzare2511 I was thinking more about objects color and normals blending
@cha8802
@cha8802 9 ай бұрын
After struggling to understand how depth textures worked in godot all day this video finally made it click for me. Great explanation! Thanks for sharing :)
@mohsenzare2511
@mohsenzare2511 9 ай бұрын
Glad it helped!
@chienbanane3168
@chienbanane3168 6 ай бұрын
This helped a lot, thanks!
@mohsenzare2511
@mohsenzare2511 6 ай бұрын
Glad it helped!
@melpeslier
@melpeslier 9 ай бұрын
You are a BOSS, good explanations and it is the godot doc's missing content. Won't you contribute and give more explanations right in the doc ?
@mohsenzare2511
@mohsenzare2511 9 ай бұрын
Thanks for your comment, I never participate in Docs, But if I have time and I can help why not, I will look forward to it
@Boildroid
@Boildroid 4 ай бұрын
what kind of books you suggest to learn shaders?
@spectrecular9721
@spectrecular9721 22 күн бұрын
Been struggling to grab the depth of a 3D scene in Godot 4.2 to be used in a fullscreen post-processing 'canvas_item' shader, as depth information is only available in 'spatial' shaders and unless I'm missing something, it seems depth information isn't stored in textures made via a SubViewport. Any tips?
@BeyCuber
@BeyCuber 9 ай бұрын
Hi Mohsen, thank you for the great video! I had a very basic question. When you do depth = texture(depth_tex, SCREEN_UV).r, what is the meaning of the ".r"? And what would it mean if I did ".x" instead or something?
@mohsenzare2511
@mohsenzare2511 9 ай бұрын
texture(depth_tex,SCREEN_UV) always return a vec4 with 4 component even if you sample a black and white texture with one channel, Depth Texture has also one channel and by .r or .x (Both work the same) means I just want to grab the red component, if you put .rb for example it means i want to grab red and blue channel in the format of vect2, You should read more about the concept of the shader I recommend to read "the book of shader", Search that on google
@BeyCuber
@BeyCuber 9 ай бұрын
@@mohsenzare2511 Thanks so much!
@DoubledEthan
@DoubledEthan 10 ай бұрын
Hi, i am learning c++ but for godot 4.1 (latest) i can't find a normal tutorial for beginners. Can you do it?
@mohsenzare2511
@mohsenzare2511 10 ай бұрын
I have a Gd Extension video series on my channel, Which explain how to start programming with c++ in Godot
@roquestral
@roquestral 4 ай бұрын
did not work for me on 4.1.3 :(
@artisanpixel
@artisanpixel 10 ай бұрын
How come the depth texture doesn't include the plane? Nice video by the way :)
@mohsenzare2511
@mohsenzare2511 10 ай бұрын
This is how it work, if it include the plane it has not use to us it shows everything behind the plane Thanks man
@catafest
@catafest 9 ай бұрын
you don't have an discord account ?
@mohsenzare2511
@mohsenzare2511 9 ай бұрын
Yeah, you can join with this link: discord.gg/2HuPFZksxd
sRGB color space & Linear color space concept in computer graphic
8:39
All about Fog Shader in Godot 4.0
18:25
mohsen zare
Рет қаралды 7 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 76 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 52 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 167 МЛН
Create 3D Text in Coreldraw
2:51
Promote Designs
Рет қаралды 9
Making Depth For Water Shader In Godot 4 ( Depth Texture )
8:14
Code It All
Рет қаралды 4,8 М.
Hiding texture repetition in Godot 4 | Tutorial
16:05
quwatz_
Рет қаралды 16 М.
Godot 4: how to implement interfaces in GDScript!
1:00:16
Tutemic
Рет қаралды 24 М.
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 128 М.
The Math behind (most) 3D games - Perspective Projection
13:20
Brendan Galea
Рет қаралды 381 М.
Path Based Mesh Generation in Godot 4
7:27
Crigz Vs Game Dev
Рет қаралды 26 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 76 МЛН