gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

SurfaceContainer

Open gre opened this issue 8 years ago • 1 comments
trafficstars

more than ~12 simultaneous canvas doesn't work in web, WebGL don't allow that.

One idea to workaround that is to implement a <SurfaceContainer>, a super surface, that discovers all the underlying Surfaces, and position an absolute canvas that render them all.. we can use "gl scissor" for that. inspiration from the library multi-regl.

  • <SurfaceContainer> <div> ... </div> <Surface>...</Surface> ... </SurfaceContainer>
  • <SurfaceContainer> will use getBoundClientRect (i think at 60fps?) (to check its bounds, and all surface bounds, and redraw if any visible rect changes)

Another approach to fix that was https://github.com/gre/gl-react-dom-static-container (we should probably try to port that to v3 too, but not a priority for now) both approach have pros and cons. both are not so easy to implement right.

when this is implemented, we should try to implement something like that multiple hearts images example.

gre avatar Dec 07 '16 11:12 gre

this probably shouldn't be built-in in gl-react but there will be a lib that would solve that per platform on top of gl-react-dom but mimic the same api?

gre avatar Jul 07 '17 08:07 gre