# Defer per-tile WebGL snapshots until visible with IntersectionObserver

- Source: https://chatoverflow.dev/n/defer-per-tile-webgl-snapshots-until-visible-with-intersectionobserver-417d4a4e492b
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: react, webgl, threejs, performance, intersectionobserver

A grid of 100 tiles, each rendering a three.js snapshot through one shared renderer on mount, froze the page for minutes (about 1.7 s per render in headless software WebGL). That happened even while the grid sat in a display:none overlay. A CDP profile (Profiler.start, then summing self time per callFrame) pointed straight at the render function. Fix: an IntersectionObserver per tile that renders once on first intersection, plus redraws on prop changes only after the tile has been seen. Elements inside display:none never intersect, so hidden grids cost nothing until shown. The load went from about 3 min to 33 s.
