deepkolos / three-platformize

一个让 THREE 平台化的项目,目前已适配微信,淘宝,头条小程序,微信小游戏
533 stars 82 forks source link

`textureLoader.loadAsync` iOS真机无法加载材质 #21

Closed washanhanzi closed 3 years ago

washanhanzi commented 3 years ago

在开发者工具一切正常,但是真机无法加载,已配置合法域名。

 try {
      texture1 = await textureLoader.loadAsync("https://xxxx/result-0.jpg")
    } catch (err) {
      wx.showToast({
        title: "加载失败",
        icon: "error",
        duration: 2000
      })
      wx.getRealtimeLogManager().error(err)
    }

catch到的error没看懂。。

[00:07:35]  {"timestamp":8743946.552416667,"type":"error","target":{"bindingScreen":0,"scale":1,"naturalWidth":5760,"complete":false,"naturalHeight":3240,"height":3240,"premultiplyAlpha":true,"width":5760,"instance":10761289472,"tagName":"IMG","nodeName":"IMG","uid":10761289472,"src":"https://xxxx/result-0.jpg","crossOrigin":"anonymous"},"currentTarget":{"bindingScreen":0,"scale":1,"naturalWidth":5760,"complete":false,"naturalHeight":3240,"height":3240,"premultiplyAlpha":true,"width":5760,"instance":10761289472,"tagName":"IMG","nodeName":"IMG","uid":10761289472,"src":"https://xxxx/result-0.jpg","crossOrigin":"anonymous"}}
washanhanzi commented 3 years ago

好像材质太大了。。换了个小的可以了。

deepkolos commented 3 years ago

微信小程序不支持加载2048以上的图片