Need help with _Time for a loop > 1 sec

Hi all,
in my shader i need to loop over certains points (think animation of vertex). I am currently using fmod(_Time.x, 1) to loop a 0.00 to 1.0 value from 0 to 1 second. This works perfectly fine.

However, I now need to expand on this to go from 1 seconds to at least 2 seconds and fmod is no longer relevant.

Browsing from tons of forum posts I do not find much information about _Time. Probably there is some hack with sin(_Time) that I cannot find by myself.

Would someone have an idea? thanks

fmod(_Time.x, 2) * 0.5 unless i didn’t understand your problem

FYI the code fmod(_Time.x, 1.0) will loop between 0.0 and 0.999… over 20 seconds.

_Time.__*x*__ = time / 20
https://docs.unity3d.com/455/Documentation/Manual/SL-BuiltinValues.html

Unmodified time is in _Time.y. You may also want to use frac(value) instead of fmod(value, 1).

So to go from 0.0 to 0.999… over some value of seconds the simplest code is:

frac(_Time.y / seconds)