Time Node are different in material node and in HLSL?

Hey lovely community:

When I study HLSL for fun recently, I suddenly find out my time based material in hlsl are really slow. I know I can easily change it’s speed by multiple a number. But just out of curiosity, why the time node in material node seem to run in second, but in hlsl it seem to run much slower?

The code in custom node is simply : return sin(t);

Animation

Time in HLSL is a global variable it doesn’t change.

The apparent difference in speed for time-based operations is not due to the time variable itself, but how it’s utilized.

In Sine node, input is adjusted to control oscillation frequency.

Code of Sine node is:

return (Period > 0.0f Multiply(input, (2.0f * UE_PI / Period)))

1

1 Like

OMG. That’s the reason, it’s based in radius sin math.

Thank you Cube :+1:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.