Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Intikas

Background-clip:text + autoalpha + stutter

Recommended Posts

I can't  get gsap's animation not to freeze/jump constantly on firefox if text is using background-clip:text, i included a codepen of the most simple of the animations that fail horribly on firefox ( works on chrome and opera ) anyone has some suggestions ? 

See the Pen vddzao by Intikas (@Intikas) on CodePen

Link to comment
Share on other sites

Hi and welceome to the GreenSock forums,

 

Thanks for the demos. 

I did some exploring and it seems that GSAP can set() the opacity just fine on that element and it works.

 

If you animate the opacity, GSAP will apply the values properly to the inline style but FireFox will not render the text with those values.

 

See the Pen LQQMJq by anon (@anon) on CodePen

 

 

 

My guess is that FireFox is doing some wonky performance optimization to not allow stuff with clip to get updated during rapid requests. Perhaps there is a way to trick it to render but I wasn't successful. 

 

From what I can tell this is not a GSAP issue or something it can solve, but perhaps someone else has some ideas.

  • Like 2
Link to comment
Share on other sites

oh, it looks like you can animate the opacity of the text's parent: 

See the Pen LQQMvv by anon (@anon) on CodePen

 

  • Like 4
Link to comment
Share on other sites

3 hours ago, Carl said:

My guess is that FireFox is doing some wonky performance optimization to not allow stuff with clip to get updated during rapid requests. Perhaps there is a way to trick it to render but I wasn't successful. 

 

Remember this?

https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/

 

That is the best explanation of how browser rendering works. Some people think animating opacity is cheap because it's not destructive, but that's not completely true. It can actually be a rather complicated process. See the part about "Minimizing the number of intermediate textures".

 

So yes, Firefox is most likely optimizing it. The will-change property is extremely difficult to work with when scaling, but it does serve a purpose.

 

.has-texture{
  will-change: opacity;
}

 

 

 

See the Pen GQQbvd by osublake (@osublake) on CodePen

 

  • Like 3
Link to comment
Share on other sites

That goes for filters too. They are rendered in a multi-step process just like opacity. 

 

I noticed a huge boost in performance when animating complicated filters using will-change.

 

.has-texture {
  will-change: filter;
}

 

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×