Animated Flag - Advanced Materials - Episode 26

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 54

  • @tunerhun
    @tunerhun ปีที่แล้ว +8

    Thank you

    • @BenCloward
      @BenCloward  ปีที่แล้ว +5

      I really appreciate your support for the channel. This will go directly to helping me pay for the software and hardware I use to make the videos.

    • @tunerhun
      @tunerhun ปีที่แล้ว +3

      Thank you for the reply, Ben. I'm happy to help support this amazing channel. You're a real pro at this, man. Your videos help me a lot to get a better understanding of the whole rendering process. Thanks for that.

  • @adnanebadi3798
    @adnanebadi3798 ปีที่แล้ว +2

    Thanks for these videos. They helped me understand shaders so much better than any documentation.

  • @Chris-jo1zr
    @Chris-jo1zr ปีที่แล้ว +3

    I've been using shaders in Unity for over a year now having come from Unreal, I'm no master at shaders but I've found Unity to be very good for vertex animations and shaders in general, having custom block nodes in the vertex shader is really powerful!

  • @Gorongirl
    @Gorongirl ปีที่แล้ว +1

    First few minutes of the video make me excited to check out the last video! :D

  • @needlessToo
    @needlessToo ปีที่แล้ว +1

    Thank you very much. This should help a lot of people!

  • @jussirautiainen3784
    @jussirautiainen3784 7 วันที่ผ่านมา +1

    Simple and effective ... thanks ...

  • @taguetrash
    @taguetrash ปีที่แล้ว +2

    I’m curious, do Unity and unreal automatically recalculate normals when you offset vertices? I was kinda expecting this to get into adjusting the normals along the wave

    • @IPpainting
      @IPpainting ปีที่แล้ว +1

      Unreal definitely doesnt do that

    • @BenCloward
      @BenCloward  ปีที่แล้ว +4

      Neither engine recalculates the normals. I didn't go over it to keep the video short - and in the places where I've used this shader it wasn't really needed so I left it out to keep the shader cheaper. But it is possible to do. Maybe I'll cover that in my next video.

    • @fleity
      @fleity ปีที่แล้ว +1

      @@BenClowardYes! Recalculating normals sounds like a very good topic, great idea. That is a reoccuring problem in vertex shaders which is unfortunately often ignored. And you need it in so many cases, flags, waves, any time you don't offset in the normal direction.

    • @selimgonen
      @selimgonen ปีที่แล้ว +1

      @@BenClowardplease!

  • @ДмитрийЛещев-ы7н
    @ДмитрийЛещев-ы7н ปีที่แล้ว +2

    instead of setting motion to zero, the second mult with mask broke flag.
    What could be the reason?
    I use UE5.2

    • @BenCloward
      @BenCloward  ปีที่แล้ว +2

      I forgot to mention in the video that in order for this to work, the pivot point of your flag mesh needs to be on the side of the mesh where the flag pole will be. So that could be the problem you're having?

    • @ДмитрийЛещев-ы7н
      @ДмитрийЛещев-ы7н ปีที่แล้ว +1

      Yes. Problem was in pivot point@@BenCloward

  • @mp3ha
    @mp3ha ปีที่แล้ว

    Hello, is it possible to have a tutorial for Decal Material?
    I want spawn decal on the ground when the grenade or barrel explodes, but when it's near the wall the part on the ground is correct but the part on the wall is blurry and messed up and warp.(Also to spawn blood on the surface)
    I looked for a way, but my problem was not solved. Thanks for your help

  • @QuakeProBro
    @QuakeProBro ปีที่แล้ว +4

    Great video! The only thing missing now would be the correct normals.

    • @GMTechArt
      @GMTechArt ปีที่แล้ว +4

      And the ability to turn the flag.

    • @aukehuys
      @aukehuys ปีที่แล้ว +4

      And fake gravity. Nontheless, great stuff and thanks for the video :)

    • @TechArtAlex
      @TechArtAlex ปีที่แล้ว +3

      When using a sine wave for animation, recalculating the normal vector is trivial because the derivative of sin(x) is cos(x), and the derivative (slope) of a curve is perpendicular to the normal vector.
      Plug the same input going into your sine wave into cosine to find the tangent, then rotate it 90 degrees (Y, -X) to find the normal.

  • @tylerscott3192
    @tylerscott3192 8 หลายเดือนก่อน

    Is there certain settins the material should be in terms of Material Domain, Blend Mode, Shadeing Model? I plugged everything in how your have shown in UE5 and my shader is very sharp and blown out

  • @JohnLeBaronDesign
    @JohnLeBaronDesign ปีที่แล้ว +1

    For me, it just slides back and forth in Unreal 5.2. Using a TexCoord instead of LocalPosition helped make the texture look wavy, but either way the geometry stays flat and slides back and forth.

    • @robinj6997
      @robinj6997 ปีที่แล้ว

      I had the same problem. TexCoord solved it. Try rotate your sail 90 degree in the viewport

    • @JohnLeBaronDesign
      @JohnLeBaronDesign ปีที่แล้ว

      @@robinj6997 yeah, as I mentioned, I tried a TexCoord, and it made the texture look wavy but the geo moved in a sliding position despite its rotation. I just used cloth in the end. Thanks though.

    • @CL-yy7ei
      @CL-yy7ei 10 หลายเดือนก่อน

      In 5.3, I set the period of the sine node to 3.14, it worked

  • @А.С-е7р
    @А.С-е7р ปีที่แล้ว

    Ben, thank you for everything that you're doing! Speaking of shader "expensiveness". If it's possible, can you one day make a video on technical explanation about how things work, please? What influence what, which is the task for GPU, which is for CPU, how to measure and interpret the shader performance, which tools are more and which are less expensive, what is better to use on mobile platforms, and what is should be considered as computer/console only, etc.? I can even try to help you with this if needed, in terms of running tests, editing the video, audio or other tasks 😊 My point is to collect everything you teach us in one video. Because you have mentioned about this aspects here and there in different videos many times. But it would be amazing to have something like a handbook, where you can always return and realize, where and how you can optimize your particular work. I might need mistaken, but I guess it will be extremely useful for many of us. Thanks!

    • @jussirautiainen3784
      @jussirautiainen3784 7 วันที่ผ่านมา

      I'll be waiting for the 12 Volume set on this topic ...

  • @darkmattergamesofficial
    @darkmattergamesofficial ปีที่แล้ว +1

    Great video! Is there a way to apply some “drag” to the flag so it could be placed on a moving object? I imagine waving the flag back and forth would cause the vertices to sort of lag behind and create that effect. I tried multiplying their positions by world space, but to no luck. I think I need the work space in the last frame.
    Any help would be appreciated. Thank you!

    • @fleity
      @fleity ปีที่แล้ว

      You might need to add a c# component to the object too which pre-calculates and sends values like last frame's position to the material. But with that, very doable.

    • @darkmattergamesofficial
      @darkmattergamesofficial ปีที่แล้ว

      @@fleity Right, that would probably do it. I am experimenting with a more simple solution by inputting world space into the UVs, so when the object moves through the world the cloth kind of flutters more or less depending on its speed. It sort of simulates a dynamic movement effect without the C# component giving it something each frame. Of course it won't work for a real flag, but for character clothing it seems to do the trick.

    • @fleity
      @fleity ปีที่แล้ว

      @@darkmattergamesofficial you surely can make something which looks plausible-ish enough to work that way, but the stateless nature of shaders kind of prevent you from getting any kind of overlap from a previous position to the current state. Yes World space position uvs and a noise texture or function give you some motion but you probably can't build up and scale down the effect when the player stops moving and you have trouble getting a good direction. In this case the extra step is probably worth it :)

    • @darkmattergamesofficial
      @darkmattergamesofficial ปีที่แล้ว

      @@fleity Very true. I will mess around with it a bit and see if I can make a stateless system look convincing, but at the end of the day there is that hard limitation where a C# script is the only way forward. I also though about faking some physics on solid objects. For example if you wanted to attach a pouch to a character's belt and have it rotate to match the pull of gravity, like it was suspended somehow. That could work in a shader, but you may only be able to get a locked effect, it wouldn't sway with physics.

  • @isawedthedemons
    @isawedthedemons ปีที่แล้ว

    I'm guessing UE5 still doesn't have mipmaps for the scene color, or even bilinear filtering?

  • @Slayer9299
    @Slayer9299 ปีที่แล้ว

    why doesnt my plane wave like how yours would? mine just wiggle is there something to do with the poly counts?

    • @Slayer9299
      @Slayer9299 ปีที่แล้ว +1

      i figured it out it was indeed the poly counts

  • @miloszgierczak4806
    @miloszgierczak4806 ปีที่แล้ว +1

    Great, instant watch!!

  • @litkt7658
    @litkt7658 ปีที่แล้ว +1

    Thanks for your usual awesome tutorials! Could you please do a tutorial on shining diamond/crystal shaders sometime?

    • @BenCloward
      @BenCloward  ปีที่แล้ว +1

      Thank you for the suggestion! I'll put it on my list.

  • @Govi627
    @Govi627 10 หลายเดือนก่อน

    After going through this for Unity, when adding the negate and saturate, half of my flag is immobile while the other half is moving normally. Any idea where I went wrong? Thanks

    • @BenCloward
      @BenCloward  10 หลายเดือนก่อน

      You need to make sure that the pivot point for your mesh is on the side where the flag would attach to the pole instead of in the middle. I think that’s what your problem might be.

  • @gergolaky3624
    @gergolaky3624 ปีที่แล้ว

    Impressive demonstration! Can Unity, using shaders, emulate features from traditional 3D software like Blender or Maya? For instance, can it replicate the bend modifier from 3ds Max? If so, to what degree? Are there limitations or inefficiencies in Unity compared to these 3D packages? My challenge has always been transferring procedural objects with their functions from 3D software to Unity to interact in real-time with features like rigidbody. Would appreciate your insight, my diplomawork centers around this.

  • @madmickmad
    @madmickmad 5 หลายเดือนก่อน

    Instead of using sine i used cosine and now its waving like it should

  • @Da-rPo03
    @Da-rPo03 6 หลายเดือนก่อน

    Struggling to get this to work. In Unreal, it just seems to make the mesh go left and right.

    • @BenCloward
      @BenCloward  6 หลายเดือนก่อน

      Did you see the next video in the series? I cover a couple of things there that I forgot to mention in this one. It might help.

    • @Da-rPo03
      @Da-rPo03 2 หลายเดือนก่อน

      @@BenCloward so I found that - for whatever reason - if I made the same simple quad in Blender, it works. It seemed like my version of Unreal 5, the modelling tools were doing something that didn’t place nicely with this approach.

  • @SixDayStudio
    @SixDayStudio ปีที่แล้ว +1

    Very nice!

  • @ovrava
    @ovrava ปีที่แล้ว

    pretty sure i set it up identical and my Flag movement is broken. In Unreal.
    Right at the last multiplication with the base output of the mask.

    • @ovrava
      @ovrava ปีที่แล้ว

      I just multiplied it by a small number. It works now, but still kinda edgy.,

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      I forgot to mention in the video that in order for this to work, the pivot point of your flag mesh needs to be on the side of the mesh where the flag pole will be. So that could be the problem you're having?

    • @ovrava
      @ovrava ปีที่แล้ว

      Thanks for the reply. I Figgured that out. My Wave just looks to Edgy now, in contrast to the smooth wave in your video.@@BenCloward

    • @jackmordh9130
      @jackmordh9130 ปีที่แล้ว

      @@ovrava you probably just need more divisions on your plane to give the sine wave enough verts to look smooth

    • @BenCloward
      @BenCloward  ปีที่แล้ว

      @@ovrava It sounds like you just have a plane that has fewer polygons than the one I'm using. You can reduce the edginess either by increasing the wavelength of your wave or by using a flag mesh that has more polygons.

  • @shiv-iwnl8188
    @shiv-iwnl8188 ปีที่แล้ว +1

    Just made something similar an hour ago