Jump to content
Search Community

Swiper slider animation + SVG mask transform performance issues only on RETINA display

petya test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello everyone!

I need help with animation performance on RETINA display

I have a swiper slider and on slideTranasitionStart I'm animating a mask (covering the whole slider).

The animation is very smooth in all browsers. I'm using an external monitor for work but as soon as I drag the browser window to my retina display (MacBook Pro -Retina, 13-inch, Early 2015, macOS Mojave) the animation looks very laggy (lowest fps is around 5-6!) !

I tried 2 main options to do the animation:

  1. Adding classes to transform the mask (and only using the most performant css properties transform and opacity on the animated elements). For this option I tried adding will-change property on the animated elements, I replaced translateX with translate3d, I only added transition on the transform property.
  2. Using morphSVG plugin to achieve the transforming of the mask (in the codepen demo I'm using this option as it's way less code)

Unfortunately both options are still laggy on retina display.

Nothing seems to improve the performance on the retina display and I'm running out of options.

 

I'd be very grateful if someone can help out!

Thank you

 

See the Pen abbWrKY by petia182 (@petia182) on CodePen

Link to comment
Share on other sites

19 minutes ago, ZachSaucier said:

Hey Petya and welcome to the forums,

 

I'm not seeing the same stuttering on my retina display. What browser are you using? Have you tried removing parts (the black rectangles, the letter masks) and tested to see which piece(s) specifically are causing the stuttering? 

 

Hi Zach, thank you for the fast reply!

It's a good sign that you don't see the lag.

On retina I tried Google Chrome - not as laggy (but still worse than the normal display), but Safari and Firefox are definitely laggy.

Indeed, I tried removing the black rectangles, but the performance issue is still there (it does get a tiny bit better, but going from min 4.90fps to min 6.31fps, which is still very low).

I recorded the performance with Firefox debugger. You can see on the screenshots below that the difference is minimal ...

Firefox performance - without black boxes.png

Firefox performance - with black boxes.png

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.
×
×
  • Create New...