Creating Simple Grass Shader in Unity URP

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • If you found this video helpful, please consider giving it a like.
    Part 2 : • Unity URP - Make the g...
    My Patreon : / paro222
    My Discord : paro456d
    Unity Version :
    URP 2022.02.12
    Music :
    Sora - Roa
    Las Palmas - Scandinavianz
    The Light - LiQWYD
    0:00 Introduction
    0:20 3D Model
    1:10 Shader
    3:15 Wind
    6:50 LOD Group
    7:16 Result
  • Ігри

КОМЕНТАРІ • 67

  • @Samshimi
    @Samshimi 2 місяці тому +1

    You are amazing!! Thank you so much for sharing these tutorials

  • @user-yq5yh1ng8o
    @user-yq5yh1ng8o Рік тому +1

    thanks a lot! really high-quality tutorial with super straightforward explanations!

  • @evertonbarbosa4922
    @evertonbarbosa4922 4 місяці тому +1

    I was thinking of doing magic to create a beautiful and optimized grass, after being exhausted in not finding tutorials explaining the most ideal way for me, But I found you. you helped me a lot, thank you very much friend, I hope you achieve the success you desire. because you deserve it!

  • @DirtyShampoo
    @DirtyShampoo Рік тому +4

    I love the tutorials you make on your channel

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

    Man, thousand thanks to you🙏 you are the best

  • @Pigeon449
    @Pigeon449 3 місяці тому +1

    Your work is too good
    Thanks a lot

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

    finally found a good tut for grass shader
    THANKS A LOT

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

    Thanks a lot! It is grateful and helpful!

  • @luisr.f1655
    @luisr.f1655 23 дні тому +1

    It's a great video, although there is something that was missing and that is that I was using a Unity package called "book of the dead" and for 3d models the "UV" node doesn't really work since it focuses on the positions of the texture so that the models were moving from the ground, I changed the "position" node and it works better, although this depends on the point of origin of the geometry (something that can be fixed in blender).

    • @paro456
      @paro456  21 день тому +1

      Yep, this UV projection method is hard to use on tree models. I might make a video on creating tree shaders later.

    • @luisr.f1655
      @luisr.f1655 19 днів тому

      @@paro456 By experimenting I managed to extend the shader so that it can be used as a simple 2D grass, 3D grass, plant and tree, even adding distance Fade and a controller that synchronizes with the "wind zone" component on direction and intensity. What would be great would be if instead of using the player's Vector3, a Render texture was used to register entities that can interact with the shader and have a cleaning time, with that the shader would be perfect.

  • @FeeBigT
    @FeeBigT Рік тому +2

    best tutorial on yt!

  • @flowisle-bg3pi
    @flowisle-bg3pi Рік тому +2

    The tutorial was super! I managed to make pretty much similar result to HDRP with this tutorial.

  • @alxyslf445
    @alxyslf445 3 місяці тому +1

    讲的非常好,牛逼.

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

    this was amazing just one question, why spawn it as a tree rather than grass? also, would this be a way to render grass in the top-down games like Manor lords or Fartest Frontier, these games being top-down view have a large area of terrain showing yet it is littered with grass ... and it does not seem to affect performance ... thanks for the amazing video

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

      Since these are models and not textures?
      Adding LOD to each individual grass model is not good for performance. If you want a large area of grass, I recommend grouping the grass within an area and then applying LOD to the group. This approach will better reduce the impact on game performance.

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

    Great Video. Thanks for sharing. At first I did not think it was working, the issue is my grass is mostly below the terrain; I noticed this when flying through scene. everything is working fine, it is just the placement. Must be how I exported? when i drag and drop the prefab, it is above the terrain. Any ideas? I turned off the Random tree height and set it to 2, turned off the random tree width; the grass is taller, but it is still below the terrain. Trees add to terrain correctly..

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

      When creating models in Blender, make sure to place the origin at the bottom of the model.

    • @skomakarna2684
      @skomakarna2684 Місяць тому

      @@paro456 And at the world origin point

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

    hey, i wanted to know if there is way i use c# to spread out my grass. right now, i can use for loop and some density variables to distrubute grass on a flat plane, the problem comes when there is a unever terrain, i was thinking of shooting a raycast for the sky directly down to the ground, but there is for sure a better way to do this. maybe i can use the model's vertex data or something, help me out on this one

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

      Perhaps this can help you out: github.com/MangoButtermilch/Unity-Grass-Instancer

  • @anonymous-3695
    @anonymous-3695 8 місяців тому +1

    i have a small issue, when i try add the world position near the end, to make them sway differently. it tends to distort the whole thing. instead of sway now it warps the image.

    • @paro456
      @paro456  8 місяців тому +2

      Perhaps the wind is too strong, try to weaken it.

    • @anonymous-3695
      @anonymous-3695 8 місяців тому +1

      @@paro456 thank you for the video! could i add you on discord? maybe im doing something wrong. weakening did help, but it seems to effect it in the wrong way. the last step anyway. ive sent you a request :)

  • @djwolf9705
    @djwolf9705 10 місяців тому +1

    Hi it's been a great video. But when I place the grass in the landscape, it is almost never visible. How can I solve it?

    • @paro456
      @paro456  10 місяців тому

      Perhaps your grass objects are too small or position incorrectly, causing them to appear underground.

  • @remytempest4617
    @remytempest4617 Рік тому +3

    Hi! This was very helpful! However, when my character runs through the grass, the movement becomes uniform throughout. I have the grass on a plane instead of a terrain for my purposes but I followed the other steps. I also noticed that when I followed part 2, it seemed that the collisions were not detected despite making sure to adjust the global player position. Not sure where the error lies. I'm new to Unity so sorry for any silly questions.

    • @paro456
      @paro456  Рік тому +2

      Sorry that the explanations in these two videos were a bit fast, so you might have missed some steps. Perhaps you should try again.

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

    Hi! great tutorial .i made my grass exactly like in the tutorial. But i am having issue with grass viewing . there is a white outline in grass when viewing from a distance. how to solve that. i don't have basics in shaders

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

      can you check that in your model also.

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

      changing ambient occlusion to 0 solve this. but it is changing color

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

      solved! changing alpha clip Threshold to 0.9 solved this. Thank u for the tutorial

  • @skomakarna2684
    @skomakarna2684 Місяць тому

    Hi! im wondering why my plants "base" is still moving although i added the UV--Split fix :O Help!

    • @paro456
      @paro456  Місяць тому

      Could you provide a GIF or video to help me better understand this issue?

  • @watergames8449
    @watergames8449 9 місяців тому +1

    I feel like using Perlin noise without a sine wave could be better.

    • @paro456
      @paro456  9 місяців тому +1

      Yep, that's a great idea. However, one thing to keep in mind is that the noise algorithm might involve a lot of loops, so it's better to use a noise texture.

    • @watergames8449
      @watergames8449 9 місяців тому +1

      @@paro456 ya, a looping texture would look good and be very efficient

  • @Joseph-gv1zm
    @Joseph-gv1zm Рік тому +1

    I have a problem occuring. The more grass i am placing the more lag is occuring. I have setuped the lod. But shader is always running even when the player is far away. Its turning 300 fps to 4 fps. What to do.

    • @paro456
      @paro456  Рік тому +2

      Maybe you could share some pictures or videos so I can help you better.

    • @Joseph-gv1zm
      @Joseph-gv1zm Рік тому +1

      I found the solution. A friend helped me. Instead of painting trees in the trees tab do it in the paint details tab. It worked. Thanks by the way. How can i contact you

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

      @@Joseph-gv1zm You can find my Discord in the description of my youtube channel.

  • @plyczkowski
    @plyczkowski 5 місяців тому +1

    Any way of doing this without relying on the texture UV's?

    • @paro456
      @paro456  5 місяців тому +1

      You can achieve a similar effect by comparing the vertex position y value with the object's world space position y value.

    • @iansantosart
      @iansantosart 4 місяці тому

      @@paro456 what nodes I need to use to achieve this? I'm making multiple plants with the same texture so the uv workflow doesn't work, thank you for the tutorial!

    • @paro456
      @paro456  4 місяці тому

      @@iansantosart Perhaps I'll make another video explaining how I did it.

    • @iansantosart
      @iansantosart 4 місяці тому

      @@paro456 I would deeply appreciate it! I managed to made it work by painting a black and white texture to show where I didn't wanted the plants to move and texture lod node

    • @paro456
      @paro456  4 місяці тому

      ​@@iansantosart you can also use the second UV map to achieve a similar effect btw

  • @dertobbe1176
    @dertobbe1176 2 місяці тому +1

    Mine wouldnt change size with terrain bruch 😕

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

      I believe you can find the relevant options in the terrain tool settings.

  • @rayankrimmer2611
    @rayankrimmer2611 10 місяців тому

    not available "Render Face" in ShaderGraph.. what to do?

    • @paro456
      @paro456  10 місяців тому +1

      You can contact me through Discord, so I can better help you resolve your issues. paro456d

    • @rayankrimmer2611
      @rayankrimmer2611 10 місяців тому

      @@paro456 Thank you. This was caused by a different version of UNITY. I just kept doing the lesson and everything turned out!

  • @Xen0ks
    @Xen0ks 10 місяців тому

    when i added the wind the model just desepeared

    • @paro456
      @paro456  10 місяців тому

      You can contact me through Discord, so I can better help you resolve your issues. paro456d

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

    How did you export to unity?

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

    Why do you add it as tree???

  • @itzdrify5678
    @itzdrify5678 11 місяців тому

    Does it work on hdrp?

    • @paro456
      @paro456  11 місяців тому

      Yep

    • @itzdrify5678
      @itzdrify5678 11 місяців тому

      @@paro456 do you mind sending the grass texture? :)

  • @bradpit1853
    @bradpit1853 27 днів тому

    My shader keeps turning pink

    • @paro456
      @paro456  25 днів тому

      Is the shader you used for your material the one you just created?

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

    Will it work in Android?

  • @zostawSuuuuba._
    @zostawSuuuuba._ 4 місяці тому

    how to make 3d model?! I spend 3 hours and I cant make a 3dmodel

    • @paro456
      @paro456  4 місяці тому

      You can find some tutorial videos for Blender to learn.