我正在尝试使用时间节点的正弦时间输出,但我希望它更快。
如果这是在 Unity c# 中完成的,我会尝试这样的事情
totalTime += Time.deltaTime * speed;
value = Mathf.PingPong(totalTime, 1);
但我无法在 Shader Graph 中执行此操作。如何解决这个问题?
EDIT1:我也尝试创建自定义节点功能,但这会导致错误。
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);
}
";
}
最佳答案
关于unity3d - 统一着色器图 : How to speed up time from Time node?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50830820/