Jump to content
Search Community

gsap + three js - lagging on macbook but okay on mobile + windows

bultano test
Moderator Tag

Recommended Posts

Hi guys,

 

I've been making a test project using react three fibre + gsap, link below:

https://moving-vehicles.vercel.app/

 

However, when i got round to testing on multiple devices i found that it severerly lags on macbooks.

 

On all windows devices ive tried it runs fine and mobile devices but then on macbook it just lags like crazy.

 

Is anyone able to replicate and think of a reason this may be happening?

 

I'm using intersection observers to detect which slide the user is on but the rest is quite lightweight

 

Thanks

Link to comment
Share on other sites

Hi,

 

Unfortunately I can't test on Mac, but on ubunto 20 & 22 works fine on the latest Chrome and Firefox.

 

Have you tried ScrollTrigger instead of Intersection Observer? ScrollTrigger should be far more efficient and CPU friendly than IO. Also you could try GSAP Observer (included in ScrollTrigger) as well:

https://greensock.com/docs/v3/Plugins/Observer

https://greensock.com/docs/v3/Plugins/ScrollTrigger/static.observe()

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Hi

 

Thanks for your comment, i switched it over to observer and had the same issue.

 

On experimenting on safari, I found a setting within developer -> experimental features -> webgl via metal - if i disable this it fixes the issue

 

do we know if there is a way to set this as default when the site is ran?

Link to comment
Share on other sites

No lag issues here on Safari Version 16.3 (18614.4.6.1.6) on a MacBook Pro 16-inch M2 Pro,  macOS Ventura 13.2.1

 

I don't know of a way to set flags on a browser based on a specific page. That seems not like how things would work. If you could create a minimal demo demonstrating the issue, I think you'll get a better answer, because someone can dive in the code and see maybe the culprit. Also what OS and browser version the issue is on would be great information.

Link to comment
Share on other sites

Hi all,

 

To anyone that might have the same performance issues only on macbook, please see the below:

 

            <Canvas gl={{ antialias: false }} dpr={[1, 1.5]} flat antialias="false" >
  • Like 1
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...