As my thinking it should be like that y0=(y+1)^4-(y+1)^2 Which "y" means original vertex position, and "y0" means new vertex position handled by bend strength (divide 100). So higher position (y) will result in a stronger offset (y0)--just like reality. (Sorry for my worse english...)
@@mudit_mathur Moso31 is correct. He multiplied the (y+1) node by itself once, creating (y+1)^2, then he multiplied that by itself, creating (y+1)^4. The final function of y0=(y+1)^4-(y+1)^2 is exactly what he created, but I can see where you looking at the cubic version has more of a wavy appearance. You're looking at the overall graph, but in reality, the horizontal axis represents the incoming y-coordinate and the vertical axis represents the outgoing amount of displacement. Realistically, only the part of the graph in the top-right quadrant will matter here. Keep in mind the output of this function is a multiplier for the direction vector that affects the x- and z-coordinates. The difference between this vs. using (y+1)^3 is just that it turns upwards a little faster, which doesn't really appear to make a huge difference. Given how sharp it is, it makes sense why he divided his bend strength by 100. Overall, from what I can tell, a simple linear function would have a similar effect if you're looking for a simpler version. Try looking at the graph of y=(x/100+1)^4-(x/100+1)^2 at the same time as y=0.022x, and you'll see that the functions mostly match through x=4. I won't pretend to know if this (x+1)^4-(x+1)^2 is a more studied standard to be a little bit more accurate, but it doesn't look greatly different from a line. Edit: If you're looking for why it waves, the time parameter is what is doing that.
Shader graph tutorials are SUPER useful. Thank you. Just a thing : can we hope to get more tutorials geared towards 2D/Sprite shader graphs? This is more of my thing, and, game making being only a hobby for me, I don't think I'll be able to get the skills to go 3D before at least a few years. Plus, 2D is still used a lot by the indie scene. So throwing us "2D guys" a bone would be very appreciated. :)
thank you so much for this video. My asset didnt work with URP and the trees and bushes wont move at all. and your video saved my day and my game!! God bless you!! ^^
So, is there any reason you are showing this but it is not available by default in the engine? Why HDRP wind is not properl working? Why SpeedTree is not working with HDRP?
If I have more than 1 mesh using the material it doesn't work. Instead of distorting the meshes it actually moves them. (The problem appears only if I use more than 1 mesh with the same material) (I am using a Blender mesh (so it has the axes flipped), so my shader has 2 values flipped (I use the Z (Blue) instead of the Y (Green), otherwise it wouldn't work also with only 1 mesh)
How heavy is this? Especially as compared to both Unity terrain trees and Custom Tree Importer trees, both of which will sway in the wind. I'm trying to figure out what is achievable on a mobile platform.
for those of you with the same problem, and that are new to shader graph, @ 1:09 right next to the word pbr master, click the setting cog button and change your surface from opaque to transparent. It doesn't say this in the video, but I found it in another video by mistake.
I tried converting my existing project into URP. It had some SpeedTree trees in it. Now the barks are pink (which is not the big issue) and the leaves are invisible, but their shadows are present. Any way I can make the leaves visible in URP?
You need to go to Edit > Render Pipeline > Universal Render Pipeline > Upgrade Selected Materials to UniversalRP Materials while selecting the tree or you can just upgrade all the materials in the project.
@@Underarmour81 I don't know if I need to have Speedtree for that but that's exactly what I did. That converted all other materials into simpler URP shader with flat lighting while converting the bark to pink (can be manually restored) and making the leaves invisible (couldn't restore this one).
@@sharif47 Late reply, but unfortunately TreeCreator is deprecated, and therefore, trees created with the tool are not supported anymore. Maybe there's a work around that I'm not aware of, but as far as I know, you can't upgrade TreeCreator trees. Unity is also not planning to provide any solution, at least not yet.
@@themaskyyt But SpeedTree is still supported with Unity, right? What tool is currrently being used with SpeedTree? And why aren't they providing any tool for updating to URP/HDRP? It's not like SpeedTree is some random third party company. Unity has been constantly promoting their products (not sure if they're still doing it now).
Anyone know how to add vertical and side to side displacement to this instead of just in one direction (i.e. what is controlled by the Bend Strength input)?
any tips on how i can achieve translucency with shadergraph? i tried so much already...i found that you can enable it in the hdrp for transparent objects and assign a diffusion profile..but despite that it does not work... any hints? anyone got this working? its such a common effect but noon eis talking about it
A shader is made for graphical purposes only so not really. You still could get the value in output by writing the values in a texture and reading through code but that's clearly not the goal of a shader.
So this tutorial is already out of date... Unity, you really need to be consistent with what you put out and actually stick to things. You are all over the place with this engine. Doing this in unity 2021.3.1f1 in URP, there is no such thing as Shader>PBR Graph. So what now? Honestly there are some things Unity does great but you're really going to get absolutely devoured by UE5 if you keep up the flipflopping and split render pipelines... Please, do better. I and many other devs are rooting for you.