Page 1 of 1

Start time from zero / Storing StartTime

PostPosted: Mon Jun 11, 2018 11:56 pm
by tapsteady
Hi!

I'm looking for a way to reset time to 0 and remap the 0s-4s to 0-1 for a slider to get a one time animation once the shader is applied / object is created.

Is there an easy way to do this? Or an easy way to store the time at the start (StartTime) and subtract it from the current time?

Thank you!

Re: Start time from zero / Storing StartTime

PostPosted: Tue Jun 12, 2018 12:01 am
by tapsteady
Basically what's being asked here, but Amplify didn't post the answer :(

viewtopic.php?f=8&t=320&hilit=increment

Re: Start time from zero / Storing StartTime

PostPosted: Tue Jun 12, 2018 10:12 am
by Amplify_Borba
Hello, thank you for getting in touch!

Since shaders can't store states themselves, the only way accomplish this is to pass some kind parameter to the shader - e.g. we can reset a shader time via script, but not via shader.

This is an expected limitation, and all the options we can think of involve making use of a script:

* Create a Dissolve Time parameter which you reset every time you trigger a dissolve

* Use a simple script to do the time calculations and update the Dissolve Amount material parameter via script

Feel free to check our Smear sample, which provides an example on how to use scripting together with a shader, and don't hesitate to let me know if you have any further questions, thanks!