Page 1 of 1

Changing speed gradually without everything going to hell?!

PostPosted: Tue Feb 26, 2019 7:25 pm
by mrmongbat
So I've been trying to get my speed float variable to change smoothly so my sin/panner nodes start gradually moving faster as I increase the variable without much luck.

I thought I was doing something wrong but then I looked at the example scenes (such as this one here https://www.youtube.com/watch?v=X-w0zVo8taw&feature=youtu.be) and they seem to have the same trouble where the movement seems to snap randomly instead of increasing gradually?

Heres another video of a panner/sin node being affected by a float variable speed change
https://youtu.be/alWkhZfUQvY?t=26
Instead of gradually increasing speed they seem to move randomly forward/back.

It only seems to affect variables that multiply time, color gradients or xyz offsets/scales seem to work smoothly, but anything to do with timing just goes into a mess when its changed.

Is there any way to avoid this at all?

Here's a reference of my panner node setup: https://i.imgur.com/nUyaEyS.png

Here's my sin node setup: https://i.imgur.com/frKcv4F.png

Here's the setup from the official example scene for Uv distortion: https://i.imgur.com/PsvfY1m.png


edit: trying to multiply the speed variable with delta speed into a totaloffset variable which I then re-register gives me a infinite loop. https://i.imgur.com/QZGjMyJ.png

Re: Changing speed gradually without everything going to hel

PostPosted: Thu Feb 28, 2019 5:36 pm
by Amplify_Borba
Hello, these issues are likely to occur due to precision issues that originate from using Unity's timer, since our Time nodes output Unity's internal elapsed time in seconds.

The viable and ideal solution for effects that will rely on a timer would be for you to implement your own timer through script and feed its data into the shader as a property, rather than using Unity's own generated values, which will offer you more control and avoid this specific issue.