Page 1 of 1

Adding A Time Delay

PostPosted: Mon May 21, 2018 5:10 pm
by Yoshinjo
Hello Amplify Shader people,

I'm trying to figure out how to add a delay to my shader animation without using scripts. I came across a post in my search for how to do this and came up with this. This seems like it should work, however I'm not well versed in shader language, so I can't be certain if this is accurate. Here is my node network, it doesn't seem to be working properly. I was hoping someone could shed some light onto this. Thanks in advance.

Here is the post:
https://gamedev.stackexchange.com/quest ... -in-shader

Steps:
To create a pause what you need to do is to scale and clamp your time.

As your animation time is already exactly 1 second long and you want a 2 second pause (1+2 = 3) you will need to:

- divide your time by 3 (multiply by 1.0/3.0)
- keep the fractional part as you're doing already,
- multiply by 3 (back to normal time scale)
- then clamp the animation value between 0 and 1 (your original animation length)

Node Network:

Image

Re: Adding A Time Delay

PostPosted: Mon May 21, 2018 6:45 pm
by Yoshinjo
Haha, looks like I was multiplying where I should have been using a divide...

Here's the fixed node network for those of you trying to add a delay:

Image

Re: Adding A Time Delay

PostPosted: Tue May 22, 2018 9:18 am
by Amplify_Borba
Thank you for sharing this sample with the community, it will definitely be useful for achieving certain effects!