I am experiencing a problem with my code that renders a static bitmap in three js. It was working fine in version 110 but stopped working in version 147. I have checked the changelog to see if there were any differences but couldn't find anything.
The data I am passing to the method is a simple array of integer values representing grey-scale bitmap pixels:
data.length === width*height
and 0 < data[i] < 255
renderBitmap(data: Uint8Array, width: number, height: number): void {
const camera = new PerspectiveCamera(45, width / height, 0.1, 10000);
const texture = new DataTexture(data, width, height, LuminanceFormat);
texture.flipY = true;
const material = new MeshBasicMaterial({ map: texture });
const geometry = new PlaneGeometry(width, height);
const plane = new Mesh(geometry, material);
this._dispose(ImageDataIdentifier.BITMAP);
this.scene.add(plane);
camera.position.z = width / (2 * Math.tan(MathUtils.degToRad(camera.fov / 2))) / camera.aspect;
this.renderer.setSize(width, height);
this.renderer.render(this.scene, camera);
}