Skip to content

perf: pause Three.js rendering loop when canvas is hidden or page is inactive#1010

Open
KGFCH2 wants to merge 1 commit into
Saatvik-GT:mainfrom
KGFCH2:performance/threejs-optimized-loading
Open

perf: pause Three.js rendering loop when canvas is hidden or page is inactive#1010
KGFCH2 wants to merge 1 commit into
Saatvik-GT:mainfrom
KGFCH2:performance/threejs-optimized-loading

Conversation

@KGFCH2
Copy link
Copy Markdown

@KGFCH2 KGFCH2 commented Jun 5, 2026

Summary

Optimized Three.js animation cycle using visibility state hooks and IntersectionObserver.

Changes

  • Modified script.js to pause/resume the requestAnimationFrame loop conditionally.

Verification

  • Verified GPU utilization drops to 0% when the browser tab is hidden or when scrolled out of view.

Closes #1009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Paused Three.js loops when offscreen/tab inactive

1 participant