モダンなブラウザ上であれば、Three.jsはWebGLを使ってsceneを描画出来ます。古いブラウザ(特にInternet Explore 10以下)では、他の[link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers] (CSS2DRenderer, CSS3DRenderer, SVGRenderer)に後方互換する必要があるでしょう。さらに、特に [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] フォルダのファイルを使用している場合は、いくつかのpolyfillを含める必要がある可能性があります。
注意事項: もし古いブラウザをサポートする必要がないなら、WebGLRenderer以外を使うことはおすすめしません。というのも、他のrendererは遅い上に、サポートしている機能が少ないからです。
Google Chrome 9以上、Firefox 4以上、Opera 15以上、Safari 5.1以上、Internet Explore 11以上、もしくはMicrosoft Edge。 どのブラウザがWebGLをサポートしているのかは[link:https://caniuse.com/#feat=webgl Can I use WebGL]を確認してください。
three.jsで使われる機能の中には追加のpolyfillsが必要になるものがあります。
機能 | スコープ | モジュール |
---|---|---|
Typed Arrays | Source | BufferAttribute, BufferGeometry, etc. |
Web Audio API | Source | Audio, AudioContext, AudioListener, etc. |
WebXR Device API | Source | WebXRManager |
Blob | Source | FileLoader, etc. |
Promise | Examples | GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc. |
Fetch | Examples | ImageBitmapLoader, etc. |
File API | Examples | GLTFExporter, etc. |
URL API | Examples | GLTFLoader, etc. |
Pointer Lock API | Examples | PointerLockControls |
要件に応じてポリフィルをインポートするだけです。例えば、IE9の場合は少なくとも以下の機能を追加する必要があります。