r/unity_tutorials • • Apr 29 '23

Video ShaderGraph Vertex Displacement Basics - 2 Shaders to Manipulate Vertex Positions with Time

84 Upvotes

3 comments sorted by

8

u/LlamAcademyOfficial Apr 29 '23

Full Tutorial on YouTube

Hey all 👋!

Vertex Displacement in shaders I've always thought was really cool. Understanding the basics of how to manipulate these is key to making more flashy effects, like wind or water waves. In this week's tutorial you will learn how to make 2 shaders in ShaderGraph to create a "breathing" effect and a back-and-forth movement effect.

With this knowledge you can start to play around with more complex vertex movement!

👨‍💻 As always, the full project is available on GitHub

3

u/DaRkSoNi01 Apr 30 '23

Its been a while since i have started learning unity, i have learned alot of things, even shader graphs, but I would like to know what is the impact of using shader graphs compared to other alternatives. If someone could point out all the pros and cons, that would be very helpful.

2

u/LlamAcademyOfficial Apr 30 '23

ShaderGraph is just more approachable than using HLSL to create your own shaders. The performance should be reasonable, but with HLSL you have more control more easily. ShaderGraph under the hood takes the "Graph" you create and generates HLSL for you. My approach to optimization is: do it how you can understand and maintain it, optimize when it becomes a problem.

Doing complex algorithms in ShaderGraph can be annoying to hook up all the nodes, but you can do the math in a custom HLSL function that is exposed to ShaderGraph to hide those to retain the more easily digestible graphs.