2D Vegetation Wind Movement Shader Graph - Easy Unity Tutorial

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 107

  • @PhilipWalker
    @PhilipWalker 3 роки тому +4

    Excellent tutorial. Well-explained and the effect is perfect. Also love how customizable you made this shader, many other tutorials end up with a similar looking effect, but with no customization in the shader or script. Thank you for sharing and teaching us!

  • @kyudogame3749
    @kyudogame3749 2 роки тому +2

    Very helpful guys! With people like you the world is a bit better

  • @nephilmis
    @nephilmis 3 роки тому +1

    It is surprising to see there are only 18k people who have watched this impeccable tutorial.. Great work! Love your tutorials. Subscribed now

    • @BinaryLunar
      @BinaryLunar  3 роки тому

      Kind of you, thanks!

    • @II-wu3wz
      @II-wu3wz 3 роки тому

      @@BinaryLunar Would you like to take a look at my question? Is this shader even usable for my case (2d top down game) ?

  • @sagrgywejhxcvx
    @sagrgywejhxcvx Рік тому +1

    thanks for using a sprite whose borders are close to the object, it helped me a lot

  • @ZeldaLore
    @ZeldaLore 4 роки тому +27

    Could you do a shader video where you make the leafs move in the direction that the player does when he moves past them? A great example for what I mean is Ori (I've seen other games do this too).
    Great video btw. I had been looking for something like this for a while!

  • @szappy
    @szappy 3 роки тому +1

    Really good tutorial, at first I thought it didn't work, but i adjusted some values and now it looks really cool! Well done!

  • @JFCAMPOS83
    @JFCAMPOS83 4 роки тому

    First time I stopped a video so much to be able to follow it. Was my first time modifying shaders. It worked great. Thanks!!

  • @xingorro8605
    @xingorro8605 3 роки тому +1

    You are ameazing. When i start searchig for something "How make ...... in Unity" - You already uploaded tutorial about that.

  • @b1ockhead
    @b1ockhead 4 роки тому +2

    Wowee, this is exactly what I was looking for, thank you so much for making this!

  • @blueforest8066
    @blueforest8066 4 роки тому +3

    This was a really good tutorial. Thanks!

  • @ballaman200
    @ballaman200 16 днів тому

    As there is no Vector1 anymore i had to use Vector2 in many situations. The main difference is that you have to use another Split after using Power. But you have to do it to make it work.

  • @laniakeadev.2271
    @laniakeadev.2271 4 роки тому

    Thanks a lot! I tried to find this shader for a long time, and you helped me to create it

  • @sazankarpovich2506
    @sazankarpovich2506 4 роки тому +1

    Awesome tutorial! Thanks, man!

  • @dermotbyrnemusic
    @dermotbyrnemusic 3 роки тому +1

    Thanks for this - really good!

  • @renemachadojunior5772
    @renemachadojunior5772 4 роки тому +1

    Amazing! Well done

  • @ivohury3481
    @ivohury3481 Місяць тому +1

    There is absolutely nothing to see in the tutorial. Please make it even smaller. Great job!

  • @ZeldaLore
    @ZeldaLore 4 роки тому +11

    I've encountered a problem with this shader. You can´t move the sprites on the Z axis at all, and I want to be able to do so as I have camera in perspective and not in ortographic. I tried removing the position, split and vector 2 nodes connecting to the tiling and offset, removing the transform, and changing the position from absolute world to object. that worked for a single object, but when you add two with the same material and shader they snap back to 0 on the z axis for some reason. any idea on how to fix this?

    • @jorgeponce5147
      @jorgeponce5147 Рік тому

      I have exactly the same problem. Could you solve it?

    • @ZeldaLore
      @ZeldaLore Рік тому

      @@jorgeponce5147 this shader was based off the vertex displacement shader from Unity's Lost Crypt project. I realized this channel gets a lot of things from other people. The shader Unity created worked fine for me.

  • @condensedmatter118
    @condensedmatter118 3 роки тому

    Learning a lot from your videos. Thanks so much!

  • @shayantl4558
    @shayantl4558 2 роки тому +1

    thank you so much :)

  • @wunexxx
    @wunexxx 11 місяців тому +1

    Good tutorial, but i experienced a problem with which my sprite with this shader is far away from its pivot, in top right corner, also sprite disappears at all when my camera does not see the pivot of the object with shader, someone knows how to fix this? P.S. all the values are like in the end of the video

  • @MesaTheAalfa
    @MesaTheAalfa 4 роки тому +1

    Helpful , much appreciated :D

  • @voidling2632
    @voidling2632 4 роки тому +2

    does not work. Even with split, the z value still change and the sprite disappears from time to time...

  • @SkaOArts
    @SkaOArts 2 роки тому

    It does function. But you have a big limit that I encounter. The Shader will only transform the four vertex on an sprite. One vertex four each corner. So it can look wierd or "low-poly", cause there are no more vertex to smooth the motion out.

  • @ZeldaLore
    @ZeldaLore 4 роки тому +5

    I fixed the problem with the shader where it wouldn't allow you to move the objects on the Z axis.
    To fix it, first, I connected the position node (setting it to object) directly to the tiling and offset node, without spliting it. Then, I connected the multiply node directly to the add node near the master, and connected the add node directly to the vertex position, removing the transfom node.
    Finally, I set the position node connected to the add node to object.
    Now, you can have sprites on a 3D environment and have parallax. Hope this helps someone out :)
    Edit: there are still issues with it. Although sprites can me moved on the z axis, some snap the 0 coordinate for some reason. Hmmm

    • @BinaryLunar
      @BinaryLunar  4 роки тому

      Thanks for sharing this solution.

    • @ZeldaLore
      @ZeldaLore 4 роки тому +1

      @@BinaryLunar the solution is not perfect, there are still issues with it. I also noticed that you tried to simply the shader from the Lost Crypt example unity proyect, I was also looking at it to see if how they did it, but surprisingly they have the positions set to absolute world too, so I don't really know what the problem is exactly.

  • @wistyroamlands7495
    @wistyroamlands7495 Рік тому

    Thank you very very very much.

  • @virtualhavenstudios
    @virtualhavenstudios 2 роки тому

    Thanks ! Great video

  • @Midge256
    @Midge256 4 роки тому

    Fantastic!! i love your videos

  • @isitsou
    @isitsou 4 роки тому +1

    nice vid! thanks for the good explanations... (complexity level 2000)

  • @II-wu3wz
    @II-wu3wz 3 роки тому +1

    I'm late to the party, I hope I get an answer:
    I used this in a 2d top down game, some grasses disappear permanently or disappears when my character is moving around, any idea why?
    Update and new problem:
    Grass disappearing solved: Changed giving output from Add to Sprite Unlit Master Node and remove the Transform Node between it.
    New Problem:
    Some grasses flicker on x-axis when character moves up and down

    • @trahsh_1005
      @trahsh_1005 3 роки тому

      It happened to me too, my only way to fix it was just deleting the shader from my objects, but i makes me angry cause my game is more beauty with the wind effect :(

  • @westonhall9605
    @westonhall9605 4 роки тому +3

    I keep getting "Material does not have a _MainTex texture property. It is required for SpriteRenderer." I have followed everything exactly.

    • @TheCyrus1988
      @TheCyrus1988 4 роки тому

      Same problem here. Did you happon to figure out the issue maybe?

    • @westonhall9605
      @westonhall9605 4 роки тому +1

      @@TheCyrus1988 Yeah. You just need to hit save changes, or 'apply changes', something like that, for the shader you are working on.

    • @TheCyrus1988
      @TheCyrus1988 4 роки тому

      @@westonhall9605 Tnx. I figured out at some point also, after xx time. :D
      Anyways thank you for getting back at me. (y)

  • @hardworkerstudio
    @hardworkerstudio Рік тому +1

    Thanks!!!

  • @freedady2864
    @freedady2864 4 роки тому +1

    Thank you a million. !!!!!!!!!!!!!!!!!!!!!!

  • @zerosargon977
    @zerosargon977 4 роки тому +1

    it was very helpful thanks a lot : )
    can you pleeeeaseee make a video about grass move when the player steps on it?

  • @gaidzin2
    @gaidzin2 11 місяців тому +2

    How to make such a visual wind effect?

    • @BinaryLunar
      @BinaryLunar  11 місяців тому +1

      It is particle effect , you can download the project files and use that too

  • @LuanaSantos-rl4sb
    @LuanaSantos-rl4sb 2 роки тому

    what a angel, tk u

  • @ValeGoG
    @ValeGoG Рік тому +1

    10/10

  • @CaioMGA
    @CaioMGA 3 роки тому

    Very nice

  • @BlueGooGames
    @BlueGooGames 4 роки тому +1

    Totally perfect tutorial, thanks a lot! Will use this a lot for all planets that have organic plants and things in Space Chef. I’m thinking if there is a way to get a random pixel of the sprite or something to set the amount, so two sprites with the same material still look different. And how does this work with gpu instancing? Is it one draw call for all with the same material?

    • @BinaryLunar
      @BinaryLunar  4 роки тому

      You welcome, we found solution here:
      ua-cam.com/video/AbHTpZmaVpk/v-deo.html

  • @Koooles
    @Koooles 3 місяці тому

    I never used shaders before and this looks really cool. I followed everything along and double checked, however, it doesn't seem to work properly. It sways how it should, but:
    1) on my sprites that have transparent background, suddenly it gets autofilled with some stretched pixel.
    1) some objects just fly to the side somewhere, as in their position becomes extremely disordered.
    Anyone knows how to help?
    Edit: I figured one part out, I didnt' connect the alpha correctly. However, still having the issue where objects appear in weird places.

  • @rohanpatel2608
    @rohanpatel2608 4 роки тому +1

    Amazing Thank You for making this video!!
    One Question tho is there any way to make them bend if the player collides them?

    • @BinaryLunar
      @BinaryLunar  4 роки тому +1

      Maybe try to create a code that set the wind parameters OnTiggerEnter2D then set them to 0 OnTriggerExit2D.

  • @lashaghotvadze5966
    @lashaghotvadze5966 Рік тому +1

    hello, can you help me inverse the influence mask so that the sprite stops moving at top and starts at bottom?

    • @BinaryLunar
      @BinaryLunar  Рік тому +1

      just use "One Minus" node to flip the mask

    • @lashaghotvadze5966
      @lashaghotvadze5966 Рік тому +1

      @@BinaryLunar Thank you very much, I'm trying to create interactable plants in 2d game and it was really helpful as first step.

    • @BinaryLunar
      @BinaryLunar  Рік тому +1

      @@lashaghotvadze5966 aweome, looking forward to see your 2D game

  • @beri4138
    @beri4138 4 роки тому +2

    I have a question. Why unlit shader graph and not lit?

    • @BinaryLunar
      @BinaryLunar  4 роки тому

      You can use lit of course, but then you need to use 2D lights to light the scene.

    • @beri4138
      @beri4138 4 роки тому +1

      @@BinaryLunar Is there an easy way to toggle between lit/unlit after you've created the shader?

    • @BinaryLunar
      @BinaryLunar  4 роки тому +1

      @@beri4138 yes just change the master node( for example if you on unlit, create master lit node, then set it as active then remove the unlit one)

    • @beri4138
      @beri4138 4 роки тому

      @@BinaryLunar Thanks a lot! I had no idea about that.

    • @Wilhelm_LAS
      @Wilhelm_LAS 3 роки тому

      @@BinaryLunar Thanks dude! i did it with your tutorial! Now im trying to do When player hit grass, then this happens and ends... Can you do a tutorial for it if your free tho

  • @anders940
    @anders940 3 роки тому

    Amazing video! :D Could you have made an emission map for a specific leaf/object instead of using a gradient for the wind influence?

  • @martinschifer3603
    @martinschifer3603 4 роки тому +2

    Is all of this made in a 2D project or 3D?

  • @tinyduccgames7667
    @tinyduccgames7667 Рік тому

    is there a way to apply this to a tilemap? Im trying to use the shader for a tilemap (my tile texture is pitch black), and all im seeing is black squares waving, as my initial texture tiles had been either replaced with squares or distorted/stretched out to just be squares.

  • @haule5844
    @haule5844 4 роки тому

    thank you so much

  • @anilmadak
    @anilmadak 2 роки тому +1

    Bro, how can I make white lines wind effect left from right as your video?

    • @BinaryLunar
      @BinaryLunar  2 роки тому

      That is particle system.

    • @anilmadak
      @anilmadak 2 роки тому

      ​@@BinaryLunar I tried but I couldn't do as left from right. Also, Did you use too many sprites or just have one?

  • @giridharsharma9868
    @giridharsharma9868 4 роки тому

    Thank you :)
    but can we make random seed node in shader graph such as not to create Wind1,2,3.... and do random seed in the global/exposed property?

  • @ronnyrr9010
    @ronnyrr9010 2 роки тому

    Someone help pls, when i apply the final material to other objects , it takes the same image in all the objets applied, where am i doing wrong?T_T

  • @botansahin
    @botansahin 3 роки тому

    I dont know why but my wind mask does no effect. I am sure it is connected it makes difference in the shader but not in sprite

  • @maythesciencebewithyou
    @maythesciencebewithyou 3 роки тому

    Do you also have a video on how you made those air streams?

  • @seanphillipsmusic
    @seanphillipsmusic 2 роки тому

    I copied everything from your video but when I apply the material to the relevant sprite it doesn't make my leaf move it just makes it grey.

    • @seanphillipsmusic
      @seanphillipsmusic 2 роки тому

      it is working as i can see it in the preview section where you attach all the nodes and i can see it moving in the preview area but as soon as I create the material apply the shader then apply the material to the sprite it turns grey. Any Ideas to fix this ?

    • @gxguy2906
      @gxguy2906 Рік тому

      Hi, in the shader graph window, you have to press save asset on the top left. Hope it helps or maybe you found the solution already.

  • @SMT-ks8yp
    @SMT-ks8yp 2 роки тому

    Does not work. My sprite just turns invisible, while preview looks fine.

    • @Chief-wx1fj
      @Chief-wx1fj 2 роки тому +2

      Solved: For anyone in the future, my issue was the last node (Transform) going into the Vertex Position Master was set to "Object -> Object", when it should be "World -> Object"

  • @sandrawrsuki
    @sandrawrsuki 4 роки тому +1

    How do you do the wind effect?

  • @joaocarlosp.p.6550
    @joaocarlosp.p.6550 Рік тому

    But z-pos, does't work.

  • @McKruemelkatze
    @McKruemelkatze 4 роки тому

    Thanks for this tutorial! However, when I apply this to my grass sprite that has transparency, I get some hard edges in the distortion:
    imgur.com/a/RarewWB
    If I apply the shader to a fully opaque gradient sprite, these hard edges do not occur. Seems to have something to do with the vertices when rendering the sprite. Does anyone have any ideas on that?

    • @Wolf-dz4fn
      @Wolf-dz4fn 3 роки тому

      Hi, did you find a fix for it? happens to me when i apply this to the leaves on my tree, it just blends them together

    • @McKruemelkatze
      @McKruemelkatze 3 роки тому

      @@Wolf-dz4fn Hey! Yes, you simply need to set the sprite's Mesh Type to Full Rect. I wrote an interactive version of this shader , where I also describe this: github.com/Dirty-Paws-Studio/Unity-Snippets/tree/master/2D/Dynamic%20Foliage

    • @Wolf-dz4fn
      @Wolf-dz4fn 3 роки тому

      @@McKruemelkatze hm that didnt work sadly, imgur.com/a/XXcDDzJ the first picture is one of the leaf layers without the shader. second one is with the shader and the third is when i change the mesh type to full rect

    • @McKruemelkatze
      @McKruemelkatze 3 роки тому

      ​@@Wolf-dz4fn Hmm, that looks like the UVs are messed up somehow. If you want, you can DM me on Discord: Kruemelkatze
      #2952.
      I'll gladly help you if I can and it's easier to solve it that way. :)

    • @Wolf-dz4fn
      @Wolf-dz4fn 3 роки тому +3

      Thanks to Fabian for figuring out the problem. For people that encounter the same problem as me, you have to connect the A(1) dot from Sample Texture 2D (2:18 in video) to Fragment Alpha( 1) in the sprite unit master. In the video they used an older unity version so it didnt have that

  • @bengad1606
    @bengad1606 4 роки тому

    how do I make the top of the leaf steady?

    • @BinaryLunar
      @BinaryLunar  4 роки тому +1

      You can use "One Minus" node to flip the mask that will make top steady and bottom move.

    • @bengad1606
      @bengad1606 4 роки тому

      @@BinaryLunar thanks 😀

    • @Badyliani
      @Badyliani 4 роки тому

      @@BinaryLunar Would Invert Colors work the same way?

    • @ZeldaLore
      @ZeldaLore 4 роки тому

      @@BinaryLunar ​ And if you want to be able to change from negative to positive in the inspector? how would you do it? Adding "One Minus" to this merely flips it, and I don´t want to create a completely separate shader with that minor change.
      I mean, you could always make the sprites/textures with the "Rigid" part on the bottom and then rotate it in the scene, but having a way to change the mask area would be better, possibly in all 360 directions.
      how would that be done?

    • @seancutt793
      @seancutt793 Рік тому

      @@BinaryLunar Where exactly should the "One Minus" node go? I've tried a few different places and keep breaking it lol

  • @MegaMasterX
    @MegaMasterX 3 роки тому +3

    This one's hard to follow, you went way too fast on this tutorial unfortunately.

  • @Yezus
    @Yezus 4 роки тому

    way to fast.

  • @BinaryLunar
    @BinaryLunar  4 роки тому

    📝 The Ultimate 2D & 3D Shader Graph VFX Unity Course on Udemy: www.udemy.com/course/the-ultimate-2d-3d-shader-graph-vfx-unity-course/
    🌎 Let us know what you think about this video, also feel free to chat with us on our Discord server :discord.com/invite/b6bXKSV
    ❤ Support us on Patreon www.patreon.com/BinaryLunar and gain access to all our tutorials projects.
    📦 Check our Assets on Unity Assets Store: assetstore.unity.com/publishers/47136

    • @ninjawild
      @ninjawild 2 роки тому

      Do you know if this shader would work with the Universal Rendering Pipeline lighting? I'm using 2D lighting in my game which requires a certain material, so I have to choose either Wind or Sprite-Lit-Default. I've tried applying multiple materials to the SpriteRenderer, but Unity won't allow it. I've looked everywhere to see if I could either combine materials or shaders to no avail. I know I could potentially combine two shaders to get the desired effect but I know nothing about them. Any help would be appreciated!
      Edit: Got it working! I changed the Material in the Graph Inspector to Sprite Lit! Thanks for the video!

  • @padrinoDK
    @padrinoDK 4 роки тому

    Thanks!