rive-wasm icon indicating copy to clipboard operation
rive-wasm copied to clipboard

Why rive trying to call webgl2 and webgl in canvas-lite package?

Open smnfox opened this issue 1 year ago • 1 comments

Description

I use canvas-lite package and when creating new Rive instance at first it trying to use webgl context

Provide a Repro

Small example https://codepen.io/Nadezhda-Trenogina/pen/yLWJvoK?editors=1111 Click "run" and alert will be shown with called context type. And there is webgl2 and webgl, only in the end will be 2d

Expected behavior

For package canvas-lite i expected only 2d context to be used

Screenshots

image

Browser & Versions (please complete the following information)

  • Browser: Chrome 123
  • OS: macOS 13.1

Additional context

Reproduced on every my device. I saw this behaviour when tried to debug problem on old android device, that doesn`t work correctly with webgl and immediately shows error instead of animation. Now i am confused why it works this way

If described behavior is correct and there is no bug, then maybe i can somehow choose what context i want to use to avoid webgl?

smnfox avatar May 23 '24 12:05 smnfox

I also ran into this, had to downgrade to 2.7.8. Appears to be happening from 2.7.9 up.

Possibly https://github.com/rive-app/rive-wasm/blob/6d5cd8909a635184f156be03d1f32d5ceb4025fc/wasm/js/renderer.js#L193

luckydye avatar Jun 23 '24 20:06 luckydye

Hi all, Rive web uses WebGL to draw image meshes for canvas.

Closing this issue as it's functionality we depend on.

HayesGordon avatar Aug 12 '24 13:08 HayesGordon