- 4
- 14 002
DisplacedFikaDev
Sweden
Приєднався 23 кві 2023
🎮 Welcome to DisplacedFikaDev! Here, our game development adventures are fueled by coffee and creativity. Grab your beverage of choice and join me on this journey through game development and shaders in Godot.
☕️ Fika - The art of taking a break, sipping coffee, and finding joy in the moment.
☕️ Fika - The art of taking a break, sipping coffee, and finding joy in the moment.
How To Create a Wind-Driven Shader Animation in Godot 4
Welcome to my Godot 4 tutorial! In this video, I'll guide you through the process of creating a wind-driven tarp shader using shaders in the Godot Game Engine.
Discover how to bring life to your game environment with realistic wind effects that animate a tarp, perfect for adding dynamic elements to your scenes.
🔧 Tools and Resources:
Project files - github.com/DevFika/Wind-Driven-Tarp-Shader
Godot Engine 4 - godotengine.org/
Blender - www.blender.org/
⏱ Timestamps:
00:00 Introduction
00:16 Scene setup
01:52 Add shader globals
03:27 World space wind direction to local space
05:45 Creating a wind controller
12:50 Vertex color mask
14:52 Dot product
16:30 Add dot product to code
19:01 Add moving wind noise
25:03 Set scrolling wind direction
27:12 Add offset to animation
By the end of this tutorial, you'll know how to create a wind-driven tarp shader in Godot 4, enhancing your game's realism with dynamic wind animations. This video is ideal for game developers, shader enthusiasts, and anyone looking to improve their skills in Godot 4.
Let me know in the comments if you have any questions or suggestions for future tutorials!
#Godot #Godot4 #GameDevelopment #Shaders #GodotTutorial #Tutorial #GameDev #GodotEngine
Discover how to bring life to your game environment with realistic wind effects that animate a tarp, perfect for adding dynamic elements to your scenes.
🔧 Tools and Resources:
Project files - github.com/DevFika/Wind-Driven-Tarp-Shader
Godot Engine 4 - godotengine.org/
Blender - www.blender.org/
⏱ Timestamps:
00:00 Introduction
00:16 Scene setup
01:52 Add shader globals
03:27 World space wind direction to local space
05:45 Creating a wind controller
12:50 Vertex color mask
14:52 Dot product
16:30 Add dot product to code
19:01 Add moving wind noise
25:03 Set scrolling wind direction
27:12 Add offset to animation
By the end of this tutorial, you'll know how to create a wind-driven tarp shader in Godot 4, enhancing your game's realism with dynamic wind animations. This video is ideal for game developers, shader enthusiasts, and anyone looking to improve their skills in Godot 4.
Let me know in the comments if you have any questions or suggestions for future tutorials!
#Godot #Godot4 #GameDevelopment #Shaders #GodotTutorial #Tutorial #GameDev #GodotEngine
Переглядів: 11 300
Відео
How To Create a Dissolve Shader in Godot 4
Переглядів 1,1 тис.8 місяців тому
Welcome to my Godot 4 tutorial! In this video, I'll guide you through the process of creating a cool dissolve effect using shaders in Godot Game Engine. 🔧 Tools and Resources: Project files - github.com/DevFika/DissolveShader Godot Engine 4 ⏱ Timestamps: 00:00 - Introduction 01:16 - Setup uniforms 03:40 - Start working in the fragment shader 07:34 - Adding emission 15:17 - Setup script #Godot #...
How To Create Swaying Cables: Godot Shader Tutorial
Переглядів 7318 місяців тому
Welcome to my Godot 4 tutorial! In this video, I'll show you how to create swaying cables using shaders. This method employs simple vertex animation to introduce subtle movement, enhancing the visual appeal of your game environments. 🔧 Tools and Resources: Godot Engine 4 Shader code: github.com/DevFika/Swaying-Cables-Shader-Godot-4 ⏱ Timestamps: 0:00 - Introduction 0:16 - Scene 0:36 - Shader Co...
How To Use Object World Position in Godot Shaders: Creating Color Variations
Переглядів 8348 місяців тому
Learn how we can use an objects world position to create color variations within Godot 4.2 shaders. #Godot #Godot4 #GameDevelopment #Shaders #GodotTutorial #tutorial
Thats exaclty what i need for my books too thx a lot 🎉
I used Godot in 2018... What's now possible was unthinkable back then...😊
Will this also work on a Sprite2D?
What's your export workflow for this? When I have a material on my mesh in Blender and export, Godot doesn't detect the vertex colours. When I remove all materials from my mesh and export from Blender, Godot picks up the colours fine, but I then have no material and need to manually add one on the Godot-side (also Blender side now has no material which makes working on my mesh harder)!
Hello there! What works for me when exporting from Blender 4.2, in GLB/GLTF export settings, under Data > Mesh > Vertex Color, set "Use Vertex Color" to Active. The default is usually set to Material, which, as I understand it, only exports the vertex color if it's actively used in the material. So setting it to Active will ensure both color and materials are exported. Hope this helps! :)
@DisplacedFikaDev Worked like a charm. Thanks!
THANK YOU!
amazing tutorial, i learned so much. thank you. hope for more videos in the future. lovr you!
Thank you so much! I'm really glad you found it helpful :) I’m working on a new shader video and hope to finish it up soon. I really appreciate the love and support!
Thanks a lot for the tutorial! Just a small thing in case someone else bumps into it: I couldn't get your implementation to work and couldn't see why, but apparently the renderer was at fault. I was using "Compatibility" (didn't work) while you are using Forward+ (works fine). Anyways great video :)
I'm so happy to see this kind of high quality content for Godot recent versions. Respect, keep it up.
Thank you very much for your kind words! It means a lot :)
Very nice, high quality tutorial! looking forward to your next videos.
Thank you, I'm glad you enjoyed it! I'm working on a few more videos and hope to finish them soon :)
Awesome! Can't wait 😁
hello! This shader is very good! Thanks so much!! However, I have a problem and I spent all day trying to fix it, I'm not very experienced in programming, but I wanted to add a leaf texture that used alpha to disappear the edges and only the leaf appears and not the entire mesh! I tried everything but I couldn't, do you know how I could change this code to work?
Hello there! Yes, we can definitely enable transparency. For this example I will assume you have your alpha in the albedo texture. We only need to make some minor changes in the fragment shader. First, we change the albedo sampling to a vec4 to include the alpha channel "vec4 albedo = texture(albedo_texture, texture_uv);" Then we change "ALBEDO = albedo.rgb;" and add "ALPHA = albedo.a;" This way, we sample the albedo from the RGB channels and use the alpha channel for transparency. Also, I recommend looking up the "alpha scissor mode" as it can help with performance and sorting issues, especially when working with a lot of foliage. I hope this helps! :)
@@DisplacedFikaDev Hi, thanks for the reply! I had done this before! But it's showing the same problem, the leaves look the way I want, but they lose their shade and the trunk also loses its shade and I can see inside it, what is causing this problem? Without using the shader, the shadows work normally. When delet ALPHA= albedo.a; back to normal but without alpha for leaves
@@waterfill7925 Hey! It sounds like there are some depth sorting issues. You could try adding depth_prepass_alpha to your render mode: "render_mode depth_prepass_alpha;" That should fix the shadows and depth sorting issues. Alternatively, alpha_scissor should also be able to handle shadows and sorting :)
@@DisplacedFikaDev hey thanks so much! I fixed with others renders mode!! I need now ajust the leaves xD they are coming out of the trunk
Excellent!
Oh, it's Gaddo tutorial.
do you think this shader could work well on a tree? or do you suggest a different way of making a tree waver a little on the wind?
It depends on what you're aiming to achieve. If you're looking for a subtle amount of sway or a more stylized look, adapting techniques similar to this shader could work well for a tree. Though, if you want more realistic movement, then you'd probably need to build a more complex shader.
@@DisplacedFikaDev thanks, i made some progress in my project using your tips, i just didnt really understand the part where u made it so that the rope didnt move, did you use the shadow mesh?
@@bixbite2 I used vertex color, which I painted in Blender, to drive the effect. Anything that has the value 0.0 (black) is not affected by the shader, while anything that has the value 1.0 (white) is fully affected. This allows me to control how much each part of the object should move. For the rope, I painted some parts black so they remain stationary.
fantastic tutorial. looks great and way more performant than for example softbody.
Awesome! Glad you found it useful :)
Thank you so much for sharing this!
Glad you found it useful :)
Thanks a lot for the great tutorial! Your voice is very cute btw :D
Haha, thanks! I'm happy you enjoyed the tutorial :)
I think It would be cool to add a globally positioned scrolling noise texture so it looks as if the wind is moving through the scenes in gusts
Great suggestion! A globally positioned scrolling noise texture to simulate wind gusts would definitely be a great addition. Hopefully, I can incorporate more of those ideas in the future :)
this is great...now to sync it with the foliage wind and rope wind
Great tutorial my man! You have earned yourself a subscriber
Thank you, I appreciate the support! :)
Add micro UV displacement on too
this is amazing but can you link the code like you did for your wind demo. lets be honest going to need to rewrite it to get it to work how i want just saves me time knowing it does work 1st
Thank you! I've added the link to the code in the video description :)
When you do a world to local on wind direction, so it gets local relative to what point? Why cant it stay in world space like light direction? Thanks. Maybe make a little video about spaces? I find them very confusing.😊
I agree, different spaces can be very confusing! And I could definitely have spent some more time explaining it better. The vertex shader works in the object's local space. If we applied our wind direction directly, it would rotate as the object rotates in the world. My reasoning was that I wanted to apply the effect in the local space, so I transformed the direction using the inverse model matrix. This way, the wind direction stays consistent in the world regardless of the object's orientation. Great idea on making a video on different spaces! I will add it to my list of to-do videos. Hopefully, I can do that one in the future :)
@@DisplacedFikaDev Thank you so much for taking out the time to explain. I get part of it now. Got to dig in and experiment further. :D
@@theman7050 Awesome, I'm glad I could help a bit! For sure, shaders is all about experimenting and discovering new things. Feel free to share if you create something cool with shaders. I'm always interested in seeing what others come up with! :)
@@DisplacedFikaDevyou know I kind of figured it out! I work with glsl and exprimented on 2 planes, one being rotated via JS before sending over pos to shader. So it was easier to go world to local by just: (vec4(uWindDir, 1.0) * modelMatrix).xyz; Because my webgl libraries supply just the model, view and projection matrices and not their inverses. Infact, it's not even needed in glsl shader code, so instead of: modelMatrix * pos (local to world) You invert the multiplication as: pos * modelMatrix 😅 Thanks a lot man!!
Thanks for sharing! ^^
Thanks for watching :)
great video.
Thank you, I'm glad you liked it :)
Thanks !
Thanks for watching :)
truly a high quality video, subscribed
I'm glad you liked it, and thanks for subscribing :)
Great ! 😮
Thank you!
Amazing
Thanks! Glad you liked it!
Great tutorial. Awesome work. Thanks you for sharing your knowledge with the Godot Community. Have a wonderful day.
Thank you! I'm glad you enjoyed it. The Godot community is fantastic, and I'm grateful to be part of such a supportive community. Have a great day!
Subscribed. Looking forward to seeing more of your cool content on shaders
Thanks for subscribing! More shader content is definitely coming :)
Awesome video! Thanks for the content!
Thanks for the kind words! I'm glad you found it useful! :)
Here before this gets viral. Gotta save this video for later.
Thank you! I hope you find the video helpful when you come back to it :)
good quality godot video and no comment? nah, I'll fix it
Thank you for the support! I'm glad you like the video :)
do you know how can I make this work with other shader pass? like outline and cel shade, or do I need to merge them somehow?
I'm not entirely sure how to do that in Godot, I usually have such effect directly in the main shader. I would need to look into that, but hopefully someone else can help you find a solution 🙂
randomly encountered this video and I really have to say that you did an amazing job. I've had a look at shaders for a while and encountered a lot of these concepts that come beautifully together in your video. great job!
Thank you so much! I'm really glad you enjoyed the video 🙂
good