2. WebGL Browser Compatibility

Unity WebGL在某种程度上支持所有主流桌面浏览器。但是,不同浏览器之间的支持级别和预期性能会有所不同。请参阅下表,了解Unity WebGL内容支持的浏览器功能以及哪些浏览器支持它们。

注意:
移动设备目前不支持Unity WebGL内容。它可能仍然有效,尤其是在高端设备上,但许多现有设备功能不够强大,没有足够的内存来支持Unity WebGL内容。出于这个原因,Unity WebGL在尝试在移动浏览器上加载内容时会显示一条警告消息(如果需要,可以禁用它)。

请注意,此兼容性表格对所述浏览器的特定版本有效,如上所述。对于未来的版本,应该继续支持,但在以前的版本中可能不稳定。

桌面浏览器兼容性表

浏览器 Mozilla Firefox 52 Google Chrome 57 Apple Safari 11 MS Edge 16
WebGL Support Yes Yes Yes Yes
Web Audio Web Audio Web Audio API需要在Unity WebGL内容中播放声音。 Yes Yes Yes Yes
全屏支持 Full-screen support Yes Yes Yes Yes
光标锁定支持 Cursor locking support Yes Yes Yes Yes
游戏手柄支持 Gamepad support Yes Yes Yes Yes
IndexedDB 数据缓存功能使用的本地存储对 PlayerPrefs类,和WWW.LoadFromCacheOrDownload是必需的 Yes
Firefox版本42不支持在iFrame中运行的内容的IndexedDB。 Firefox 43和更高版本解决了这个问题。
Yes Yes
Safari不支持在iFrame中运行的内容的IndexedDB。
Yes
WebSockets Networking 所要求的 Yes Yes Yes Yes
WebRTC WebCamTexture类所要求的。 Yes Yes No Yes
WebGL 2.0 WebGL 2.0 Yes Firefox 51 and newer YesChrome 56 and newer No No
asm.js AOT compilation asm.js是浏览器可以针对其进行特别优化的JavaScript代码。实现asm.js支持的浏览器可以更快地运行Unity WebGL内容,因为Unity使用asm.js. Yes No No Yes
WebAssembly WebAssembly或wasm是一种适用于编译到Web的新的便携式,大小高效且加载时间高效的格式。 Yes Firefox 52 and newer. Yes Chrome 57 and newer. Yes Safari 11 or newer Yes Edge 16 or newer
Large-Allocation Http header 帮助浏览器确保有足够的内存可用于加载您的内容,查阅 Large-Allocation Http Header Yes Firefox 53 and newer. No No No
Brotli Compression (Brotli压缩) 减少构建大小 查阅 Brotli Compression Yes Yes No Yes

Notes

  • Chrome可能需要大量内存来解析生成的JavaScript代码,这会在32位浏览器上加载内容时导致内存不足错误或崩溃。有关内存使用的更多信息,请参阅 Memory Considerations (内存注意事项)
2

Unity WebGL 中文文档 Unity 2018.1.b
1. WebGL
2. webGL Browser Compatibility
3. Building and running a WebGL project
4. WebGL: Deploying compressed builds
5. Debugging and trouble shooting WebGL builds
6. WebGL Graphics
7. WebGL Networking
8. Using Audio In WebGL
9. WebGL performance considerations
10. WebGL: Interacting with browser scripting
11. Using WebGL Templates
12. Cursor locking and full-screen mode in WebGL
13. Input in WebGL

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,982评论 19 139
  • 首先附上原文链接:https://unity3d.com/learn/tutorials/topics/best-...
    Bonging阅读 1,226评论 0 0
  • 翻译:莫铭原文地址:AssetBundle usage patterns 本系列中的上一篇文章覆盖了AssetBu...
    莫铭阅读 5,386评论 1 12
  • 翻译自官网文档:https://unity3d.com/cn/learn/tutorials/topics/bes...
    su9257_海澜阅读 3,417评论 1 2
  • 又是一年综测时,本以为自己可以拿个励志奖学金的,不料被各种加分挤下去了,不得不说还是有点遗憾,本以为拿在手里的包子...
    Cai蔡_蔡Cai阅读 161评论 0 0