I'm trying to use Sine Time output from Time node but I want it to be faster.
If this is done in a Unity c#, I would try to something like this
totalTime += Time.deltaTime * speed;
value = Mathf.PingPong(totalTime, 1);
but I can't do this in Shader Graph. How to solve this problem?
EDIT1: I also try to create custom node fuction but this will result in error.
static string PingPongFunction(
[Slot(0, Binding.None)] Vector1 t,
[Slot(1, Binding.None)] Vector1 length,
[Slot(2, Binding.None)] out Vector1 Out)
{
return
@"
{
Out = Mathf.PingPong(t, length);
}
";
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.