[]RenderTexture类的getData()方法存在BUG,得到的像素值全部为透明!


let data: Uint8ClampedArray = new Uint8ClampedArray(this.renderTargetCamera.renderTarget.getData(0, 0, 1024, 1024));
let imageData: ImageData = new ImageData(data, 1024, 1024);
let canvas: HTMLCanvasElement = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 1024;
let context: CanvasRenderingContext2D = canvas.getContext("2d");
context.putImageData(imageData, 1024, 1024);
let img: HTMLImageElement = new Image();
img.src = canvas.toDataURL("image/png");
 
已邀请:

qian

赞同来自:

你可以写一个demo传一下么

要回复问题请先

商务合作
商务合作