Page 1 of 1

Cyclic Animation Shader

PostPosted: Mon Mar 05, 2018 11:28 am
by aroig_gsn
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!

Re: Cyclic Animation Shader

PostPosted: Mon Mar 05, 2018 3:44 pm
by Ricardo Teixeira
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!

Re: Cyclic Animation Shader

PostPosted: Mon Mar 12, 2018 8:25 am
by aroig_gsn
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

Re: Cyclic Animation Shader

PostPosted: Mon Mar 12, 2018 4:30 pm
by Amplify_Borba
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!