【问题标题】:Aframe resolution drops on mobile when exiting VR-mode退出 VR 模式时,移动设备上的 Aframe 分辨率下降
【发布时间】:2018-06-28 16:01:22
【问题描述】:

当从 VR 模式切换回“普通”模式时,帧场景的分辨率会从大约全高清急剧下降到大约 360p。

不确定这是 Aframe、Three.js 还是一般 WebVR 问题的核心,但似乎每个 AFRAME 应用程序都会出现这种情况,但其他 WebVR 应用程序不会出现这种情况。在以下提到的 Android 设备以及至少一部其他 Android 手机和一部 iphone 上会遇到此问题,但在桌面浏览器上不会遇到此问题。

Image when entered into VR mode: resolution is 1820x1080

Image when exited VR mode: resolution changed to 640x360

请注意,上述分辨率是通过以下方式获得的: AFRAME.scenes[0].renderer.getSize().width + "," + AFRAME.scenes[0].renderer.getSize().height + ", canvas: " + AFRAME.scenes[0].canvas.width + "," + AFRAME.scenes[0].canvas.height

虽然这个问题一直发生在我身上,但我在网上找不到任何提及。欢迎任何建议(以及确认或拒绝)!

设备信息 AFRAME: 0.8.2 Browsers: Firefox and Chrome for android Phone: Huawei P10 lite Android: 7.0 (Nougat)

【问题讨论】:

标签: three.js aframe webvr


【解决方案1】:

在这里找到我的解决方案; https://github.com/aframevr/aframe/issues/3592 似乎类似于@Tostifrosti 在同一个 repo 的 issue 3354 中的解决方案(尽管该解决方案不涉及更改 aframe 库中的代码)。

解决方案是在line 479 in a-scene.js之后添加以下行

this.renderer.setPixelRatio(window.devicePixelRatio);

【讨论】:

  • 虽然该链接下的内容可能有用,但最好将解决方案的重要和相关部分粘贴到此处,以防目标站点无法访问。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-26
  • 1970-01-01
  • 2017-09-14
  • 1970-01-01
  • 2019-02-23
  • 1970-01-01
相关资源
最近更新 更多