浏览器支持([name])
总览
在所有现代浏览器中,Verge3D可以使用WebGL来渲染场景。对于较旧的浏览器,特别是Internet Explorer 10或者更低版本浏览器,你将需要回落到其它[link:https://github.com/mrdoob/three.js/tree/master/examples/js/renderers renderers](CSS2DRenderer、CSS3DRenderer、SVGRenderer)。此外,你或许不得不包含一些额外的“填充物”来解决兼容性问题,特别是当你使用[link:https://github.com/mrdoob/three.js/tree/master/examples /examples]目录中的文件时。
注意:如果你并不需要支持较旧的浏览器,那就不推荐使用其他渲染器来进行渲染,因为与WebGLRenderer相比,其它渲染器渲染较慢,并且不支持WebGL的诸多特性。
支持WebGL的浏览器
Google Chrome 9+、Firefox 4+、Opera 15+、Safari 5.1+、Internet Explorer 11 和 Microsoft Edge。你可以点击[link:https://caniuse.com/#feat=webgl Can I use WebGL]来查阅各个浏览器对WebGL的支持性。
在Verge3D中所使用到的JavaScript语言特性或者Web API
这里是一些在Verge3D中使用到的特性,其中的一部分需要额外的“填充物”(Polyfills)来解决兼容性问题。
特性 | 适用范围 | 模块 |
---|---|---|
Typed Arrays | Source | BufferAttribute, BufferGeometry, etc. |
Web Audio API | Source | Audio, AudioContext, AudioListener, etc. |
WebVR API | Source | WebVRManager, etc. |
Blob | Source | FileLoader, etc. |
Promise | Examples | GLTFLoader, GLTFExporter, WebVR, VREffect, etc. |
Fetch | Examples | ImageBitmapLoader, etc. |
File API | Examples | GLTFExporter, etc. |
URL API | Examples | GLTFLoader, etc. |
Pointer Lock API | Examples | PointerLockControls |
关于用于解决兼容性问题的“填充物”
根据你的需求,引入相关的“填充物”即可。以IE9为例,你至少需要来使用“填充物”完成以下的功能。
- Typed Arrays
- Blob
建议的“填充物”
- [link:https://github.com/zloirock/core-js core-js]
- [link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
- [link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
- [link:https://github.com/eligrey/Blob.js Blob.js]
- [link:https://github.com/github/fetch fetch]