Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add document for browser support #12796

Merged
merged 3 commits into from Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/list.js
Expand Up @@ -5,6 +5,7 @@ var list = {
"Getting Started": {
"Creating a scene": "manual/introduction/Creating-a-scene",
"Import via modules": "manual/introduction/Import-via-modules",
"Browser support": "manual/introduction/Browser-support",
"WebGL compatibility check": "manual/introduction/WebGL-compatibility-check",
"How to run things locally": "manual/introduction/How-to-run-thing-locally",
"Drawing Lines": "manual/introduction/Drawing-lines",
Expand Down
123 changes: 123 additions & 0 deletions docs/manual/introduction/Browser-support.html
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>

<h2>Overview</h2>
<div>
<p>
Three.js can use WebGL to render your scenes on all modern browsers. For older browsers, especially Internet Explorer 10 and below, you may have to fallback to one of the other [link:https://github.com/mrdoob/three.js/tree/master/examples/js/renderers renderers] (CSS2DRenderer, CSS3DRenderer, SVGRenderer, CanvasRenderer). Additionally, you may have to include some polyfills, especially if you are using files from the [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] folder.
</p>
<p>
Note: if you don't need to support these old browsers, then it is not recommended to use the other renderers as they are slower and support less features than the WebGLRenderer.
</p>
</div>

<h2>Browsers that support WebGL</h2>
<div>
<p>
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 and Microsoft Edge. You can find which browsers support WebGL at [link:https://caniuse.com/#feat=webgl Can I use WebGL].
</p>
</div>

<h2>JavaScript Language Features or Web APIs Used in three.js</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I do not think this section provides sufficiently-valuable information, and it can be removed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I agree. I think it's a good start and we can complete it over time. I think this is good information for new people to start grasping how the library works.

<div>
<p>
Here are some features used in three.js. Some of them may require additional polyfills.
</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Use Scope</th>
<th>Modules</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebVR API</td>
<td>Source</td>
<td>WebVRManager, etc.</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, GLTF2Loader, WebVR, VREffect, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>

<h2>Polyfills</h2>
<div>
<p>Just import polyfills based on your requirements. Taking IE9 as an example, you need to polyfill at least these features:</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>

<h3>Suggested polyfills</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/page.js
Expand Up @@ -63,7 +63,7 @@ function onDocumentLoad( event ) {
text = text.replace( /\[(?:member|property|method):([\w]+) ([\w\.\s]+)\]/gi, "<a onclick=\"window.parent.setUrlFragment('" + name + ".$2')\" target=\"_parent\" title=\"" + name + ".$2\" class=\"permalink\">#</a> .<a onclick=\"window.parent.setUrlFragment('$1')\" title=\"$1\" id=\"$2\">$2</a> " );

text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_]+)\]/gi, "[link:$1 $1]" ); // [link:url] to [link:url title]
text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\#]+) ([\w|\:|\/|\.|\-|\_|\s]+)\]/gi, "<a href=\"$1\" target=\"_blank\">$2</a>" ); // [link:url title]
text = text.replace( /\[link:([\w|\:|\/|\.|\-|\_|\(|\)|\#|\=]+) ([\w|\:|\/|\.|\-|\_|\s]+)\]/gi, "<a href=\"$1\" target=\"_blank\">$2</a>" ); // [link:url title]
text = text.replace( /\*([\w|\d|\"|\-|\(][\w|\d|\ |\-|\/|\+|\-|\(|\)|\=|\,|\.\"]*[\w|\d|\"|\)]|\w)\*/gi, "<strong>$1</strong>" ); // *

text = text.replace( /\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
Expand Down