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 - Ігри
You are amazing!! Thank you so much for sharing these tutorials
thanks a lot! really high-quality tutorial with super straightforward explanations!
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!
I love the tutorials you make on your channel
Man, thousand thanks to you🙏 you are the best
Your work is too good
Thanks a lot
finally found a good tut for grass shader
THANKS A LOT
Thanks a lot! It is grateful and helpful!
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).
Yep, this UV projection method is hard to use on tree models. I might make a video on creating tree shaders later.
@@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.
best tutorial on yt!
The tutorial was super! I managed to make pretty much similar result to HDRP with this tutorial.
讲的非常好,牛逼.
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
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.
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..
When creating models in Blender, make sure to place the origin at the bottom of the model.
@@paro456 And at the world origin point
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
Perhaps this can help you out: github.com/MangoButtermilch/Unity-Grass-Instancer
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.
Perhaps the wind is too strong, try to weaken it.
@@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 :)
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?
Perhaps your grass objects are too small or position incorrectly, causing them to appear underground.
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.
Sorry that the explanations in these two videos were a bit fast, so you might have missed some steps. Perhaps you should try again.
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
can you check that in your model also.
changing ambient occlusion to 0 solve this. but it is changing color
solved! changing alpha clip Threshold to 0.9 solved this. Thank u for the tutorial
Hi! im wondering why my plants "base" is still moving although i added the UV--Split fix :O Help!
Could you provide a GIF or video to help me better understand this issue?
I feel like using Perlin noise without a sine wave could be better.
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.
@@paro456 ya, a looping texture would look good and be very efficient
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.
Maybe you could share some pictures or videos so I can help you better.
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
@@Joseph-gv1zm You can find my Discord in the description of my youtube channel.
Any way of doing this without relying on the texture UV's?
You can achieve a similar effect by comparing the vertex position y value with the object's world space position y value.
@@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!
@@iansantosart Perhaps I'll make another video explaining how I did it.
@@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
@@iansantosart you can also use the second UV map to achieve a similar effect btw
Mine wouldnt change size with terrain bruch 😕
I believe you can find the relevant options in the terrain tool settings.
not available "Render Face" in ShaderGraph.. what to do?
You can contact me through Discord, so I can better help you resolve your issues. paro456d
@@paro456 Thank you. This was caused by a different version of UNITY. I just kept doing the lesson and everything turned out!
when i added the wind the model just desepeared
You can contact me through Discord, so I can better help you resolve your issues. paro456d
How did you export to unity?
File -> Export -> FBX
Why do you add it as tree???
idk :/
Does it work on hdrp?
Yep
@@paro456 do you mind sending the grass texture? :)
My shader keeps turning pink
Is the shader you used for your material the one you just created?
Will it work in Android?
yep
how to make 3d model?! I spend 3 hours and I cant make a 3dmodel
You can find some tutorial videos for Blender to learn.