Phaser AE

WebGL2 backend

Free packv3.0.0-82D and 3DRenderers

The WebGL2 half of the renderer. Your game rarely names it: the automatic renderer falls back to it on devices without WebGPU, and the game draws the same, from the same code, minus a short and documented list of features.

This is a Free pack. Every phaser.io account can use it in their games.

Released October 14, 2026 · updated October 20, 2026

WebGL2 backend: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

What it does

It owns the WebGL2 context, the kernel's texture atlas, the scene's colour and depth textures, the sprite batches and presenting each frame. Sprites go up as instances with the same 22-float layout, the same run splitting and the same blend table as the WebGPU backend, so draw calls are added only where blend modes, deforms or textures change. Big pictures kept out of the atlas get textures of their own, uploaded once with mipmaps. Other packs (the UI, text, vectors, lighting, backdrops, post effects and the 3D stack) own their WebGL passes, and every pack reads the same scene data on either backend.

Two details keep the backends matched. An edge that lies exactly on a row of pixel centres falls on the same side as it does on WebGPU, for every program compiled through the kernel, even though WebGL rasterises y-up and WebGPU y-down. And shaders: the built-in ones have GLSL implementations, while custom backdrop, post and deform snippets, written once in WGSL, go through the wgsl-glsl translator, which throws on anything it cannot translate rather than drawing a silent black pass.

GPU particle simulation runs on WebGL2 transform feedback. Resources are released when the game is disposed and rebuilt after a lost context.

Features

  • Same game, same calls — the worlds, the look columns and the game APIs work as they do on WebGPU.
  • Batched sprites — one instance layout and run splitting shared with WebGPU, in sorted order.
  • Big pictures — textures of their own with mipmaps, beside the shared atlas.
  • Translated effect shaders — custom WGSL snippets become GLSL, and unsupported ones fail loudly.
  • Matched rasterisation — edges on pixel centres fall the same way as on WebGPU.
  • GPU particles — simulated with transform feedback.
  • Screenshots — the screenshot command works here too.
  • Diagnostics — game.gl reports ready, drawCalls, instances and missing, the custom drawers that have no WebGL2 path.
  • Context loss — resources rebuilt after the context is lost.

Good for

  • Reaching older browsers — Safari and Firefox without WebGPU, through render-auto, with no change to the game.
  • Testing the fallback — composing it alone, or game.renderer.prefer('webgl2') under render-auto, shows exactly what those players see.
  • WebGL2-only builds — a build that should never try WebGPU.
  • Pack authors — ctx.backend.webgl2 gives a custom drawer the context, the atlas and the scene framebuffer, and game.gl.missing says when a drawer has no WebGL2 path.

Make it yours

There are no options: screen size, fit, background and pixel-art filtering come from the manifest's screen. The choice is how you reach it. Nearly every game lets render-auto fall back to it on devices without WebGPU and never names it. A build or test that should use WebGL2 alone composes render-webgl2 in place of render-webgpu. Packs that draw for themselves add a drawGl beside their WebGPU drawer, and use GlDepthCopy for a pass that reads depth.

A quick look

A manifest that uses WebGL2 alone:

{ "packs": [{ "id": "render-webgl2" }, { "id": "world-topdown" }, { "id": "world-screen" }] }

Works with

Good to know

  • No screen recording; screenshots work.
  • With render-3d, one directional shadow map instead of cascades, and at most eight local lights.
  • skymax and watermax are not available.
  • The shared scene target is single-sampled, and a picture larger than the context's MAX_TEXTURE_SIZE is reported once and not drawn.
  • Quality, precision and speed can differ from WebGPU, so check a game on a real GPU on both.

More Renderers packs

Show all →