HTML-in-Canvas
Join Beta
⚠️Required configuration: Ensure you run Chrome Canary or Dev and enable chrome://flags/#canvas-draw-element for native browser APIs.

WebGL & WebGPU Integration

Harness low-level shader processing to map real-time DOM components directly inside 3D mesh vectors.

1. WebGL Texture Binding

Bind standard HTML layout subtrees directly inside 2D shader textures using texElementImage2D:

canvas.onpaint = () => {
  if (gl.texElementImage2D) {
    gl.texElementImage2D(
      gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, myHtmlNode
    );
  }
};

2. WebGPU Texture Copying

WebGPU handles subtrees directly via queue transfers with `copyElementImageToTexture`:

canvas.onpaint = () => {
  device.queue.copyElementImageToTexture(
    myHtmlNode,
    { texture: myGpuTexture }
  );
};

Specs & Contributions

Explore standard origin trials, PM/SE credits, and YouTube reference materials.

Read Spec Credits →