Documentation
    Preparing search index...

    Function isWebgl2Supported

    • Whether this environment could run WebGL 2 at all (§62) — the cheap pre-filter "auto" uses before it builds anything.

      The check is the presence of the WebGL2RenderingContext global, read off globalThis because this package compiles without lib.dom (the canvas is described structurally by WebglCanvas, and so is this). Node, a worker without OffscreenCanvas, and a browser too old for WebGL 2 all answer false; every browser that can draw answers true.

      It deliberately does not touch the canvas. A canvas hands out one context per type, and a probe calling getContext("webgl2") with its own attributes would fix the attributes of the context WebglRenderer.initialize later acquires — silently turning antialias: true off. The real gate is that initialize, which already fails with RENDERER_INITIALIZATION_FAILED (§89) for a blocked GPU or a canvas that already holds another context, and whose failure "auto" recovers from by moving to §62's next backend. This probe only has to be right about "there is no point trying".

      Parameters

      Returns boolean