[Public WebGL] using the same context with multiple canvases

Aleksandar Rodic [email protected]
Mon Mar 23 10:26:34 PDT 2015


+1 because I've been struggling with this issue since early WebGL days.

Over time, I came up with few workarounds around this issue but they are
far from ideal and can be a huge performance bottleneck.


On Mon, Mar 23, 2015 at 12:07 AM Florian Bösch <[email protected]> wrote:

> The topic of how to draw to multiple canvases from a single context (from
> either the JS main thread or a worker) has not yet been resolved (correct
> me if I'm wrong).
>
> A possible resolution seems to be the canvas.setContext method. However,
> this seems to to be under specified, as just having a WebGL context is not
> sufficient, you also need a drawing buffer which carries attributes such as
> stencil, depth, bit-depth, MSAA, etc., and the WebGL 2 specification
> doesn't seem to contain anything about how to create either a WebGL 2
> context or a drawing buffer on its own (It just specifies that a getContext
> call needs to do both).
>
> Regardless of specification status or respective completeness, no
> implementation of setContext is available, let alone anything to create
> WebGL contexts and drawing buffers on their own to be used.
>
> I'll posit that this isn't an acceptable situation. I'll reiterate that
> quite frequently applications that do provide any kind of UI (like
> sketchfab, verold, goo, fabric) need to put WebGL driven content into many
> places inside that UI that isn't a single viewport. That content might find
> itself CSS transformed, composited, scrolled in/out of view, inside an
> overflow: scroll container, sandwiched between html elements etc. And that
> content might need to be updated at each animation frame.
>
> I'm frankly mystified why a topic we've been talking about for well over 3
> years and have been promised specifications/solutions for, that is widely
> recognized as an important issue to solve, is nearly unspecified and
> completely unsolved.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20150323/4957ab80/attachment.html>


More information about the public_webgl mailing list