This was the perfect guide. I've been learning about shaders, but no other videos actually take me by the hand to use an existing shader and write a custom shader. Instead of just showing us cool effects shaders can do, you showed us exactly where to go and what steps to take to make them ourselves. You've taught us how to fish today. Thank you.
Fantastic video, thank you so much! I learnt a lot. I tried a spatial shader in Godot 4.3 beta 3 because I want to get a depth map shader to work for some post-processing. I tried your base_shader and it just didn't work. When the QuadMesh was just used as an item in the scene, it did work with flip_faces: false, but with the POSITION code in the shader's vertex section so that it covers the entire view, it didn't. Eventually, I figured out I had to change the POSITION line from POSITION = vec4(VERTEX, 1.0); to POSITION = vec4(VERTEX.xy, 1.0, 1.0); (Keep flip_faces: true) I'm not 100% sure if the 1.0 z-value is ideal, but it does work now. So there must be some changes to shader code in the latest Godot version. (It did give me a warning about that line, but it took me a while to figure out that POSITION = vec4(VERTEX.xyz, 1.0) does not work.
Thanks again for this Tutorial. You are really becoming the Guru of Godot! I am only getting slowly and very cautiously my hands on Materials and Shader. Only on the Beginner level and have a long way to go. Want to go the path using decals and/or blending materials, for example to show an Android loosing it's artificial Skin and showing the Synthetic Structures beneath wherever it took a hit or clothes, armor and other equipables getting dirty/rusty/bloody or whatnot. You are a great help and an inspiration!
One of the best channels for learning Godot! I think i speak for the whole community - thank you for creating these videos and putting so much time and effort into teaching us !
Hey check out the new rendering effects added about 2 months ago. They let you insert passes into the shading pipeline, although it still has some limits and requires writing your code in GLSL using an external editor instead of GSL in Godot. Bastiaan Olij has A livestream on their channel showing this off by creating A godray shader.
For newer viewers trying out this tutorial, if the vertex code doesn't work, then enable flip_faces to true on the mesh instance, and replace the POSITION = vec4(VERTEX, 1.0) with POSITION = vec4(VERTEX, 0.0). I don't know why it works, but it does. Thank you to @AnatolBogun for the help.
This video is incredibly helpful and a fantastic intro to shaders. But you cannot call it a "comprehensive guide" while only teaching basic concepts and saying "do your own research".
Thank you for the great tutorial. I have a really stupid question though: Why is CanvasLayer offset, why is it not covering the scene behind it - and still it works and the effect is applied to the whole screen? Same for the CanvasLayer2 with Label, at 4:04 timestamp - the label is shown at origin, but when you play the scene, the label is on the top-left corner of the screen.
I couldn't get spatial effects working properly with transparent materials since they are always rendered after the quad I wonder if there are any known workarounds for this?
hey that's my crt shader.... it's just a shadertoy convert anyway. 🙃 shadertoy is a great inspiration edit: you should make the fog color an uniform 15:40.
Another excellent video @lukky. Do you think you could do a video on a good workflow for importing modular environment assets in godot? For example modular kits to build levels that all shared the same trim sheet material, where each of the meshes is exported individual as gltf of glb. I find this workflow is godot quite troublesome and there are no decent resources that directly address this. And also how best to reimport individual assets after going back to 3d software to make last minute changes. You’re probably the best godot tutorial guy so I’d be really grateful if you can cover this please 😊
I have found that getting (in my case) Blender to export separate GLTF files with A shared MTL file also saved separate to be difficult on account of having to customize the exporter. I would instead recommend making import scripts in Godot to handle placeholder textures and swap them with the right textures on import. Or if you would prefer the material be editable in your DCC as easily as the meshes then you could export the meshes as one massive GLTF file that gets split up into the parts you need them in using import scripts. What I want for my own exports, includes an intermediary tool that handles combining GLTF files from the components of others so that A set of separate GLTF files can each share references to an external MTL file much like your looking to do. Best of luck!
@@nullvoid3545 thankyou. I will reevaluate my strategy. A lot of useful info here. I am kinda struggling to see why packaging blender models as scenes is better than as meshes like .fbx to be honest. The push towards .usd and .gltf seems a bit odd to me but maybe I’ll ’get it’ eventually. Thankyou!
I just found your channel and have been trying out your tutorials and they are really good! I have a request, if it's something you think you can do. I have an inventory system where items extend a custom resource, so instead of having all weapons stored in memory and swapped to via hotkeys, I have it so you can pick up weapons into your inventory, then drag and and drop them into a slot. I have the weapon camera/anims/logic/etc., but I'm struggling to combine the two in a way that isn't coupled spaghetti code. Would you be willing to make a tutorial on integrating weapons with an inventory system?
Hey, do you happen to know a way to render transparent objects with a 3D post processing shader ? I've made a fog of war shader but unfortunately all my assets with alpha channels (transparency) in my scene are not rendered at all :(
Try setting the post processing quad to have its Z outside the camera render distance (like -4000). It seems to be something to do with render priority and you can hack the priority by setting it further away. This should be done with the quad as a child of the camera
Please make a tutorial on wallrunning in godot 4! The only one on youtube is for godot 3 and it only works with Garbaj's movement system so i really cant modify it myself to get it working on godot 4
@@77eight8 unfortunately I did not, as it us not important for now I've not looked much into it. But if like me you want to do a simple depth fog, Godot 4.3 is supposed to have one in its environment node.
hello Godot_v4.2 smoke fire tutorial I wish from you because the tutorials all do not work that there is on youtube for the version 4.2 ds everything does not work.
Using a quad for post processing is such a stupid and inefficient workaround. Why doesn't Godot just let you use a custom fullscreen triangle or better yet, a compute shader?
Theyre working on ways to add passes to the renderer currently and just recently added the first iteration of rendering effects to do just this. Bastiaan Olij currently has A livestream uploaded where he demonstrates using this feature and has some links in the description to the only existing documentation since this is new and undocumented last I checked A few weeks ago.
Thank you Lukky! You are an asset for the godot community!
you are seriously the best godot channel on youtube
This was the perfect guide. I've been learning about shaders, but no other videos actually take me by the hand to use an existing shader and write a custom shader. Instead of just showing us cool effects shaders can do, you showed us exactly where to go and what steps to take to make them ourselves. You've taught us how to fish today. Thank you.
THANK YOU! I have spent a whole day trying to make post processing work, in my already in progress video game.
Fantastic video, thank you so much! I learnt a lot.
I tried a spatial shader in Godot 4.3 beta 3 because I want to get a depth map shader to work for some post-processing. I tried your base_shader and it just didn't work.
When the QuadMesh was just used as an item in the scene, it did work with flip_faces: false, but with the POSITION code in the shader's vertex section so that it covers the entire view, it didn't.
Eventually, I figured out I had to change the POSITION line from
POSITION = vec4(VERTEX, 1.0);
to
POSITION = vec4(VERTEX.xy, 1.0, 1.0);
(Keep flip_faces: true)
I'm not 100% sure if the 1.0 z-value is ideal, but it does work now. So there must be some changes to shader code in the latest Godot version. (It did give me a warning about that line, but it took me a while to figure out that POSITION = vec4(VERTEX.xyz, 1.0) does not work.
I am truely blessed that i subscribed you because when I was loosing faith you came there to help me with exactly what i needed
Thanks again for this Tutorial. You are really becoming the Guru of Godot!
I am only getting slowly and very cautiously my hands on Materials and Shader. Only on the Beginner level and have a long way to go.
Want to go the path using decals and/or blending materials, for example to show an Android loosing it's artificial Skin and showing the Synthetic Structures beneath wherever it took a hit or clothes, armor and other equipables getting dirty/rusty/bloody or whatnot.
You are a great help and an inspiration!
We are lukky to have you in the godot community
Este es el mejor canal de Godot en todo youtube, hay otros buenos, pero este es el mas didáctico, gracias por la divulgación.
Hey, love your channel ! You got a very relaxing voice and the topics are always interesting.
Lukky you are amazing! This content is pure gold
One of the best channels for learning Godot! I think i speak for the whole community - thank you for creating these videos and putting so much time and effort into teaching us !
You have many great videos, but this outsurpasses them **all**
Thank you for such an excellent guide on a sadly obscure topic
Hey check out the new rendering effects added about 2 months ago.
They let you insert passes into the shading pipeline, although it still has some limits and requires writing your code in GLSL using an external editor instead of GSL in Godot.
Bastiaan Olij has A livestream on their channel showing this off by creating A godray shader.
For newer viewers trying out this tutorial, if the vertex code doesn't work, then enable flip_faces to true on the mesh instance, and replace the POSITION = vec4(VERTEX, 1.0) with POSITION = vec4(VERTEX, 0.0). I don't know why it works, but it does. Thank you to @AnatolBogun for the help.
seems my reshade tweaking knowledge finally somewhat shared here
This video is incredibly helpful and a fantastic intro to shaders.
But you cannot call it a "comprehensive guide" while only teaching basic concepts and saying "do your own research".
I easily added the CRT shader to my first game Pong and it works great!!
Awesome! Glad I could help :)
Actually just what I needed. Thank you
Awesome. Not many resources regarding this. Thank you!
Oh! I was looking a while ago for this video. Thanks !
Excellent video as always!
You and @DevLogLogan are going to be mostly responsible for the next indie renaissance
Great tutorials man.
Thank you for the great tutorial.
I have a really stupid question though:
Why is CanvasLayer offset, why is it not covering the scene behind it - and still it works and the effect is applied to the whole screen?
Same for the CanvasLayer2 with Label, at 4:04 timestamp - the label is shown at origin, but when you play the scene, the label is on the top-left corner of the screen.
I couldn't get spatial effects working properly with transparent materials since they are always rendered after the quad
I wonder if there are any known workarounds for this?
Can't you implement the 3D shader, as is, with a canvas layer like you did with 2D? Why is that done differently?
Great video! Thank you lukky
hey that's my crt shader....
it's just a shadertoy convert anyway. 🙃
shadertoy is a great inspiration
edit: you should make the fog color an uniform 15:40.
It should be noted that 4.3 flips the range of the depth so the depth linearization and the vertex() shader used here are broken..
Another excellent video @lukky. Do you think you could do a video on a good workflow for importing modular environment assets in godot? For example modular kits to build levels that all shared the same trim sheet material, where each of the meshes is exported individual as gltf of glb. I find this workflow is godot quite troublesome and there are no decent resources that directly address this. And also how best to reimport individual assets after going back to 3d software to make last minute changes. You’re probably the best godot tutorial guy so I’d be really grateful if you can cover this please 😊
I have found that getting (in my case) Blender to export separate GLTF files with A shared MTL file also saved separate to be difficult on account of having to customize the exporter.
I would instead recommend making import scripts in Godot to handle placeholder textures and swap them with the right textures on import.
Or if you would prefer the material be editable in your DCC as easily as the meshes then you could export the meshes as one massive GLTF file that gets split up into the parts you need them in using import scripts.
What I want for my own exports, includes an intermediary tool that handles combining GLTF files from the components of others so that A set of separate GLTF files can each share references to an external MTL file much like your looking to do.
Best of luck!
@@nullvoid3545 thankyou. I will reevaluate my strategy. A lot of useful info here. I am kinda struggling to see why packaging blender models as scenes is better than as meshes like .fbx to be honest. The push towards .usd and .gltf seems a bit odd to me but maybe I’ll ’get it’ eventually. Thankyou!
So useful !! Thank you
Thanks a lot! you explained everything so well!
2d has backbuffercopy, i think that will do the multipass work too~
I'd love to know more about what does and does not work in the next pass for 3d shaders
a year past since the video, a lot of things changed.
I just found your channel and have been trying out your tutorials and they are really good! I have a request, if it's something you think you can do. I have an inventory system where items extend a custom resource, so instead of having all weapons stored in memory and swapped to via hotkeys, I have it so you can pick up weapons into your inventory, then drag and and drop them into a slot. I have the weapon camera/anims/logic/etc., but I'm struggling to combine the two in a way that isn't coupled spaghetti code. Would you be willing to make a tutorial on integrating weapons with an inventory system?
Thanks for sharing, I'll definitely mess around with this! :^)
Hey, do you happen to know a way to render transparent objects with a 3D post processing shader ? I've made a fog of war shader but unfortunately all my assets with alpha channels (transparency) in my scene are not rendered at all :(
Try setting the post processing quad to have its Z outside the camera render distance (like -4000). It seems to be something to do with render priority and you can hack the priority by setting it further away.
This should be done with the quad as a child of the camera
Is it possible to get the equivalent of a "all nodes explained" for GDScript? Maybe important functions? Or is it just too big to cover?
Can't use your shaders, it says error: only available with Forward+ backend
10 months gone by, is there allready a way for multi pass spatial shaders? If yes, can you do a video on this maybe?
Please make a tutorial on wallrunning in godot 4! The only one on youtube is for godot 3 and it only works with Garbaj's movement system so i really cant modify it myself to get it working on godot 4
Epic style
gracias hermanito
Thank you
Nice video 👌
Nice!!😃
good job
I would like a lesson about panini or fisheye shader
I can't seem to get the Depth Texture to dsiplay. And doing the fog shader only affect the skybox. Any idea why ?
Had the exact same issue. Did you find a solution?
@@77eight8 unfortunately I did not, as it us not important for now I've not looked much into it. But if like me you want to do a simple depth fog, Godot 4.3 is supposed to have one in its environment node.
@@skave7228 Thanks! I'll take a look and see how it works!
nice... very nice.
hello Godot_v4.2 smoke fire tutorial I wish from you because the tutorials all do not work that there is on youtube for the version 4.2 ds everything does not work.
Please make a mobile version as well
Using a quad for post processing is such a stupid and inefficient workaround.
Why doesn't Godot just let you use a custom fullscreen triangle or better yet, a compute shader?
Theyre working on ways to add passes to the renderer currently and just recently added the first iteration of rendering effects to do just this.
Bastiaan Olij currently has A livestream uploaded where he demonstrates using this feature and has some links in the description to the only existing documentation since this is new and undocumented last I checked A few weeks ago.
You should implement that and make a PR
You can add a viewport to your tree and add a shader to that. You don't need a quad