I’m trying to create a wave in shader graph. My approach is to create a hazy line and increase it over time from 0 to 1, and then snap it back to 0.
I’m having a lot of trouble achieving this in shader graph, and from what I found online, everybody seem to recommend exposing the property and manipulating it via C# code.
I still want to achieve this via shader graph, both for learning purposes and because it feels rather trivial to achieve, and I don’t want to add any unnecessary calculations to the CPU.
When using the LERP node, (I’d rather tween it, but let’s start with the basics), connecting the time node directly to the T input causes the whole preview to turn white. Multiplying time by any value doesn’t really change it. I don’t really understand the time output anyway, is it simply a growing integer? When connecting delta time, the preview flickers (understandable because delta time is usually a very small float). Sine and Cosine are producing desirable effects, but they both go from -1 to 1 and then from 1 to -1 (or vice versa), and I can’t figure out how to snap the value back to 0 when it reaches 1, and only increase it.
Anybody here can help me? I really do wish to have a more intuitive approach to shader graph, before I resort to good old C#
Thanks.