The WebGL rendering context.
The underlying Renderer instance.
The underlying <canvas> element. Append this to the document yourself.
Whether the render loop is currently running.
Controls the render loop. Setting to true starts requestAnimationFrame;
setting to false stops it.
Registers a scene with the renderer. Scenes are rendered in insertion order.
The ScrollScene to add.
Stops the render loop, removes the resize listener, and destroys all
registered scenes (disconnecting their IntersectionObservers).
Returns the underlying <canvas> element so callers can remove it from
the DOM if they own it. When using a React-managed canvas (passed via
rendererProps.canvas) you don't need the return value — React will
remove the element itself on unmount.
The canvas element.
Removes a previously registered scene from the render loop.
This does not call ScrollScene.destroy — the caller is
responsible for disconnecting the scene's IntersectionObserver by
calling scene.destroy() when it is no longer needed.
The ScrollScene to remove.
The main render loop — called internally via requestAnimationFrame.
Do not call this directly; use the playing setter instead.
Timestamp provided by requestAnimationFrame.
Synchronises the GL canvas buffer size with the layout viewport.
Uses document.documentElement.clientWidth/clientHeight rather than
window.innerWidth/innerHeight because on systems with classic
(non-overlay) scrollbars innerWidth includes the scrollbar gutter,
while a position:fixed; width:100% canvas does not — causing every
scissor rect to clip a few pixels short on the trailing edge.
Called automatically on construction and on every resize event.
Renders multiple independent WebGL scenes on a single fixed canvas, each scissor-tested to a DOM element's exact pixel bounds.
A single
requestAnimationFrameloop drives all registered ScrollScene instances. Scenes outside the viewport are skipped automatically viaIntersectionObserver. The canvas is cleared to transparent once per frame before the scissored passes run.Example
Example: React — pass a canvas ref so React owns the DOM node