Ah yeah - ok got it.
So, for completeness - if you’re using WebGL, this works:
// this isn't public API yet
let pixelData = await texture.read(0,0, width, height);
// this won't ever be public API but can work in typescript builds...
//let pixelData = await texture.impl.read(0,0, width, height);
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
let idata = new ImageData(new UInt8ClampedArray(data), width, height);
ctx.putImageData(idata, 0, 0);
let url = canvas.getDataURL();
let image = Image(width, height);
image.src = url;
Oh actually the function is called texture.downloadAsync(). This is what model-viewer used up until recently (on engine v1) to support png download.
If your PNG contains alpha you might want to consider using something else as safari might still destroy image by pre-multiplying (and then un-premultiplying) alpha during this process.
Yes, engine v2 has read() function that is cross-platform, but as you noticed, it’s not public yet as it only has support for a limited combination of input parameters.
But you should be able to call it regardless, even when not exposed?