You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Findings from benchmark-shader-solutions (same animated shader built with raw WebGL, gl-react, Skia, WebGPU, native…).
Web: gl-react is close to raw WebGL but pays everywhere: +5.7 pts CPU, 2× JS heap, slower first frame, +38 kB gzip vs +4 kB, and a global shim needed in Vite. React Native: tied to Expo / expo-gl (OpenGL ES), blocks the JS thread every frame, no pixel-ratio control, MSAA always on, heaviest setup of all solutions.
Directions (big picture)
Animate without React re-renders. Uniforms that are read at draw time (functions, refs, or shared values on RN), plus a single Surface loop. React describes the graph; it doesn't drive every frame.
Compile the graph once, execute cheaply per frame. A flat draw plan built at commit time, executed per frame without allocations. Replace gl-shader with a thin internal layer.
Slim, modern package. Drop legacy deps (gl-shader, ndarray, typedarray-pool, raf, prop-types…), ship ESM, globalThis, no bundler config needed.
Rethink the React Native backend. Short term: expose pixel ratio and MSAA in gl-react-expo. Longer term: move off Expo/OpenGL ES, e.g. run the draw plan on the UI thread / another GPU backend.
Surface ergonomics. Auto-sizing, pixelRatio everywhere, context-loss handling.
Next step: a benchmark page in the repo to profile where the overhead actually comes from, then prototype 1 and 2.
Activity