Cyclic Animation Shader

Node-based Shader Editor

Cyclic Animation Shader

Postby aroig_gsn » Mon Mar 05, 2018 11:28 am

Hello there! I'm new to Amplify Shader Editor. I'm trying to animate a "shine" texture to pan over my metal sprites (like swords, crowns, etc...) every now and then. And that's were I'm having problems. I got exactly what I wanted, but I think my solution is super-over-convoluted. I generated an alternating sawtooth function using time, fract and a couple of remaps to make the "shine" pan over the sprite, then wait for a few seconds before repeating.

My question is: is there an easy way to have a cyclic animation in a shader and be able to control how fast the animation plays (in this case, the shine going from side to side) and how long does the gap between cycles last?

I'm sure there's something I'm missing here :)

Thanks in advanced!
aroig_gsn
 
Posts: 6
Joined: Mon Mar 05, 2018 11:19 am

Re: Cyclic Animation Shader

Postby Ricardo Teixeira » Mon Mar 05, 2018 3:44 pm

aroig_gsn wrote:Hello there! I'm new to Amplify Shader Editor. I'm trying to animate a "shine" texture to pan over my metal sprites (like swords, crowns, etc...) every now and then. And that's were I'm having problems. I got exactly what I wanted, but I think my solution is super-over-convoluted. I generated an alternating sawtooth function using time, fract and a couple of remaps to make the "shine" pan over the sprite, then wait for a few seconds before repeating.

My question is: is there an easy way to have a cyclic animation in a shader and be able to control how fast the animation plays (in this case, the shine going from side to side) and how long does the gap between cycles last?

I'm sure there's something I'm missing here :)

Thanks in advanced!


Hello,

Thank you for getting in touch, we would be happy to help.

It really depends on the actual effect that you intend to build(2D, 3d? Actual specular or overlay?), it seems that you are on the right track as the Time node is the basis for most of these types of effects.

I could recommend looking into flipbooks but I'll need more information or a sample of the intended result in order to proceed.

Thanks!
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Cyclic Animation Shader

Postby aroig_gsn » Mon Mar 12, 2018 8:25 am

Ricardo Teixeira wrote:
aroig_gsn wrote:Hello there! I'm new to Amplify Shader Editor. I'm trying to animate a "shine" texture to pan over my metal sprites (like swords, crowns, etc...) every now and then. And that's were I'm having problems. I got exactly what I wanted, but I think my solution is super-over-convoluted. I generated an alternating sawtooth function using time, fract and a couple of remaps to make the "shine" pan over the sprite, then wait for a few seconds before repeating.

My question is: is there an easy way to have a cyclic animation in a shader and be able to control how fast the animation plays (in this case, the shine going from side to side) and how long does the gap between cycles last?

I'm sure there's something I'm missing here :)

Thanks in advanced!


Hello,

Thank you for getting in touch, we would be happy to help.

It really depends on the actual effect that you intend to build(2D, 3d? Actual specular or overlay?), it seems that you are on the right track as the Time node is the basis for most of these types of effects.

I could recommend looking into flipbooks but I'll need more information or a sample of the intended result in order to proceed.

Thanks!


Hello again! thanks for replying!

So I found a gif online that perfectly portrays what I'm after: Image . Its just that simple "light sweep" on UI sprites. Nothing more.
As I said, I've already achieved it, but my solution to trying to control the intervals duration and the "sweep" speed is super complicated.

So yeah, my problem is mostly about time, specifically intervals.

Thanks in advanced!

Adox
aroig_gsn
 
Posts: 6
Joined: Mon Mar 05, 2018 11:19 am

Re: Cyclic Animation Shader

Postby Amplify_Borba » Mon Mar 12, 2018 4:30 pm

Hello, could you provide a sample so that we can provide further insight on what could be changed in order for the effect to suit your needs?

You can also check out the BurnEffect shader we provide within the ASE package, in which we make use of the Sin node with additional calculations in order to control both intensity and frequency of the effect.

On a final note, wave manipulation is a common way of achieving this type of animation in shaders, in the following video that is part of our Youtube series of tutorials we show this type of calculation in effect: https://youtu.be/zK7hqx2kdJg?t=2m3s

Please let me know if this helps, 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!
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 122 guests

cron