Adding A Time Delay

Node-based Shader Editor

Adding A Time Delay

Postby Yoshinjo » Mon May 21, 2018 5:10 pm

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
Yoshinjo
 
Posts: 11
Joined: Tue Mar 20, 2018 8:51 pm

Re: Adding A Time Delay

Postby Yoshinjo » Mon May 21, 2018 6:45 pm

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
Yoshinjo
 
Posts: 11
Joined: Tue Mar 20, 2018 8:51 pm

Re: Adding A Time Delay

Postby Amplify_Borba » Tue May 22, 2018 9:18 am

Thank you for sharing this sample with the community, it will definitely be useful for achieving certain effects!
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 28 guests