Changing speed gradually without everything going to hell?!

Node-based Shader Editor

Changing speed gradually without everything going to hell?!

Postby mrmongbat » Tue Feb 26, 2019 7:25 pm

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
mrmongbat
 
Posts: 5
Joined: Sat Nov 10, 2018 4:14 am

Re: Changing speed gradually without everything going to hel

Postby Amplify_Borba » Thu Feb 28, 2019 5:36 pm

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.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 6 guests