I have a webgl
<canvas> element and would like to use it as a texture in three.js.
I was unable to get it working with
const texture = new THREE.CanvasTexture(canvas);
const texture = new THREE.TextureLoader().load(canvas.toDataURL())
Am I missing something or does CanvasTexture not work with webgl canvases?