DisplacedFikaDev
DisplacedFikaDev
  • Видео 4
  • Просмотров 10 343
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...
Просмотров: 8 900

Видео

How To Create a Dissolve Shader in Godot 4
Просмотров 6053 месяца назад
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
Просмотров 4793 месяца назад
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
Просмотров 3964 месяца назад
Learn how we can use an objects world position to create color variations within Godot 4.2 shaders. #Godot #Godot4 #GameDevelopment #Shaders #GodotTutorial #tutorial

Комментарии

  • @yapp2yapp2
    @yapp2yapp2 5 дней назад

    amazing tutorial, i learned so much. thank you. hope for more videos in the future. lovr you!

  • @Scotched-nh7sc
    @Scotched-nh7sc Месяц назад

    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 :)

  • @a_shmiggy
    @a_shmiggy 2 месяца назад

    I'm so happy to see this kind of high quality content for Godot recent versions. Respect, keep it up.

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      Thank you very much for your kind words! It means a lot :)

  • @a_shmiggy
    @a_shmiggy 2 месяца назад

    Very nice, high quality tutorial! looking forward to your next videos.

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      Thank you, I'm glad you enjoyed it! I'm working on a few more videos and hope to finish them soon :)

    • @a_shmiggy
      @a_shmiggy 2 месяца назад

      Awesome! Can't wait 😁

  • @waterfill7925
    @waterfill7925 2 месяца назад

    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?

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      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! :)

    • @waterfill7925
      @waterfill7925 2 месяца назад

      @@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

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      @@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 :)

    • @waterfill7925
      @waterfill7925 2 месяца назад

      @@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

  • @dbatdev
    @dbatdev 2 месяца назад

    Excellent!

  • @sliceofanime8614
    @sliceofanime8614 2 месяца назад

    Oh, it's Gaddo tutorial.

  • @bixbite2
    @bixbite2 2 месяца назад

    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?

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      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.

    • @bixbite2
      @bixbite2 2 месяца назад

      @@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?

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      @@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.

  • @njdarda
    @njdarda 2 месяца назад

    fantastic tutorial. looks great and way more performant than for example softbody.

  • @NewSchattenRayquaza
    @NewSchattenRayquaza 2 месяца назад

    Thank you so much for sharing this!

  • @beanieteamie7435
    @beanieteamie7435 2 месяца назад

    Thanks a lot for the great tutorial! Your voice is very cute btw :D

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      Haha, thanks! I'm happy you enjoyed the tutorial :)

  • @lorenzvo5284
    @lorenzvo5284 2 месяца назад

    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

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      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 :)

  • @so_easy23
    @so_easy23 2 месяца назад

    this is great...now to sync it with the foliage wind and rope wind

  • @saintadel8902
    @saintadel8902 2 месяца назад

    Great tutorial my man! You have earned yourself a subscriber

  • @timmygilbert4102
    @timmygilbert4102 2 месяца назад

    Add micro UV displacement on too

  • @portalpony477
    @portalpony477 2 месяца назад

    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

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      Thank you! I've added the link to the code in the video description :)

  • @theman7050
    @theman7050 2 месяца назад

    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.😊

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      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 :)

    • @theman7050
      @theman7050 2 месяца назад

      @@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

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      @@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! :)

    • @theman7050
      @theman7050 2 месяца назад

      ​@@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!!

  • @akirastudios1406
    @akirastudios1406 2 месяца назад

    Thanks for sharing! ^^

  • @MadManTnT
    @MadManTnT 2 месяца назад

    great video.

  • @nue_hazel
    @nue_hazel 2 месяца назад

    Thanks !

  • @ItzVic
    @ItzVic 2 месяца назад

    truly a high quality video, subscribed

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      I'm glad you liked it, and thanks for subscribing :)

  • @warunanirmal9537
    @warunanirmal9537 2 месяца назад

    Great ! 😮

  • @BKD639
    @BKD639 3 месяца назад

    Amazing

  • @yvanvan3729
    @yvanvan3729 3 месяца назад

    Great tutorial. Awesome work. Thanks you for sharing your knowledge with the Godot Community. Have a wonderful day.

    • @DisplacedFikaDev
      @DisplacedFikaDev 2 месяца назад

      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!

  • @americoperez810
    @americoperez810 3 месяца назад

    Subscribed. Looking forward to seeing more of your cool content on shaders

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      Thanks for subscribing! More shader content is definitely coming :)

  • @diogosoares6092
    @diogosoares6092 3 месяца назад

    Awesome video! Thanks for the content!

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      Thanks for the kind words! I'm glad you found it useful! :)

  • @nyitdom
    @nyitdom 3 месяца назад

    Here before this gets viral. Gotta save this video for later.

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      Thank you! I hope you find the video helpful when you come back to it :)

  • @snatts
    @snatts 3 месяца назад

    good quality godot video and no comment? nah, I'll fix it

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      Thank you for the support! I'm glad you like the video :)

  • @khlad.t8028
    @khlad.t8028 3 месяца назад

    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?

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      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 🙂

  • @chegusta
    @chegusta 3 месяца назад

    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!

    • @DisplacedFikaDev
      @DisplacedFikaDev 3 месяца назад

      Thank you so much! I'm really glad you enjoyed the video 🙂

  • @rodmileski
    @rodmileski 4 месяца назад

    good