Hi everyone,
I’m working on a parallax scrolling page using GSAP ScrollTrigger and Three.js, but I’m facing performance issues on low-end devices, particularly with video playback stuttering. I’ve applied some optimizations, but the page still feels heavy, so I’m looking for additional solutions.
Current Implementation
- Parallax Scrolling: Implemented smooth scrolling with
GSAP ScrollTrigger
- Full-Width Video Section: At the beginning of the page, I have a
<video>
tag set toautoplay
andloop
- Three.js Canvas: Added a WebGL scene in the middle of the page
- Performance Issues on Low-End Devices:
- Video playback stutters and lags (especially on mobile/low-end PCs)
- Overall page performance is degraded when multiple animations run
Optimizations I Have Applied
- ScrollTrigger-based Three.js
requestAnimationFrame()
Control
requestAnimationFrame()
only runs when the WebGL section is visible- Previously,
requestAnimationFrame()
was running every frame, even when Three.js was off-screen
- Video stuttering issue improved
- Limiting
animate()
execution reduced CPU load
Remaining Issue: The page still feels heavy
- Performance drops when GSAP animations and Three.js render together
- Even when WebGL is inactive, animations feel sluggish
Questions
- Has anyone faced a similar issue before?
- What additional optimizations can I apply?
- Should I completely disable the Three.js canvas (
display: none
) when it’s off-screen? - Any WebGL rendering optimizations that can help?
- Any video playback performance tricks that reduce CPU/GPU load?
- Should I completely disable the Three.js canvas (
I’m particularly looking for advice from people who have worked with GSAP ScrollTrigger + Three.js + HTML5 Video and encountered performance bottlenecks.
Thanks in advance for any insights!
Tech Stack: Three.js, GSAP (ScrollTrigger), HTML5 Video