I have creating a pulsating shiny effect with the following as nodes:
Abs(Time * speed) => sine
I have an oscillating value between 0 and 1 but the problem is that the value may start from anything between 0 and 1 depending on the Time value.
I am trying to figure out a way where it would be possible to get that value outside the shader so the script can set a property to offset:
float offset = GetTimeFromShader();
material.SetFloat("_Offset", offset);
and the shader ends up with:
Abs((Time - offset) * speed) => sine
This would ensure the pulsation to start from 0.
The other possibility would be to create an increasing vector1 in the shader simulating:
temp += Time.deltaTime * speed;
But Shader graph prevents node loop.
I could do it in script and pass it down to a shader property but if there were a way to keep it all in the shader.