Skip to content

[p5.js 2.0+ Bug Report]: Can't draw webcam to canvas in WebGPU mode #9357

Closed

Description

@davepagurek

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

Latest RC

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

With this code:

let capture;

async function setup() {
  await createCanvas(400, 400, WEBGPU);
  capture = createCapture(VIDEO);
  capture.hide();
}

function draw() {
  background(220);
  imageMode(CENTER);
  image(capture, 0, 0, width, height);
}

Live: https://editor.p5js.org/davepagurek/sketches/jAyBm6v0B

...I get this error:

TypeError: GPUQueue.copyExternalImageToTexture: 'source' member of GPUCopyExternalImageSourceInfo could not be converted to any of: ImageBitmap, HTMLImageElement, HTMLCanvasElement, OffscreenCanvas.

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions