GPU Canvas enables Rive files to render 3D and shader content in the web runtime. It is opt-in per Rive instance and available in @rive-app/webgl2 2.42.0+.
GPU Canvas is experimental. The API may change in a minor release without a major version bump.
Requirements
@rive-app/webgl2 only. The Canvas2D packages (@rive-app/canvas, @rive-app/canvas-lite) do not support GPU Canvas yet.
useOffscreenRenderer must stay false. GPU Canvas needs a WebGL context per <canvas>, while the offscreen renderer pattern shares one context across every canvas on the page. It is false by default in the web runtime, so there is nothing to change unless you set it to true.
Enabling GPU Canvas
Pass enableGPUCanvas: true when you create the Rive instance:
GPU Canvas is disabled by default, but that may change in a future major version.
Enabling GPU Canvas on a Cached File
A RiveFile takes the same enableGPUCanvas flag and cannot be changed once the RiveFile is constructed:
The file’s flag wins over the same property on new Rive(): a RiveFile created with enableGPUCanvas: true renders through the required deferred renderer technique even when the Rive instance is created with enableGPUCanvas: false (or unset), and the runtime logs a warning.
A GPU Canvas RiveFile cannot be shared across Rive instances. The renderer binds a file to a single <canvas>, so the first Rive instance you pass it to claims it.Additional Rive instances will still load, but they won’t use the RiveFile you passed in. Instead, the runtime logs a warning and creates a fresh copy of the .riv from the file’s existing buffer. As a result, anything you read or configure through the original RiveFile does not apply to those additional instances.
Limits
Each GPU Canvas instance takes its own WebGL context, and browsers cap how many contexts a page can hold, so only opt in for the graphics that need it. See WebGL Context Limits.