Failed to load 12K Panorama photo,Request help to solve, loading 5.7K is normal to read the image texture

extension Entity { func addPanoramicImage(for media: WRMedia) { let subscription=TextureResource.loadAsync(named:"image_20240425_201630").sink( receiveCompletion: { switch $0 { case .finished: break case .failure(let error): assertionFailure("(error)") } }, receiveValue: { [weak self] texture in guard let self = self else { return } var material = UnlitMaterial() material.color = .init(texture: .init(texture)) self.components.set(ModelComponent( mesh: .generateSphere(radius: 1E3), materials: [material] )) self.scale *= .init(x: -1, y: 1, z: 1) self.transform.translation += SIMD3<Float>(0.0, -1, 0.0) } ) components.set(Entity.WRSubscribeComponent(subscription: subscription)) }

problem:

case .failure(let error): assertionFailure("(error)")

Thread 1: Fatal error: Error Domain=MTKTextureLoaderErrorDomain Code=0 "Image decoding failed" UserInfo={NSLocalizedDescription=Image decoding failed, MTKTextureLoaderErrorKey=Image decoding failed}

Replies

5.7K is normal to read the image texture,but Not with a 12K panorama

Hello @big_white,

Does you also get this error on device, or is this only Simulator? As stated in Developing Metal apps that run in Simulator, "Simulator provides a device instance with capabilities similar to an Apple family 2 GPU". Apple family 2 GPU's support a maximum 2D texture width and height of 8192 pixels.