rive-app / rive-app/rive-runtime
[Performance] Support GPU Instancing to Reduce Draw Calls for Multiple Sprites
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
Problem
When rendering multiple Rive sprites with the same artboard/animation, each sprite requires a separate draw call. This limits performance when displaying many identical sprites (e.g., particles, crowds, repeated elements).
Current Performance:
- 100 identical sprites = 100 draw calls = - fps
Expected with Instancing:
- 100 identical sprites = 1 draw call = + FPS
Proposed Solution
Implement GPU instancing or batching for sprites that share:
- Same artboard
- Same animation state
- Same texture/material
This would allow rendering hundreds or thousands of identical sprites with minimal performance impact.
Use Cases
- Particle systems
- Crowd simulations
- Repeated UI elements
- Tile-based games
- Background decorations
Technical Approach
Similar to how PixiJS implements sprite batching, the renderer could:
- Group sprites with identical properties
- Upload instance data (position, scale, rotation) to a single buffer
- Use
drawArraysInstancedordrawElementsInstancedfor WebGL2 - Fall back to manual batching for WebGL1
Current Workarounds
- Frustum culling (only render visible sprites)
- Shared artboards, animation (reduce memory, but not draw calls)
Note
While Rive already supports artboard instancing for memory optimization, this feature request is specifically about reducing draw calls through GPU instancing, which is a different optimization technique.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the renderer's WebGL1 and WebGL2 paths and reviewing how existing artboard instancing is implemented. Measure current draw calls for repeated sprites, then define and validate batching or GPU instancing for matching artboards, animation state, and materials, including the WebGL1 fallback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100