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!
Start time from zero / Storing StartTime
Re: Start time from zero / Storing StartTime
Basically what's being asked here, but Amplify didn't post the answer
http://amplify.pt/forum/viewtopic.php?f ... =increment
http://amplify.pt/forum/viewtopic.php?f ... =increment
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Start time from zero / Storing StartTime
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!
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!
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!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!