Browse Source

Merge branch 'dev' into toonMap

Takahiro 8 years ago
parent
commit
5b70fa6547
100 changed files with 4662 additions and 1408 deletions
  1. 3 3
      .github/ISSUE_TEMPLATE.md
  2. 6 3
      README.md
  3. 10 79
      build/three.js
  4. 0 0
      build/three.js.map
  5. 339 338
      build/three.min.js
  6. 3 76
      build/three.modules.js
  7. 0 0
      build/three.modules.js.map
  8. 132 0
      docs/api/animation/AnimationAction.html
  9. 87 0
      docs/api/animation/AnimationClip.html
  10. 102 0
      docs/api/animation/AnimationMixer.html
  11. 4 4
      docs/api/cameras/OrthographicCamera.html
  12. 15 8
      docs/api/cameras/PerspectiveCamera.html
  13. 65 0
      docs/api/cameras/StereoCamera.html
  14. 39 0
      docs/api/constants/Animation.html
  15. 37 21
      docs/api/constants/CustomBlendingEquations.html
  16. 0 31
      docs/api/constants/GLState.html
  17. 70 21
      docs/api/constants/Materials.html
  18. 78 0
      docs/api/constants/Renderer.html
  19. 0 24
      docs/api/constants/ShadowingTypes.html
  20. 226 51
      docs/api/constants/Textures.html
  21. 5 1
      docs/api/core/BufferAttribute.html
  22. 18 14
      docs/api/core/Clock.html
  23. 63 0
      docs/api/extras/CurveUtils.html
  24. 88 0
      docs/api/extras/ShapeUtils.html
  25. 2 2
      docs/api/extras/collada-animation/Animation.html
  26. 2 2
      docs/api/extras/collada-animation/AnimationHandler.html
  27. 2 2
      docs/api/extras/collada-animation/KeyFrameAnimation.html
  28. 32 0
      docs/api/extras/core/Font.html
  29. 75 0
      docs/api/extras/helpers/SkeletonHelper.html
  30. 1 1
      docs/api/geometries/ConeBufferGeometry.html
  31. 1 1
      docs/api/geometries/ConeGeometry.html
  32. 57 0
      docs/api/geometries/EdgesGeometry.html
  33. 1 1
      docs/api/geometries/ExtrudeGeometry.html
  34. 71 0
      docs/api/geometries/ShapeBufferGeometry.html
  35. 15 39
      docs/api/geometries/ShapeGeometry.html
  36. 63 0
      docs/api/geometries/WireframeGeometry.html
  37. 1 1
      docs/api/loaders/Cache.html
  38. 0 0
      docs/api/loaders/FileLoader.html
  39. 98 56
      docs/api/loaders/MTLLoader.html
  40. 1 1
      docs/api/loaders/OBJLoader.html
  41. 132 57
      docs/api/materials/Material.html
  42. 11 3
      docs/api/materials/MeshBasicMaterial.html
  43. 1 1
      docs/api/materials/MeshLambertMaterial.html
  44. 1 1
      docs/api/materials/MeshPhongMaterial.html
  45. 71 0
      docs/api/materials/MeshPhysicalMaterial.html
  46. 10 12
      docs/api/materials/MeshStandardMaterial.html
  47. 56 0
      docs/api/materials/ShadowMaterial.html
  48. 2 2
      docs/api/math/Box2.html
  49. 2 2
      docs/api/math/Box3.html
  50. 84 0
      docs/api/math/Interpolant.html
  51. 1 1
      docs/api/math/Line3.html
  52. 54 26
      docs/api/math/Math.html
  53. 70 0
      docs/api/math/Spherical.html
  54. 5 0
      docs/api/math/Vector3.html
  55. 87 0
      docs/api/math/interpolants/CubicInterpolant.html
  56. 87 0
      docs/api/math/interpolants/DiscreteInterpolant.html
  57. 87 0
      docs/api/math/interpolants/LinearInterpolant.html
  58. 87 0
      docs/api/math/interpolants/QuaternionLinearInterpolant.html
  59. 59 0
      docs/api/objects/Group.html
  60. 10 3
      docs/api/renderers/CanvasRenderer.html
  61. 293 164
      docs/api/renderers/WebGLRenderer.html
  62. 8 5
      docs/api/scenes/Fog.html
  63. 5 3
      docs/api/scenes/FogExp2.html
  64. 5 0
      docs/api/scenes/Scene.html
  65. 77 0
      docs/api/textures/CanvasTexture.html
  66. 41 17
      docs/api/textures/CompressedTexture.html
  67. 118 0
      docs/api/textures/DepthTexture.html
  68. 102 39
      docs/api/textures/Texture.html
  69. 100 0
      docs/api/textures/VideoTexture.html
  70. 43 13
      docs/list.js
  71. 40 9
      docs/scenes/js/geometry.js
  72. 1 1
      editor/index.html
  73. 1 1
      editor/js/Menubar.Examples.js
  74. 1 1
      editor/js/Menubar.File.js
  75. 1 1
      editor/js/libs/app/index.html
  76. 7 7
      editor/js/libs/tern-threejs/threejs.js
  77. 3 0
      examples/files.js
  78. 1 0
      examples/js/SkyShader.js
  79. 269 12
      examples/js/animation/CCDIKSolver.js
  80. 261 25
      examples/js/animation/MMDPhysics.js
  81. 1 1
      examples/js/controls/OrbitControls.js
  82. 209 35
      examples/js/effects/OutlineEffect.js
  83. 20 23
      examples/js/effects/VREffect.js
  84. 1 1
      examples/js/loaders/3MFLoader.js
  85. 1 1
      examples/js/loaders/AMFLoader.js
  86. 1 1
      examples/js/loaders/AWDLoader.js
  87. 1 1
      examples/js/loaders/AssimpJSONLoader.js
  88. 1 1
      examples/js/loaders/BVHLoader.js
  89. 1 1
      examples/js/loaders/BabylonLoader.js
  90. 2 2
      examples/js/loaders/BinaryLoader.js
  91. 1 1
      examples/js/loaders/ColladaLoader2.js
  92. 2 2
      examples/js/loaders/FBXLoader.js
  93. 5 5
      examples/js/loaders/GLTFLoader.js
  94. 1 1
      examples/js/loaders/HDRCubeTextureLoader.js
  95. 1 1
      examples/js/loaders/KMZLoader.js
  96. 1 1
      examples/js/loaders/MD2Loader.js
  97. 304 141
      examples/js/loaders/MMDLoader.js
  98. 1 1
      examples/js/loaders/MTLLoader.js
  99. 1 1
      examples/js/loaders/NRRDLoader.js
  100. 1 1
      examples/js/loaders/OBJLoader.js

+ 3 - 3
.github/ISSUE_TEMPLATE.md

@@ -1,12 +1,12 @@
-##### Description of the problem 
+(*** This section is for bug reports and feature requests only. This is NOT a help site. Do not ask help questions here. If you need help, please use stackoverflow. ***)
 
 
-(This is NOT a help site. Please read the guidelines above before posting.)
+##### Description of the problem 
 
 
 
 
 ##### Three.js version
 ##### Three.js version
 
 
 - [ ] Dev
 - [ ] Dev
-- [ ] r81
+- [ ] r82
 - [ ] ...
 - [ ] ...
 
 
 ##### Browser
 ##### Browser

+ 6 - 3
README.md

@@ -5,13 +5,16 @@ three.js
 
 
 The aim of the project is to create an easy to use, lightweight, 3D library. The library provides <canvas>, <svg>, CSS3D and WebGL renderers.
 The aim of the project is to create an easy to use, lightweight, 3D library. The library provides <canvas>, <svg>, CSS3D and WebGL renderers.
 
 
-[Examples](http://threejs.org/examples/) — [Documentation](http://threejs.org/docs/) — [Migrating](https://github.com/mrdoob/three.js/wiki/Migration) — [Help](http://stackoverflow.com/questions/tagged/three.js)
-
+[Examples](http://threejs.org/examples/) —
+[Documentation](http://threejs.org/docs/) —
+[Wiki](https://github.com/mrdoob/three.js/wiki) —
+[Migrating](https://github.com/mrdoob/three.js/wiki/Migration) —
+[Help](http://stackoverflow.com/questions/tagged/three.js)
 
 
 ### Usage ###
 ### Usage ###
 
 
 Download the [minified library](http://threejs.org/build/three.min.js) and include it in your html.
 Download the [minified library](http://threejs.org/build/three.min.js) and include it in your html.
-Alternatively see [how to build the library yourself](https://github.com/mrdoob/three.js/wiki/build.py,-or-how-to-generate-a-compressed-Three.js-file).
+Alternatively see [how to build the library yourself](https://github.com/mrdoob/three.js/wiki/Build-instructions).
 
 
 ```html
 ```html
 <script src="js/three.min.js"></script>
 <script src="js/three.min.js"></script>

File diff suppressed because it is too large
+ 10 - 79
build/three.js


File diff suppressed because it is too large
+ 0 - 0
build/three.js.map


File diff suppressed because it is too large
+ 339 - 338
build/three.min.js


File diff suppressed because it is too large
+ 3 - 76
build/three.modules.js


File diff suppressed because it is too large
+ 0 - 0
build/three.modules.js.map


+ 132 - 0
docs/api/animation/AnimationAction.html

@@ -0,0 +1,132 @@
+<!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>
+
+    <div class="desc">
+    An AnimationAction schedules clip playback on specific objects.
+    </div>
+
+
+    <h2>Constructor</h2>
+
+
+    <h3>[name]( [page:AnimationMixer mixer], [page:AnimationClip clip], [page:Object3D localRoot] )</h3>
+
+
+    <h2>Properties</h2>
+
+
+    <h3>[property:Number time]</h3>
+
+    <h3>[property:Number timeScale]</h3>
+
+    <h3>[property:Number weight]</h3>
+
+    <h3>[property:Number loop]</h3>
+
+    <h3>[property:Number repetitions]</h3>
+
+    <h3>[property:Boolean paused]</h3>
+
+    <h3>[property:Boolean enabled]</h3>
+
+    <h3>[property:Boolean clampWhenFinished]</h3>
+
+    <h3>[property:Boolean zeroSlopeAtStart]</h3>
+
+    <h3>[property:Boolean zeroSlopeAtEnd]</h3>
+
+
+    <h2>Methods</h2>
+
+
+    <h3>[method:AnimationAction play]()</h3>
+
+    <h3>[method:AnimationAction stop]()</h3>
+
+    <h3>[method:AnimationAction reset]()</h3>
+
+    <h3>[method:Boolean isRunning]()</h3>
+
+    <h3>[method:Boolean isScheduled]()</h3>
+
+    <h3>[method:AnimationAction startAt]()</h3>
+
+    <h3>[method:AnimationAction setLoop]( [page:Number mode], [page:Number repetitions] )</h3>
+
+    <h3>[method:AnimationAction setEffectiveWeight]( [page:Number weight] )</h3>
+
+    <h3>[method:number getEffectiveWeight]()</h3>
+
+    <h3>[method:AnimationAction fadeIn]( [page:Number duration] )</h3>
+
+    <h3>[method:AnimationAction fadeOut]( [page:Number duration] )</h3>
+
+    <h3>[method:AnimationAction crossFadeFrom]( [page:AnimationAction fadeOutAction], [page:Number duration], [page:Boolean warp] )</h3>
+
+    <h3>[method:AnimationAction crossFadeTo]( [page:AnimationAction fadeInAction], [page:Number duration], [page:Boolean warp] )</h3>
+
+    <h3>[method:AnimationAction stopFading]()</h3>
+
+    <h3>[method:AnimationAction setEffectiveTimeScale]( [page:Number timeScale] )</h3>
+
+    <h3>[method:Number getEffectiveTimeScale]()</h3>
+
+    <h3>[method:AnimationAction setDuration]( [page:Number duration] )</h3>
+
+    <h3>[method:AnimationAction syncWith]( [page:AnimationAction action] )</h3>
+
+    <h3>[method:AnimationAction halt]( [page:Number duration] )</h3>
+
+    <h3>[method:AnimationAction warp]( [page:Number startTimeScale], [page:Number endTimeScale], [page:Number duration] )</h3>
+
+    <h3>[method:AnimationAction stopWarping]()</h3>
+
+    <h3>[method:AnimationMixer getMixer]()</h3>
+
+    <h3>[method:AnimationClip getClip]()</h3>
+
+    <h3>[method:Object3D getRoot]()</h3>
+
+
+    <h2>Static Methods</h2>
+
+
+    <h3>[method:AnimationClip parse]( [page:Object json] )</h3>
+    <div>
+    json -- JSON object
+    </div>
+
+    <h3>[method:Object toJSON]( [page:AnimationClip clip] )</h3>
+    <div>
+    clip -- AnimationClip
+    </div>
+
+    <h3>[method:AnimationClip CreateFromMorphTargetSequence]( [page:String name], [page:Array morphTargetSequence], [page:Number fps], [page:Boolean noLoop] )</h3>
+    <div>
+    name -- Name for the new clip <br />
+    morphTargetSequence -- Array of morph targets <br />
+    fps -- Number of frames per second <br />
+    noLoop -- Whether looping occurs automatically.
+    </div>
+
+    <h3>[method:AnimationClip parseAnimation]( [page:Object animation], [page:Array bones] )</h3>
+    <div>
+    Parses the animation.hierarchy format and returns an AnimationClip.
+    </div>
+
+
+    <h2>Source</h2>
+
+
+    [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+  </body>
+</html>

+ 87 - 0
docs/api/animation/AnimationClip.html

@@ -0,0 +1,87 @@
+<!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>
+
+    <div class="desc">
+    An AnimationClip is a reusable set of Tracks that represent an animation.
+    </div>
+
+
+    <h2>Constructor</h2>
+
+
+    <h3>[name]( [page:String name], [page:Number duration], tracks )</h3>
+
+
+    <h2>Properties</h2>
+
+
+    <h3>[property:String uuid]</h3>
+
+    <h3>[property:String name]</h3>
+
+    <h3>[property:Number duration]</h3>
+
+    <h3>.tracks</h3>
+
+
+    <h2>Methods</h2>
+
+
+    <h3>[method:null resetDuration]()</h3>
+    <div>
+    Resets duration by scanning all tracks in the clip.
+    </div>
+
+    <h3>[method:AnimationClip trim]()</h3>
+    <div>
+    Trims all tracks to the clip's duration.
+    </div>
+
+    <h3>[method:AnimationClip optimize]()</h3>
+    <div>
+    Optimizes each track.
+    </div>
+
+
+    <h2>Static Methods</h2>
+
+
+    <h3>[method:AnimationClip parse]( [page:Object json] )</h3>
+    <div>
+    json -- JSON object
+    </div>
+
+    <h3>[method:Object toJSON]( [page:AnimationClip clip] )</h3>
+    <div>
+    clip -- AnimationClip
+    </div>
+
+    <h3>[method:AnimationClip CreateFromMorphTargetSequence]( [page:String name], [page:Array morphTargetSequence], [page:Number fps], [page:Boolean noLoop] )</h3>
+    <div>
+    name -- Name for the new clip <br />
+    morphTargetSequence -- Array of morph targets <br />
+    fps -- Number of frames per second <br />
+    noLoop -- Whether looping occurs automatically.
+    </div>
+
+    <h3>[method:AnimationClip parseAnimation]( [page:Object animation], [page:Array bones] )</h3>
+    <div>
+    Parses the animation.hierarchy format and returns an AnimationClip.
+    </div>
+
+
+    <h2>Source</h2>
+
+
+    [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+  </body>
+</html>

+ 102 - 0
docs/api/animation/AnimationMixer.html

@@ -0,0 +1,102 @@
+<!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>
+
+    <div class="desc">
+    The AnimationMixer is a player for AnimationClip objects.
+    </div>
+
+
+    <h2>Constructor</h2>
+
+
+    <h3>[name]( [page:Object3D root] )</h3>
+
+
+    <h2>Properties</h2>
+
+
+    <h3>[property:Number time]</h3>
+
+    <h3>[property:Number timeScale]</h3>
+
+
+    <h2>Methods</h2>
+
+
+    <h3>[method:AnimationAction clipAction]([page:AnimationClip clip], [page:Object3D optionalRoot])</h3>
+    <div>
+    clip -- AnimationClip <br />
+    optionalRoot -- Object3D
+    </div>
+    <div>
+    Return an action for a clip, optionally using a custom root target object.
+    </div>
+
+    <h3>[method:AnimationAction existingAction]([page:AnimationClip clip], [page:Object3D optionalRoot])</h3>
+    <div>
+    clip -- AnimationClip <br />
+    optionalRoot -- Object3D
+    </div>
+    <div>
+    Return an existing action.
+    </div>
+
+    <h3>[method:AnimationMixer stopAllAction]()</h3>
+    <div>
+    Deactivates all scheduled actions.
+    </div>
+
+    <h3>[method:AnimationMixer update]([page:Number deltaTimeMS]) </h3>
+    <div>
+    deltaTimeMS -- Time elapsed since last update in milliseconds.
+    </div>
+    <div>
+    Updates the animation with deltaTimeMS.
+    </div>
+
+    <h3>[method:Object3D getRoot]()</h3>
+    <div>
+    Return this mixer's root target object.
+    </div>
+
+    <h3>[method:null uncacheClip]([page:AnimationClip clip])</h3>
+    <div>
+    clip -- AnimationClip
+    </div>
+    <div>
+    Free all resources for a clip.
+    </div>
+
+    <h3>[method:null uncacheRoot]([page:Object3D root]) </h3>
+    <div>
+    root -- Object3D
+    </div>
+    <div>
+    Free all resources for a root target object.
+    </div>
+
+    <h3>[method:null uncacheAction]([page:AnimationClip clip], [page:Object3D optionalRoot])</h3>
+    <div>
+    clip -- AnimationClip <br />
+    optionalRoot -- Object3D
+    </div>
+    <div>
+    Free all resources for an action.
+    </div>
+
+
+    <h2>Source</h2>
+
+
+    [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+  </body>
+</html>

+ 4 - 4
docs/api/cameras/OrthographicCamera.html

@@ -51,7 +51,7 @@ scene.add( camera );</code>
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>[property:number zoom]</h3>
 		<h3>[property:number zoom]</h3>
-		<div>Gets or sets the zoom factor of the camera. </div>
+		<div>Gets or sets the zoom factor of the camera. Default is *1*.</div>
 
 
 		<h3>[property:Float left]</h3>
 		<h3>[property:Float left]</h3>
 		<div>Camera frustum left plane.</div>
 		<div>Camera frustum left plane.</div>
@@ -66,10 +66,10 @@ scene.add( camera );</code>
 		<div>Camera frustum bottom plane.</div>
 		<div>Camera frustum bottom plane.</div>
 
 
 		<h3>[property:Float near]</h3>
 		<h3>[property:Float near]</h3>
-		<div>Camera frustum near plane.</div>
+		<div>Camera frustum near plane. Default is *0.1*.</div>
 
 
 		<h3>[property:Float far]</h3>
 		<h3>[property:Float far]</h3>
-		<div>Camera frustum far plane.</div>
+		<div>Camera frustum far plane. Default is *2000*.</div>
 
 
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
@@ -101,7 +101,7 @@ scene.add( camera );</code>
 		<h3>[method:OrthographicCamera clone]()</h3>
 		<h3>[method:OrthographicCamera clone]()</h3>
 		<div>
 		<div>
 		<br />
 		<br />
-		It returns a clone of OrthographicCamera.
+		Returns a clone of the OrthographicCamera.
 		</div>
 		</div>
 
 
 
 

+ 15 - 8
docs/api/cameras/PerspectiveCamera.html

@@ -43,31 +43,38 @@ scene.add( camera );</code>
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>[property:Float fov]</h3>
 		<h3>[property:Float fov]</h3>
-		<div>Camera frustum vertical field of view, from bottom to top of view, in degrees.</div>
+		<div>Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is *50*.</div>
 
 
 		<h3>[property:number zoom]</h3>
 		<h3>[property:number zoom]</h3>
-		<div>Gets or sets the zoom factor of the camera. </div>
+		<div>Gets or sets the zoom factor of the camera. Default is *1*.</div>
 
 
 		<h3>[property:Float near]</h3>
 		<h3>[property:Float near]</h3>
-		<div>Camera frustum near plane.</div>
+		<div>Camera frustum near plane. Default is *0.1*.</div>
 
 
 		<h3>[property:Float far]</h3>
 		<h3>[property:Float far]</h3>
-		<div>Camera frustum far plane.</div>
+		<div>Camera frustum far plane. Default is *2000*.</div>
 
 
 		<h3>[property:Float focus]</h3>
 		<h3>[property:Float focus]</h3>
-		<div>Object distance used for stereoscopy and depth-of-field effects. This parameter does not influence the projection matrix unless a StereoCamera is being used.</div>
+		<div>Object distance used for stereoscopy and depth-of-field effects.
+			This parameter does not influence the projection matrix unless a StereoCamera is being used.
+			Default is *10*.
+		</div>
 
 
 		<h3>[property:Float aspect]</h3>
 		<h3>[property:Float aspect]</h3>
-		<div>Camera frustum aspect ratio, window width divided by window height.</div>
+		<div>Camera frustum aspect ratio, usually the canvas width / canvas height. Default is *1* (square canvas).</div>
 
 
 		<h3>[property:Object view]</h3>
 		<h3>[property:Object view]</h3>
-		<div>Frustum window specification or null.</div>
+		<div>
+			Frustum window specification or null.
+			This is set using the [page:PerspectiveCamera.setViewOffset .setViewOffset] method
+			and cleared using [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
+		</div>
 
 
 		<h3>[property:Float filmGauge]</h3>
 		<h3>[property:Float filmGauge]</h3>
 		<div>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</div>
 		<div>Film size used for the larger axis. Default is 35 (millimeters). This parameter does not influence the projection matrix unless .filmOffset is set to a nonzero value.</div>
 
 
 		<h3>[property:Float filmOffset]</h3>
 		<h3>[property:Float filmOffset]</h3>
-		<div>Horizontal off-center offset in the same unit as .filmGauge.</div>
+		<div>Horizontal off-center offset in the same unit as .filmGauge. Default is *0*.</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 

+ 65 - 0
docs/api/cameras/StereoCamera.html

@@ -0,0 +1,65 @@
+<!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>
+
+		<div class="desc">
+		Dual [page:PerspectiveCamera PerspectiveCamera]s used for effects such as
+		[link:https://en.wikipedia.org/wiki/Anaglyph_3D 3D Anaglyph] or [link:https://en.wikipedia.org/wiki/parallax_barrier Parallax Barrier].
+		</div>
+
+
+		<h2>Example</h2>
+
+		<div>[example:webgl_effects_anaglyph effects / anaglyph ]</div>
+		<div>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</div>
+		<div>[example:webgl_effects_stereo effects / stereo ]</div>
+
+		<div>
+		This class is used internally in the files<br /><br />
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/AnaglyphEffect.js examples/js/effects/AnaglyphEffect.js]<br /><br />
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/ParallaxBarrierEffect.js examples/js/effects/ParallaxBarrierEffect.js]<br /><br />
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/effects/StereoEffect.js examples/js/effects/StereoEffect.js]<br /><br />
+		used in the above examples.
+		</div>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( )</h3>
+
+		<h2>Properties</h2>
+
+		<h3>[property:Float aspect]</h3>
+		<div>Default is *1*.</div>
+
+		<h3>[property:Float eyeSep]</h3>
+		<div>Default is *0.064*.</div>
+
+		<h3>[property:PerspectiveCamera cameraL]</h3>
+		<div>Left camera.</div>
+
+		<h3>[property:PerspectiveCamera cameraR]</h3>
+		<div>Right camera.</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:null update]( camera )</h3>
+		<div>
+		Update the stereo cameras based on the camera passed in.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 39 - 0
docs/api/constants/Animation.html

@@ -0,0 +1,39 @@
+<!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>Animation Constants</h1>
+
+		<h2>Loop Modes</h2>
+    
+		<code>
+THREE.LoopOnce
+THREE.LoopRepeat
+THREE.LoopPingPong
+		</code>
+
+    <h2>Interpolation Modes</h2>
+    <code>
+THREE.InterpolateDiscrete
+THREE.InterpolateLinear
+THREE.InterpolateSmooth
+    </code>
+
+    <h2>Ending Modes</h2>
+    <code>
+THREE.ZeroCurvatureEnding
+THREE.ZeroSlopeEnding
+THREE.WrapAroundEnding
+    </code>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
+	</body>
+</html>

+ 37 - 21
docs/api/constants/CustomBlendingEquations.html

@@ -10,32 +10,48 @@
 	<body>
 	<body>
 		<h1>Custom Blending Equation Constants</h1>
 		<h1>Custom Blending Equation Constants</h1>
 
 
-		<h2>Equations</h2>
-		<div>
-		THREE.AddEquation<br />
-		THREE.SubtractEquation<br />
-		THREE.ReverseSubtractEquation<br />
-		THREE.MinEquation<br />
+
+		<h2>Example</h2>
+		<div>[example:webgl_materials_blending_custom materials / blending / custom ]</div>
+
+		<h2>Usage</h2>
+		These work with all material types. First set the material's blending mode to THREE.CustomBlending, then set the desired Blending Equation, Source Factor and Destination Factor.
+
+		<code>
+		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
+		material.blending = THREE.CustomBlending;
+		material.blendEquation = THREE.AddEquation; //default
+		material.blendSrc = THREE.SrcAlphaFactor; //default
+		material.blendDst = THREE.OneMinusDstAlphaFactor; //default
+		</code>
+
+		<h2>Blending Equations</h2>
+		<code>
+		THREE.AddEquation
+		THREE.SubtractEquation
+		THREE.ReverseSubtractEquation
+		THREE.MinEquation
 		THREE.MaxEquation
 		THREE.MaxEquation
-		</div>
+		</code>
 
 
-		<h2>Destination Factors</h2>
-		<div>
-		THREE.ZeroFactor<br />
-		THREE.OneFactor<br />
-		THREE.SrcColorFactor<br />
-		THREE.OneMinusSrcColorFactor<br />
-		THREE.SrcAlphaFactor<br />
-		THREE.OneMinusSrcAlphaFactor<br />
-		THREE.DstAlphaFactor<br />
+		<h2>Source Factors</h2>
+		<code>
+		THREE.ZeroFactor
+		THREE.OneFactor
+		THREE.SrcColorFactor
+		THREE.OneMinusSrcColorFactor
+		THREE.SrcAlphaFactor
+		THREE.OneMinusSrcAlphaFactor
+		THREE.DstAlphaFactor
 		THREE.OneMinusDstAlphaFactor
 		THREE.OneMinusDstAlphaFactor
-		</div>
+		THREE.DstColorFactor
+		THREE.OneMinusDstColorFactor
+		THREE.SrcAlphaSaturateFactor
+		</code>
 
 
-		<h2>Source Factors</h2>
+		<h2>Destination Factors</h2>
 		<div>
 		<div>
-		THREE.DstColorFactor<br />
-		THREE.OneMinusDstColorFactor<br />
-		THREE.SrcAlphaSaturateFactor
+			All of the Source Factors are valid as Destination Factors, except for <code>THREE.SrcAlphaSaturateFactor</code>
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 0 - 31
docs/api/constants/GLState.html

@@ -1,31 +0,0 @@
-<!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>GL State Constants</h1>
-
-		<h2>Cull Face</h2>
-		<div>
-		THREE.CullFaceNone<br />
-		THREE.CullFaceBack<br />
-		THREE.CullFaceFront<br />
-		THREE.CullFaceFrontBack
-		</div>
-
-		<h2>Front Face Direction</h2>
-		<div>
-		THREE.FrontFaceDirectionCW<br />
-		THREE.FrontFaceDirectionCCW<br />
-		</div>
-	
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
-	</body>
-</html>

+ 70 - 21
docs/api/constants/Materials.html

@@ -10,47 +10,96 @@
 	<body>
 	<body>
 		<h1>Material Constants</h1>
 		<h1>Material Constants</h1>
 
 
+		<div class="desc">
+		These constants define properties common to all material types,
+		with the exception of Texture Combine Operations which only apply to [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial].<br />
+		</div>
+
+
 		<h2>Side</h2>
 		<h2>Side</h2>
-		<div>
-		THREE.FrontSide<br />
-		THREE.BackSide<br />
+		<code>
+		THREE.FrontSide
+		THREE.BackSide
 		THREE.DoubleSide
 		THREE.DoubleSide
+		</code>
+		<div>
+		Defines which side of faces will be rendered - front, back or both.
+		Default is [page:Constant FrontSide].
 		</div>
 		</div>
 
 
+
 		<h2>Shading</h2>
 		<h2>Shading</h2>
+		<code>
+	  THREE.SmoothShading
+		THREE.FlatShading
+		</code>
 		<div>
 		<div>
-		THREE.FlatShading<br />
-		THREE.SmoothShading
+		[page:Constant SmoothShading] is the default and linearly interpolates color between vertices.<br />
+		[page:Constant FlatShading] uses the color of the first vertex for every pixel in a face.
 		</div>
 		</div>
 
 
 		<h2>Colors</h2>
 		<h2>Colors</h2>
-		<div>
-		THREE.NoColors<br />
-		THREE.FaceColors<br />
+		<code>
+		THREE.NoColors
+		THREE.FaceColors
 		THREE.VertexColors
 		THREE.VertexColors
+		</code>
+		<div>
+		[page:Constant NoColors] is the default and applies the material's color to all faces.<br />
+		[page:Constant FaceColors] colors faces according to each [page:Face3 Face3][property:Color color] value.<br />
+		[page:Constant VertexColors] colors faces according to each [page:Face3 Face3][property:Array vertexColors] value. This is an array of three [page:Color Color]s, one for each vertex in the face.<br />
+		See the [example:webgl_geometry_colors geometry / colors] example.
 		</div>
 		</div>
 
 
 		<h2>Blending Mode</h2>
 		<h2>Blending Mode</h2>
-		<div>
-		THREE.NoBlending<br />
-		THREE.NormalBlending<br />
-		THREE.AdditiveBlending<br />
-		THREE.SubtractiveBlending<br />
-		THREE.MultiplyBlending<br />
+		<code>
+		THREE.NoBlending
+		THREE.NormalBlending
+		THREE.AdditiveBlending
+		THREE.SubtractiveBlending
+		THREE.MultiplyBlending
 		THREE.CustomBlending
 		THREE.CustomBlending
+		</code>
+		<div>
+		These control the source and destination blending equations for the material's RGB and Alpha sent to the WebGLRenderer for use by WebGL.<br />
+		[page:Constant NormalBlending] is the default.<br />
+		Note that [page:Constant CustomBlending] must be set to use [page:CustomBlendingEquation Custom Blending Equations].<br />
+		See the [example:webgl_materials_blending materials / blending] example.<br />
 		</div>
 		</div>
 
 
 		<h2>Depth Mode</h2>
 		<h2>Depth Mode</h2>
-		<div>
-		THREE.NeverDepth<br />
-		THREE.AlwaysDepth<br />
-		THREE.LessDepth<br />
-		THREE.LessEqualDepth<br />
-		THREE.GreaterEqualDepth<br />
-		THREE.GreaterDepth<br />
+		<code>
+		THREE.NeverDepth
+		THREE.AlwaysDepth
+		THREE.LessDepth
+		THREE.LessEqualDepth
+		THREE.GreaterEqualDepth
+		THREE.GreaterDepth
 		THREE.NotEqualDepth
 		THREE.NotEqualDepth
+		</code>
+		<div>
+		Which depth function the material uses to compare incoming pixels Z-depth against the current Z-depth buffer value. If the result of the comparison is true, the pixel will be drawn.<br />
+		[page:Materials NeverDepth] will never return true.<br />
+		[page:Materials AlwaysDepth] will always return true.<br />
+		[page:Materials LessDepth] will return true if the incoming pixel Z-depth is less than the current buffer Z-depth.<br />
+		[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
+		[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
+		[page:Materials GreaterDepth] will return true if the incoming pixel Z-depth is greater than the current buffer Z-depth.<br />
+		[page:Materials NotEqualDepth] will return true if the incoming pixel Z-depth is equal to the current buffer Z-depth.<br />
 		</div>
 		</div>
 
 
+		<h2>Texture Combine Operations</h2>
+		<code>
+		THREE.MultiplyOperation
+		THREE.MixOperation
+		THREE.AddOperation
+		</code>
+		These define how the result of the surface's color is combined with the environment map (if present), for [page:MeshBasicMaterial.combine MeshBasicMaterial], [page:MeshLambertMaterial.combine MeshLambertMaterial] and [page:MeshPhongMaterial.combine MeshPhongMaterial]. <br />
+		[page:Constant MultiplyOperation] is the default and multiplies the environment map color with the surface color.<br />
+		[page:Constant MixOperation] uses reflectivity to blend between the two colors.<br />
+		[page:Constant AddOperation] adds the two colors.
+
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]

+ 78 - 0
docs/api/constants/Renderer.html

@@ -0,0 +1,78 @@
+<!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>WebGLRenderer Constants</h1>
+
+		<h2>Cull Face Modes</h2>
+		<code>
+		THREE.CullFaceNone
+		THREE.CullFaceBack
+		THREE.CullFaceFront
+		THREE.CullFaceFrontBack
+		</code>
+		<div>
+		These are used by the WebGLRenderer's [page:WebGLRenderer.setFaceCulling setFaceCulling] method.<br /><br />
+		[page:constant CullFaceNone] disables face culling.<br />
+		[page:constant CullFaceBack] culls back faces (default).<br />
+		[page:constant CullFaceFront] culls front faces.<br />
+		[page:constant CullFaceFrontBack] culls both front and back faces.
+		</div>
+
+		<h2>Front Face Direction</h2>
+		<code>
+		THREE.FrontFaceDirectionCW
+		THREE.FrontFaceDirectionCCW
+		</code>
+		<div>
+		These are used by the WebGLRenderer's [page:WebGLRenderer.setFaceCulling setFaceCulling] method.<br /><br />
+		[page:constant FrontFaceDirectionCW] sets the winding order for polygons to clockwise.<br />
+		[page:constant FrontFaceDirectionCW] sets the winding order for polygons to counter-clockwise (default).
+		</div>
+
+		<h2>Shadow Types</h2>
+		<code>
+		THREE.BasicShadowMap
+		THREE.PCFShadowMap
+		THREE.PCFSoftShadowMap
+		</code>
+		<div>
+		These define the WebGLRenderer's [page:WebGLRenderer.shadowMap.type shadowMap.type] property.<br /><br />
+
+		[page:constant BasicShadowMap] gives unfiltered shadow maps - fastest, but lowest quality.<br />
+		[page:constant PCFShadowMap] filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm (default).<br />
+		[page:constant PCFSoftShadowMap] filters shadow maps using the Percentage-Closer Soft Shadows (PCSS) algorithm.
+		</div>
+
+		<h2>Tone Mapping</h2>
+		<code>
+		THREE.NoToneMapping
+		THREE.LinearToneMapping
+		THREE.ReinhardToneMapping
+		THREE.Uncharted2ToneMapping
+		THREE.CineonToneMapping
+		</code>
+		<div>
+		These define the WebGLRenderer's [page:WebGLRenderer.toneMapping toneMapping] property.
+		This is used to approximate the appearance of high dynamic range (HDR) on the
+		low dynamic range medium of a standard computer monitor or mobile device's screen.<br /><br />
+
+		[page:constant NoToneMapping] disables tone mapping.<br />
+		[page:constant LinearToneMapping] is the default.<br /><br />
+
+		See the [example:webgl_tonemapping WebGL / tonemapping] example.
+
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
+	</body>
+</html>

+ 0 - 24
docs/api/constants/ShadowingTypes.html

@@ -1,24 +0,0 @@
-<!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>Shadowing Type Constants</h1>
-
-		<h2>Shadow Map</h2>
-		<div>
-		THREE.BasicShadowMap<br />
-		THREE.PCFShadowMap<br />
-		THREE.PCFSoftShadowMap
-		</div>
-	
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
-	</body>
-</html>

+ 226 - 51
docs/api/constants/Textures.html

@@ -10,83 +10,258 @@
 	<body>
 	<body>
 		<h1>Texture Constants</h1>
 		<h1>Texture Constants</h1>
 
 
-		<h2>Operations</h2>
-		<div>
-		THREE.MultiplyOperation<br />
-		THREE.MixOperation<br />
-		THREE.AddOperation
-		</div>
-
 		<h2>Mapping Modes</h2>
 		<h2>Mapping Modes</h2>
-		<div>
-		THREE.UVMapping<br />
-		THREE.CubeReflectionMapping<br />
-		THREE.CubeRefractionMapping<br />
-		THREE.EquirectangularReflectionMapping<br />
-		THREE.EquirectangularRefractionMapping<br />
+		<code>
+		THREE.UVMapping
+		THREE.CubeReflectionMapping
+		THREE.CubeRefractionMapping
+		THREE.EquirectangularReflectionMapping
+		THREE.EquirectangularRefractionMapping
 		THREE.SphericalReflectionMapping
 		THREE.SphericalReflectionMapping
+		THREE.CubeUVReflectionMapping
+		THREE.CubeUVRefractionMapping
+		</code>
+		<div>
+		These define the texture's mapping mode.<br />
+		[page:Constant UVMapping] is the default, and maps the texture using the mesh's UV coordinates.<br /><br />
+
+		The rest define environment mapping types.<br /><br />
+
+		[page:Constant CubeReflectionMapping] and [page:Constant CubeRefractionMapping] are for
+		use with a [page:CubeTexture CubeTexture], which is made up of six textures, one for each face of the cube.<br />
+		[page:Constant CubeReflectionMapping] is the default for a [page:CubeTexture CubeTexture]. <br /><br />
+
+		[page:Constant EquirectangularReflectionMapping] and [page:Constant EquirectangularRefractionMapping]
+		are for use with an equirectangular environment map.<br /><br />
+
+		[page:Constant SphericalReflectionMapping] is for use with a spherical reflection map.<br /><br />
+
+		See the [example:webgl_materials_envmaps materials / envmaps] example.
 		</div>
 		</div>
 
 
+
 		<h2>Wrapping Modes</h2>
 		<h2>Wrapping Modes</h2>
-		<div>
-		THREE.RepeatWrapping<br />
-		THREE.ClampToEdgeWrapping<br />
+		<code>
+		THREE.RepeatWrapping
+		THREE.ClampToEdgeWrapping
 		THREE.MirroredRepeatWrapping
 		THREE.MirroredRepeatWrapping
+		</code>
+		<div>
+		These define the texture's [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT] properties,
+		which define horizontal and vertical texture wrapping.<br /><br />
+
+		With [page:constant RepeatWrapping] the texture will simply repeat to infinity.<br /><br />
+
+		[page:constant ClampToEdgeWrapping] is the default.
+		The last pixel of the texture stretches to the edge of the mesh.<br /><br />
+
+		With [page:constant MirroredRepeatWrapping] the texture will repeats to infinity, mirroring on each repeat.<br />
 		</div>
 		</div>
 
 
-		<h2>Filters</h2>
+		<h2>Magnification Filters</h2>
+		<code>
+		THREE.NearestFilter
+		THREE.LinearFilter
+		</code>
 		<div>
 		<div>
-		THREE.NearestFilter<br />
-		THREE.NearestMipMapNearestFilter<br />
-		THREE.NearestMipMapLinearFilter<br />
-		THREE.LinearFilter<br />
-		THREE.LinearMipMapNearestFilter<br />
-		THREE.LinearMipMapLinearFilter
+		For use with a texture's [page:Texture.magFilter magFilter]	property,
+		these define the texture magnification function to be used when the pixel being textured maps to an
+		area less than or equal to one texture element (texel).<br /><br />
+
+		[page:constant NearestFilter] returns the value of the texture element that is nearest
+		(in Manhattan distance) to the specified texture coordinates.<br /><br />
+
+		[page:constant LinearFilter] is the default and returns the weighted average
+		of the four texture elements that are closest to the specified texture coordinates,
+		and can include items wrapped or repeated from other parts of a texture,
+		depending on the values of [page:Texture.wrapS wrapS] and [page:Texture.wrapT wrapT], and on the exact mapping.
 		</div>
 		</div>
 
 
-		<h2>Data Types</h2>
+		<h2>Minification Filters</h2>
+		<code>
+		THREE.NearestFilter
+		THREE.NearestMipMapNearestFilter
+		THREE.NearestMipMapLinearFilter
+		THREE.LinearFilter
+		THREE.LinearMipMapNearestFilter
+		THREE.LinearMipMapLinearFilter
+		</code>
 		<div>
 		<div>
-		THREE.UnsignedByteType<br />
-		THREE.ByteType<br />
-		THREE.ShortType<br />
-		THREE.UnsignedShortType<br />
-		THREE.IntType<br />
-		THREE.UnsignedIntType<br />
-		THREE.FloatType<br />
-		THREE.HalfFloatType
+		For use with a texture's [page:Texture.minFilter minFilter]	property, these define
+		the texture minifying function that is used whenever the pixel being textured maps
+		to an area greater than one texture element (texel).<br /><br />
+
+		In addition to [page:constant NearestFilter] and [page:constant LinearFilter],
+		the following four functions can be used for minification:<br /><br />
+
+		[page:constant NearestMipMapNearestFilter] chooses the mipmap that most closely
+		matches the size of the pixel being textured
+		and uses the [page:constant NearestFilter] criterion (the texel nearest to the
+		center of the pixel) to produce a texture value.<br /><br />
+
+		[page:constant NearestMipMapLinearFilter] chooses the two mipmaps that most closely
+		match the size of the pixel being textured and uses the [page:constant NearestFilter] criterion to produce
+		a texture value from each mipmap. The final texture value is a weighted average of those two values.<br /><br />
+
+		[page:constant LinearMipMapNearestFilter] chooses the mipmap that most closely matches
+		the size of the pixel being textured and uses the [page:constant LinearFilter] criterion
+		(a weighted average of the four texels that are closest to the center of the pixel)
+		to produce a texture value.<br /><br />
+
+		[page:constant LinearMipMapLinearFilter] is the default and chooses the two mipmaps
+		that most closely match the size of the pixel being textured and uses the [page:constant LinearFilter] criterion
+		to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.<br /><br />
+
+		See the [example:webgl_materials_texture_filters materials / texture / filters] example.
 		</div>
 		</div>
 
 
-		<h2>Pixel Types</h2>
-		<div>
-		THREE.UnsignedShort4444Type<br />
-		THREE.UnsignedShort5551Type<br />
+		<h2>Types</h2>
+		<code>
+		THREE.UnsignedByteType
+		THREE.ByteType
+		THREE.ShortType
+		THREE.UnsignedShortType
+		THREE.IntType
+		THREE.UnsignedIntType
+		THREE.FloatType
+		THREE.HalfFloatType
+		THREE.UnsignedShort4444Type
+		THREE.UnsignedShort5551Type
 		THREE.UnsignedShort565Type
 		THREE.UnsignedShort565Type
+		THREE.UnsignedInt248Type
+		</code>
+		<div>
+		For use with a texture's [page:Texture.type type]	property, which must correspond to the correct format. See below for details.<br /><br />
+
+		[page:constant UnsignedByteType] is the default.
 		</div>
 		</div>
 
 
-		<h2>Pixel Formats</h2>
-		<div>
-		THREE.AlphaFormat<br />
-		THREE.RGBFormat<br />
-		THREE.RGBAFormat<br />
-		THREE.LuminanceFormat<br />
-		THREE.LuminanceAlphaFormat<br />
+		<h2>Formats</h2>
+		<code>
+		THREE.AlphaFormat
+		THREE.RGBFormat
+		THREE.RGBAFormat
+		THREE.LuminanceFormat
+		THREE.LuminanceAlphaFormat
 		THREE.RGBEFormat
 		THREE.RGBEFormat
+		THREE.DepthFormat
+		THREE.DepthStencilFormat
+		</code>
+		<div>
+		For use with a texture's [page:Texture.format format]	property, these define
+		how elements of a 2d texture, or *texels*, are read by shaders.<br /><br />
+
+		[page:constant AlphaFormat] discards the red, green and blue components and reads just the alpha component.
+		The [page:Texture.type type] must be [page:constant UnsignedByteType].<br /><br />
+
+		[page:constant RGBFormat] discards the alpha components and reads the red, green and blue components.
+		The [page:Texture.type type] must be [page:constant UnsignedByteType] or [page:constant UnsignedShort565Type].<br /><br />
+
+		[page:constant RGBAFormat] is the default and reads the red, green, blue and alpha components.
+		The [page:Texture.type type] must be [page:constant UnsignedByteType], [page:constant UnsignedShort4444Type] or [page:constant THREE.UnsignedShort5551Type].<br /><br />
+
+		[page:constant LuminanceFormat] reads each element as a single luminance component.
+		 This is then converted to a floating point, clamped to the range [0,1], and then assembled
+		 into an RGBA element by placing the luminance value in the red, green and blue channels,
+		 and attaching 1.0 to the alpha channel. The [page:Texture.type type] must be [page:constant UnsignedByteType].<br /><br />
+
+		[page:constant LuminanceAlphaFormat] reads each element as a luminance/alpha double.
+		The same process occurs as for the [page:constant LuminanceFormat], except that the
+		alpha channel may have values other than *1.0*. The [page:Texture.type type] must be [page:constant UnsignedByteType].<br /><br />
+
+		[page:constant RGBEFormat] is identical to [page:constant RGBAFormat].<br /><br />
+
+		[page:constant DepthFormat] reads each element as a single depth value, converts it to floating point, and clamps to the range [0,1].
+		The [page:Texture.type type] must be [page:constant UnsignedIntType] or [page:constant UnsignedShortType].
+		This is the default for [page:DepthTexture DepthTexture].<br /><br />
+
+		[page:constant DepthStencilFormat] reads each element is a pair of depth and stencil values.
+		The depth component of the pair is interpreted as in [page:constant DepthFormat].
+		The stencil component is interpreted based on the depth + stencil internal format.
+		The [page:Texture.type type] must be [page:constant UnsignedInt248Type].<br /><br />
+
+		Note that the texture must have the correct [page:Texture.type type] set, as described above.
+		See <a href="https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext/texImage2D">this page</a> for details.
 		</div>
 		</div>
 
 
 		<h2>DDS / ST3C Compressed Texture Formats</h2>
 		<h2>DDS / ST3C Compressed Texture Formats</h2>
-		<div>
-		THREE.RGB_S3TC_DXT1_Format<br />
-		THREE.RGBA_S3TC_DXT1_Format<br />
-		THREE.RGBA_S3TC_DXT3_Format<br />
+		<code>
+		THREE.RGB_S3TC_DXT1_Format
+		THREE.RGBA_S3TC_DXT1_Format
+		THREE.RGBA_S3TC_DXT3_Format
 		THREE.RGBA_S3TC_DXT5_Format
 		THREE.RGBA_S3TC_DXT5_Format
+		</code>
+		<div>
+		For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format]	property,
+		these require support for the
+		<a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/">WEBGL_compressed_texture_s3tc</a>
+		extension. <br />
+		According to <a href="http://webglstats.com/">WebglStats</a>, as of February 2016
+		over 80% of WebGL enabled devices support this extension.<br /><br />
+
+		There are four <a href="https://en.wikipedia.org/wiki/S3_Texture_Compression">S3TC</a> formats available via this extension. These are:<br />
+		[page:constant RGB_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB image format.<br />
+		[page:constant RGBA_S3TC_DXT1_Format]: A DXT1-compressed image in an RGB image format with a simple on/off alpha value.<br />
+		[page:constant RGBA_S3TC_DXT3_Format]: A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.<br />
+		[page:constant RGBA_S3TC_DXT5_Format]: A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.<br />
 		</div>
 		</div>
 
 
 		<h2>PVRTC Compressed Texture Formats</h2>
 		<h2>PVRTC Compressed Texture Formats</h2>
-		<div>
-		THREE.RGB_PVRTC_4BPPV1_Format<br />
-		THREE.RGB_PVRTC_2BPPV1_Format<br />
-		THREE.RGBA_PVRTC_4BPPV1_Format<br />
+		<code>
+		THREE.RGB_PVRTC_4BPPV1_Format
+		THREE.RGB_PVRTC_2BPPV1_Format
+		THREE.RGBA_PVRTC_4BPPV1_Format
 		THREE.RGBA_PVRTC_2BPPV1_Format
 		THREE.RGBA_PVRTC_2BPPV1_Format
+		</code>
+		<div>
+		For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format]	property,
+		these require support for the <a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/">WEBGL_compressed_texture_pvrtc</a>
+		extension. <br />
+		According to <a href="http://webglstats.com/">WebglStats</a>, as of February 2016
+		less than 8% of WebGL enabled devices support this extenstion.
+		PVRTC is typically only available on mobile devices with PowerVR chipsets,
+		which are mainly Apple devices.<br /><br />
+
+		There are four <a href="https://en.wikipedia.org/wiki/PVRTC">PVRTC</a> formats available via this extension. These are:<br />
+		[page:constant RGB_PVRTC_4BPPV1_Format]: RGB compression in 4-bit mode. One block for each 4×4 pixels.<br />
+		[page:constant RGB_PVRTC_2BPPV1_Format]: RGB compression in 2-bit mode. One block for each 8×4 pixels.<br />
+		[page:constant RGBA_PVRTC_4BPPV1_Format]: RGBA compression in 4-bit mode. One block for each 4×4 pixels.<br />
+		[page:constant RGBA_PVRTC_2BPPV1_Format]: RGBA compression in 2-bit mode. One block for each 8×4 pixels.<br />
+		</div>
+
+		<h2>ETC Compressed Texture Format</h2>
+		<code>
+		THREE.RGB_ETC1_Format
+		</code>
+		<div>
+		For use with a [page:CompressedTexture CompressedTexture]'s [page:Texture.format format]	property,
+		these require support for the <a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/">WEBGL_compressed_texture_etc1</a>
+		extension. <br />
+		According to <a href="http://webglstats.com/">WebglStats</a>, as of February 2016
+		just over 13% of WebGL enabled devices support this extenstion.<br /><br />
+		</div>
+
+		<h2>Encoding</h2>
+		<code>
+		THREE.LinearEncoding
+		THREE.sRGBEncoding
+		THREE.GammaEncoding
+		THREE.RGBEEncoding
+		THREE.LogLuvEncoding
+		THREE.RGBM7Encoding
+		THREE.RGBM16Encoding
+		THREE.RGBDEncoding
+		THREE.BasicDepthPacking
+		THREE.RGBADepthPacking
+		</code>
+		<div>
+		For use with a Texture's [page:Texture.encoding encoding]	property.<br /><br />
+
+		If the encoding type is changed after the texture has already been used by a material,
+		you will need to set [page:Material.needsUpdate Material.needsUpdate] to *true* to make the material recompile.<br /><br />
+
+		[page:constant LinearEncoding] is the default.
+		Values other than this are only valid for a material's map, envMap and emissiveMap.
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 5 - 1
docs/api/core/BufferAttribute.html

@@ -18,7 +18,7 @@
 		<h3>[name]( [page:TypedArray array], [page:Integer itemSize], [page:Boolean normalized] )</h3>
 		<h3>[name]( [page:TypedArray array], [page:Integer itemSize], [page:Boolean normalized] )</h3>
 		<div>
 		<div>
 		Instantiates this attribute with data from the associated buffer.
 		Instantiates this attribute with data from the associated buffer.
-		itemSize gives the number of values of the array that should be associated with a particular vertex. normalized indicates how the underlying data in the buffer maps to the values in the GLSL shader code. 
+		itemSize gives the number of values of the array that should be associated with a particular vertex. normalized indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
@@ -54,6 +54,10 @@
 		A version number, incremented every time the needsUpdate property is set to true.
 		A version number, incremented every time the needsUpdate property is set to true.
 		</div>
 		</div>
 
 
+		<h3>[property:Function onUpload]</h3>
+		<div>
+		A callback function that is executed after the Renderer has transfered the attribute array data to the GPU.
+		</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 

+ 18 - 14
docs/api/core/Clock.html

@@ -10,7 +10,10 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Object for keeping track of time.</div>
+		<div class="desc">
+		Object for keeping track of time. This uses <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now">performance.now()</a>
+		if it is available, otherwise it reverts to the less accurate <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now">Date.now()</a>.
+		</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
@@ -18,38 +21,36 @@
 
 
 		<h3>[name]( [page:Boolean autoStart] )</h3>
 		<h3>[name]( [page:Boolean autoStart] )</h3>
 		<div>
 		<div>
-		autoStart — Automatically start the clock. Default is true.
+		autoStart — (optional) whether to automatically start the clock. Default is true.
 		</div>
 		</div>
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>[property:Boolean autoStart]</h3>
 		<h3>[property:Boolean autoStart]</h3>
 		<div>
 		<div>
-		If set, starts the clock automatically when the first update is called.
+		If set, starts the clock automatically when the first update is called. Default is true.
 		</div>
 		</div>
 
 
 		<h3>[property:Float startTime]</h3>
 		<h3>[property:Float startTime]</h3>
 		<div>
 		<div>
-		When the clock is running, It holds the start time of the clock. <br />
-		This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+		Holds the time at which the clock's [page:Clock.start start] method was last called.
  		</div>
  		</div>
 
 
 
 
 		<h3>[property:Float oldTime]</h3>
 		<h3>[property:Float oldTime]</h3>
 		<div>
 		<div>
-		When the clock is running, It holds the previous time from a update.<br />
-		This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+		Holds the time at which the clock's [page:Clock.start start], [page:Clock.getElapsedTime getElapsedTime] or [page:Clock.getDelta getDelta]
+		methods were last called.
  		</div>
  		</div>
 
 
 		<h3>[property:Float elapsedTime]</h3>
 		<h3>[property:Float elapsedTime]</h3>
 		<div>
 		<div>
-		When the clock is running, It holds the time elapsed between the start of the clock to the previous update.<br />
-		This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+		Keeps track of the total time that the clock has been running.
  		</div>
  		</div>
 
 
 		<h3>[property:Boolean running]</h3>
 		<h3>[property:Boolean running]</h3>
 		<div>
 		<div>
-		This property keeps track whether the clock is running or not.
+		Whether the clock is running or not.
  		</div>
  		</div>
 
 
 
 
@@ -57,22 +58,25 @@
 
 
 		<h3>[method:null start]()</h3>
 		<h3>[method:null start]()</h3>
 		<div>
 		<div>
-		Starts clock.
+		Starts clock. Also sets the [page:Clock.startTime startTime] and [page:Clock.oldTime oldTime]
+		to the current time, sets [page:Clock.elapsedTime elapsedTime] to *0* and [page:Clock.running running] to *true*.
 		</div>
 		</div>
 
 
 		<h3>[method:null stop]()</h3>
 		<h3>[method:null stop]()</h3>
 		<div>
 		<div>
-		Stops clock.
+		Stops clock and sets [page:Clock.oldTime oldTime] to the current time.
 		</div>
 		</div>
 
 
 		<h3>[method:Float getElapsedTime]()</h3>
 		<h3>[method:Float getElapsedTime]()</h3>
 		<div>
 		<div>
-		Get the seconds passed since the clock started.
+		Get the seconds passed since the clock started and sets [page:Clock.oldTime oldTime] to the current time.<br />
+		If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
 		</div>
 		</div>
 
 
 		<h3>[method:Float getDelta]()</h3>
 		<h3>[method:Float getDelta]()</h3>
 		<div>
 		<div>
-		Get the seconds passed since the last call to this method.
+		Get the seconds passed since the time [page:Clock.oldTime oldTime] was set and sets [page:Clock.oldTime oldTime] to the current time.<br />
+		If [page:Clock.autoStart autoStart] is *true* and the clock is not running, also starts the clock.
 		</div>
 		</div>
 
 
 
 

+ 63 - 0
docs/api/extras/CurveUtils.html

@@ -0,0 +1,63 @@
+<!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>
+
+		<div class="desc">
+		A class containing utility functions for curves.<br />
+
+		Note that these are all linear functions so it is neccessary to calculate seperately for
+		x, y (and z, w if present) components of a curve.
+		</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:Number interpolate]( p0, p1, p2, p3, t )</h3>
+		<div>
+		t -- interpolation weight. <br />
+		p0, p1, p2, p4 -- the points defining the spline curve.<br /><br />
+
+		Used internally by [page:SplineCurve SplineCurve] and [page:SplineCurve3 SplineCurve3].
+		</div>
+
+		<h3>[method:Number tangentQuadraticBezier]( t, p0, p1, p2 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2 -- the three points defining the quadratic Bézier curve.<br /><br />
+
+		Calculate the tangent at the point t on a quadratic Bézier curve given by the three points.<br /><br />
+
+		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve].
+		</div>
+
+		<h3>[method:Number tangentCubicBezier]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2, p3 -- the points defining the cubic Bézier curve.<br /><br />
+
+		Calculate the tangent at the point t on a cubic Bézier curve given by the four points.<br /><br />
+
+		Used internally by [page:CubicBezierCurve CubicBezierCurve].
+		</div>
+
+		<h3>[method:Number tangentSpline]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- the point at which to calculate the tangent. <br />
+		p0, p1, p2, p3 -- the points defining the spline curve.<br /><br />
+
+		Calculate the tangent at the point t on a spline curve given by the four points.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 88 - 0
docs/api/extras/ShapeUtils.html

@@ -0,0 +1,88 @@
+<!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>
+
+		<div class="desc">
+		A class containing utility functions for shapes.<br />
+
+		Note that these are all linear functions so it is neccessary to calculate seperately for
+		x, y (an z, w if present) components of a vector.
+		</div>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:Number area]( contour )</h3>
+		<div>
+		contour -- 2D polygon.<br /><br />
+
+		Calculate area of a ( 2D ) contour polygon.<br /><br />
+
+		</div>
+
+		<h3>[method:Number b2]( t, p0, p1, p2 )</h3>
+		<div>
+		t -- number<br />
+		p0, p1, p2 -- x, y, z or w components of a quadratic bezier curve.<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y (and z for 3D curves) components of a curve.<br /><br />
+
+		Used internally by [page:QuadraticBezierCurve QuadraticBezierCurve],
+		[page:QuadraticBezierCurve3 QuadraticBezierCurve3] and [page:Font Font].
+		</div>
+
+		<h3>[method:Number b3]( t, p0, p1, p2, p3 )</h3>
+		<div>
+		t -- number. <br />
+		p0, p1, p2, p3 -- x, y or z components of a cubic bezier curve..<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y (and z for 3D curves) components of a curve.<br /><br />
+
+		Used internally by [page:CubicBezierCurve CubicBezierCurve],
+		[page:CubicBezierCurve3 CubicBezierCurve3] and [page:Font Font].
+		</div>
+
+		<h3>[method:Boolean isClockwise]( pts )</h3>
+		<div>
+		pts -- points defining a 2D polygon<br /><br />
+
+		Note that this is a linear function so it is neccessary to calculate seperately for
+		x, y  components of a polygon.<br /><br />
+
+		Used internally by [page:Path Path],
+		[page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeBufferGeometry ShapeBufferGeometry].
+		</div>
+
+		<h3>[method:null triangulate]( contour, indices )</h3>
+		<div>
+		contour --  2D polygon.<br />
+		indices -- <br /><br />
+
+		Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
+		and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces.
+		</div>
+
+		<h3>[method:null triangulateShape]( contour, holes )</h3>
+		<div>
+		contour -- 2D polygon.<br />
+		holes -- array of holes<br /><br />
+
+		Used internally by [page:ExtrudeGeometry ExtrudeGeometry]
+		and [page:ShapeBufferGeometry ShapeBufferGeometry] to calculate faces in shapes with holes.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 2
docs/api/extras/animation/Animation.html → docs/api/extras/collada-animation/Animation.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../../" />
 		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -123,6 +123,6 @@
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
 	</body>
 	</body>
 </html>
 </html>

+ 2 - 2
docs/api/extras/animation/AnimationHandler.html → docs/api/extras/collada-animation/AnimationHandler.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../../" />
 		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -97,6 +97,6 @@
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
 	</body>
 	</body>
 </html>
 </html>

+ 2 - 2
docs/api/extras/animation/KeyFrameAnimation.html → docs/api/extras/collada-animation/KeyFrameAnimation.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../../" />
 		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -111,6 +111,6 @@
 		Used internally to traverse the animation
 		Used internally to traverse the animation
 		</div>
 		</div>
 
 
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/collada/[name].js examples/js/loaders/collada/[name].js]
 	</body>
 	</body>
 </html>
 </html>

+ 32 - 0
docs/api/extras/core/Font.html

@@ -0,0 +1,32 @@
+<!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>
+
+		<div class="desc">
+		Create a set of [page:Shape Shape]s representing a font loaded in JSON format.<br /><br />
+
+		Used internally by the [page:FontLoader].
+		</div>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( data )</h3>
+		<div>
+		data -- JSON data representing the font.<br /><br />
+
+		This constructor creates a new [name], which is an array of [page:Shape Shape]s.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 75 - 0
docs/api/extras/helpers/SkeletonHelper.html

@@ -0,0 +1,75 @@
+<!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>
+		[page:Object3D] &rarr; [page:Line] &rarr; [page:LineSegments] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		A helper object to assist with visualizing a [page:Skeleton Skeleton].
+		The helper is renderered using a [page:LineBasicMaterial LineBasicMaterial].
+		</div>
+
+
+		<h2>Example</h2>
+
+		[example:webgl_animation_skinning_blending animation / skinning / blending]<br />
+		[example:webgl_animation_skinning_morph animation / skinning / morph]<br />
+		[example:webgl_loader_bvh loader / bvh ]
+
+		<code>
+var helper = new THREE.SkeletonHelper( mesh );
+helper.material.linewidth = 3;
+scene.add( helper );
+		</code>
+
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( object )</h3>
+		<div>
+		object -- can be any object that has an array of [page:Bone Bone]s as a sub object. <br />
+		For example, a [page:Skeleton Skeleton] or a [page:SkinnedMesh SkinnedMesh].
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>[property:Array bones]</h3>
+		<div>
+		The list of bones that the helper renders as [page:Line Line]s.
+		</div>
+
+		<h3>[property:Object root]</h3>
+		<div>
+		The object passed in the constructor.
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:Array getBoneList]( object )</h3>
+		<div>
+		getBoneList -- the object used in the constructor.<br /><br />
+
+		This is called automatically to generate a list of bones from the object passed in the constructor.
+		</div>
+
+		<h3>[method:null update]()</h3>
+		<div>
+		Update the helper. Call in the render loop if animating the model.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 1
docs/api/geometries/ConeBufferGeometry.html

@@ -8,7 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	</head>
 	<body>
 	<body>
-		[page:BufferGeometry] &rarr;
+		[page:CylinderBufferGeometry] &rarr;
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 

+ 1 - 1
docs/api/geometries/ConeGeometry.html

@@ -8,7 +8,7 @@
 		<link type="text/css" rel="stylesheet" href="page.css" />
 		<link type="text/css" rel="stylesheet" href="page.css" />
 	</head>
 	</head>
 	<body>
 	<body>
-		[page:Geometry] &rarr;
+		[page:CylinderGeometry] &rarr;
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 

+ 57 - 0
docs/api/geometries/EdgesGeometry.html

@@ -0,0 +1,57 @@
+<!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>
+		[page:BufferGeometry] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">This can be used as a helper object to view the edges of a [page:Geometry Geometry] object.</div>
+
+		<!-- <iframe id="scene" src="scenes/geometry-browser.html#EdgeGeometry"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script> -->
+
+		<h2>Example</h2>
+
+		[example:webgl_helpers helpers]
+
+		<code>
+var geometry = new THREE.BoxBufferGeometry( 100, 100, 100 );
+var edges = new THREE.EdgesGeometry( geometry );
+var line = new THREE.LineSegments( edges );
+scene.add( line );
+		</code>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:Geometry geometry] )</h3>
+		<div>
+		geometry — any geometry object.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 1
docs/api/geometries/ExtrudeGeometry.html

@@ -54,7 +54,7 @@
 			bevelSegments: 1
 			bevelSegments: 1
 		};
 		};
 
 
-		var geometry = new THREE.ExtrudeGeometry( shape, data );
+		var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
 		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		var mesh = new THREE.Mesh( geometry, material ) ;
 		var mesh = new THREE.Mesh( geometry, material ) ;
 		scene.add( mesh );
 		scene.add( mesh );

+ 71 - 0
docs/api/geometries/ShapeBufferGeometry.html

@@ -0,0 +1,71 @@
+<!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>
+		[page:BufferGeometry] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">Creates an one-sided polygonal geometry from one or more path shapes.</div>
+
+		<iframe id="scene" src="scenes/geometry-browser.html#ShapeBufferGeometry"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script>
+
+
+		<h2>Example</h2>
+
+
+		<code>
+		var x = 0, y = 0;
+
+		var heartShape = new THREE.Shape();
+
+		heartShape.moveTo( x + 5, y + 5 );
+		heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
+		heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
+		heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
+		heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
+		heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
+		heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
+
+		var geometry = new THREE.ShapeBufferGeometry( heartShape );
+		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
+		var mesh = new THREE.Mesh( geometry, material ) ;
+		scene.add( mesh );
+		</code>
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]([page:Array shapes], [page:Integer curveSegments])</h3>
+		<div>
+		shapes — [page:Array] of shapes or a single [page:Shape shape].<br />
+		curveSegments - [page:Integer] - Number of segments per shape. Default is 12.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 15 - 39
docs/api/geometries/ShapeGeometry.html

@@ -12,7 +12,7 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Creates a one-sided polygonal geometry from one or more path shapes. Similar to [page:ExtrudeGeometry].</div>
+		<div class="desc">Creates an one-sided polygonal geometry from one or more path shapes.</div>
 
 
 		<iframe id="scene" src="scenes/geometry-browser.html#ShapeGeometry"></iframe>
 		<iframe id="scene" src="scenes/geometry-browser.html#ShapeGeometry"></iframe>
 
 
@@ -37,16 +37,19 @@
 
 
 
 
 		<code>
 		<code>
-		var length = 16, width = 12;
+		var x = 0, y = 0;
 
 
-		var shape = new THREE.Shape();
-		shape.moveTo( 0,0 );
-		shape.lineTo( 0, width );
-		shape.lineTo( length, width );
-		shape.lineTo( length, 0 );
-		shape.lineTo( 0, 0 );
+		var heartShape = new THREE.Shape();
 
 
-		var geometry = new THREE.ShapeGeometry( shape );
+		heartShape.moveTo( x + 5, y + 5 );
+		heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
+		heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
+		heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
+		heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
+		heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
+		heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
+
+		var geometry = new THREE.ShapeGeometry( heartShape );
 		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		var mesh = new THREE.Mesh( geometry, material ) ;
 		var mesh = new THREE.Mesh( geometry, material ) ;
 		scene.add( mesh );
 		scene.add( mesh );
@@ -55,39 +58,12 @@
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]([page:Array shapes], [page:Object options])</h3>
-		<div>
-		shapes — [page:Array] of shapes, or a single [page:Shape shape] <br />
-		options — Optional options [page:Object object]
-		<ul>
-		<li>curveSegments - [page:Integer] - Not used at the moment - defaults to 12</li>
-		<li>material - [page:Integer] - index of the material in a material list</li>
-		<li>UVGenerator - A UV generator, defaults to [page:ExtrudeGeometry]'s WorldUVGenerator</li>
-		</ul>
-		</div>
-
-
-		<h2>Methods</h2>
-
-
-
-		<h3>.addShapeList([page:Array shapes], [page:Object options]) [page:this]</h3>
-		<div>
-		shapes — [page:Array] of [page:Shape shapes] <br />
-		options — See options in constructor
-		</div>
+		<h3>[name]([page:Array shapes], [page:Integer curveSegments])</h3>
 		<div>
 		<div>
-		Adds a list of shapes to the geometry.
+		shapes — [page:Array] of shapes or a single [page:Shape shape].<br />
+		curveSegments - [page:Integer] - Number of segments per shape. Default is 12.
 		</div>
 		</div>
 
 
-		<h3>[method:null addShape]([page:Shape shape], [page:Object options])</h3>
-		<div>
-		shape — [page:Shape] <br />
-		options — See options in constructor
-		</div>
-		<div>
-		Adds a single shape to the geometry
-		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 63 - 0
docs/api/geometries/WireframeGeometry.html

@@ -0,0 +1,63 @@
+<!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>
+		[page:BufferGeometry] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">This can be used as a helper object to view a [page:Geometry Geometry] object as a wireframe.</div>
+
+		<!-- <iframe id="scene" src="scenes/geometry-browser.html#EdgeGeometry"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script> -->
+
+		<h2>Example</h2>
+
+		[example:webgl_helpers helpers]
+
+		<code>
+var geometry = new THREE.SphereBufferGeometry( 100, 100, 100 );
+
+var wireframe = new THREE.WireframeGeometry( geometry );
+
+var line = new THREE.LineSegments( wireframe );
+line.material.depthTest = false;
+line.material.opacity = 0.25;
+line.material.transparent = true;
+
+scene.add( line );
+		</code>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:Geometry geometry] )</h3>
+		<div>
+		geometry — any geometry object.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 1
docs/api/loaders/Cache.html

@@ -10,7 +10,7 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">A simple caching classe, used internaly by [page:XHRLoader].</div>
+		<div class="desc">A simple caching classe, used internaly by [page:FileLoader].</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>

+ 0 - 0
docs/api/loaders/XHRLoader.html → docs/api/loaders/FileLoader.html


+ 98 - 56
docs/api/loaders/MTLLoader.html

@@ -1,57 +1,99 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
+<!DOCTYPE html>
+<html lang="en">
+	<head>
 		<meta charset="utf-8" />
 		<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>
-
-		<div class="desc">A loader for loading an <em>.mtl</em> resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].</div>
-
-
-		<h2>Constructor</h2>
-
-		<h3>[name]( [page:String baseUrl], [page:Object options], [page:String crossOrigin] )</h3>
-		<div>
-		[page:String baseUrl] — The base url from which to find subsequent resources.<br />
-		[page:Object options] — Options passed to the created material (side, wrap, normalizeRGB, ignoreZeroRGBs).<br />
-		[page:String crossOrigin] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.<br />
-		</div>
-		<div>
-		Creates a new [name].
-		</div>
-
-		<h2>Properties</h2>
-
-
-		<h2>Methods</h2>
-
-		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
-		<div>
-		[page:String url] — required<br />
-		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
-		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
-		[page:Function onError] — Will be called when load errors.<br />
-		</div>
-		<div>
-		Begin loading from url and return the loaded material.
-		</div>
-
-		<h3>[method:MTLLoaderMaterialCreator parse]( [page:String text] )</h3>
-		<div>
-		[page:String text] — The textual <em>mtl</em> structure to parse.
-		</div>
-		<div>
-		Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator] instance.<br />
-		</div>
-
-		<h2>Source</h2>
-
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js]
-	</body>
-</html>
+		<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>
+
+		<div class="desc">A loader for loading an <em>.mtl</em> resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].</div>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:LoadingManager loadingManager] )</h3>
+		<div>
+			[page:LoadingManager loadingManager] — LoadingManager to use. Defaults to [page:DefaultLoadingManager DefaultLoadingManager]<br />
+		</div>
+		<div>
+			Creates a new [name].
+		</div>
+
+		<!-- <h2>Properties</h2> -->
+
+
+		<h2>Methods</h2>
+
+
+		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
+		<div>
+			[page:String url] — required<br />
+			[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
+			[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
+			[page:Function onError] — Will be called when load errors.<br />
+		</div>
+		<div>
+			Begin loading from url and return the loaded material.
+		</div>
+
+
+		<h3>[method:null setPath]( [page:String path] )</h3>
+		<div>
+			[page:String path] — required<br />
+		</div>
+		<div>
+			 Set base path for resolving references. If set this path will be prepended to each loaded and found reference.
+		</div>
+
+
+		<h3>[method:null setTexturePath]( [page:String path] )</h3>
+		<div>
+			[page:String path] — required<br />
+		</div>
+		<div>
+			Set base path for resolving texture references. If set this path will be prepended found texture reference. If not set and setPath is, it will be used as texture base path.
+		</div>
+
+
+		<h3>[method:null setCrossOrigin]( [page:boolean useCrossOrigin] )</h3>
+		<div>
+			[page:boolean useCrossOrigin] — required<br />
+		</div>
+		<div>
+			Set to true if you need to load textures from a different origin.
+		</div>
+	
+
+		<h3>[method:null setMaterialOptions]( [page:Object options] )</h3>
+		<div>
+			[page:Object options] — required
+			<ul>
+				<li>side: Which side to apply the material. THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide</li>
+				<li>wrap: What type of wrapping to apply for textures. THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping</li>
+				<li>normalizeRGB: RGBs need to be normalized to 0-1 from 0-255. Default: false, assumed to be already normalized</li>
+				<li>ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's. Default: false</li>
+			</ul>
+		</div>
+		<div>
+			Set of options on how to construct the materials
+		</div>
+	
+
+		<h3>[method:MTLLoaderMaterialCreator parse]( [page:String text] )</h3>
+		<div>
+			[page:String text] — The textual <em>mtl</em> structure to parse.
+		</div>
+		<div>
+			Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator] instance.<br />
+		</div>
+		
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js]
+	</body>
+</html>

+ 1 - 1
docs/api/loaders/OBJLoader.html

@@ -47,7 +47,7 @@
 		<div>
 		<div>
 		Returns an [page:Object3D]. It contains the parsed meshes as [page:Mesh] and lines as [page:LineSegments].<br />
 		Returns an [page:Object3D]. It contains the parsed meshes as [page:Mesh] and lines as [page:LineSegments].<br />
 		All geometry is created as [page:BufferGeometry]. Default materials are created as [page:MeshPhongMaterial].<br />
 		All geometry is created as [page:BufferGeometry]. Default materials are created as [page:MeshPhongMaterial].<br />
-		If an <em>obj</em> object or group uses multiple materials while declaring faces geometry groups and an [page:MultiMaterial] is used.
+		If an <em>obj</em> object or group uses multiple materials while declaring faces geometry groups and a [page:MultiMaterial] is used.
 		</div>
 		</div>
 
 
 		<h2>Example</h2>
 		<h2>Example</h2>

+ 132 - 57
docs/api/materials/Material.html

@@ -10,8 +10,15 @@
 	<body>
 	<body>
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">Materials describe the appearance of [page:Object objects]. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.</div>
-
+		<div class="desc">
+		<p>
+		Materials describe the appearance of [page:Object objects].
+		They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
+		</p>
+		<P>
+		With the exception of [page:MultiMaterial MultiMaterial], the following properties and methods are inherited by all other material types (although they may have different defaults).
+		</P>
+		</div>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
@@ -34,55 +41,96 @@
 		Material name. Default is an empty string.
 		Material name. Default is an empty string.
 		</div>
 		</div>
 
 
+		<h3>[property:String type]</h3>
+		<div>
+		Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene.
+		</div>
+
+		<h3>[property:Boolean fog]</h3>
+		<div>
+		Whether the material is affected by fog. Default is *true*.
+		</div>
+
+		<h3>[property:Boolean lights]</h3>
+		<div>
+		Whether the material is affected by lights. Default is *true*.
+		</div>
+
+		<h3>[property:Integer side]</h3>
+		<div>
+		Defines which side of faces will be rendered - front, back or both.
+		Default is [page:Materials THREE.FrontSide].
+		Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
+		</div>
+
+		<h3>[property:Integer shading]</h3>
+		<div>
+		Defines how the material is shaded.
+		This can be either [page:Materials THREE.SmoothShading] (default)	or [page:Materials THREE.FlatShading].
+		</div>
+
+		<h3>[property:Integer vertexColors]</h3>
+		<div>
+		Defines whether vertex coloring is used.
+		Default is [page:Materials THREE.NoColors].
+		Other options are [page:Materials THREE.VertexColors] and [page:Materials THREE.FaceColors].
+		</div>
+
 		<h3>[property:Float opacity]</h3>
 		<h3>[property:Float opacity]</h3>
 		<div>
 		<div>
-		Float in the range of 0.0 - 1.0 indicating how transparent the material is.
-		A value of 0.0 indicates fully transparent, 1.0 is fully opaque. If
-		*transparent* is not set to true for the material, the material will remain
-		fully opaque and this value will only affect its color.
+		Float in the range of *0.0* - *1.0* indicating how transparent the material is.
+		A value of *0.0* indicates fully transparent, *1.0* is fully opaque.<br />
+		If the material's [property:Boolean transparent] property is not set to *true*, the material will remain
+		fully opaque and this value will only affect its color. <br />
+		Default is *1.0*.
 		</div>
 		</div>
-		<div>Default is *1.0*.</div>
 
 
 		<h3>[property:Boolean transparent]</h3>
 		<h3>[property:Boolean transparent]</h3>
 		<div>
 		<div>
 		Defines whether this material is transparent. This has an effect on rendering
 		Defines whether this material is transparent. This has an effect on rendering
-		as transparent objects need special treatment and are rendered after 
-		non-transparent objects. For a working example of this behaviour, check the
-		[page:WebGLRenderer WebGLRenderer] code.<br />
+		as transparent objects need special treatment and are rendered after
+		non-transparent objects. <br />
 		When set to true, the extent to which the material is transparent is
 		When set to true, the extent to which the material is transparent is
-		controlled by setting *opacity*.
+		controlled by setting it's [property:Float opacity] property. <br />
+		Default is *false*.
 		</div>
 		</div>
-		<div>Default is *false*.</div>
 
 
 		<h3>[property:Blending blending]</h3>
 		<h3>[property:Blending blending]</h3>
 		<div>
 		<div>
-		Which blending to use when displaying objects with this material. Default is [page:Materials NormalBlending]. See the blending mode [page:Materials constants] for all possible values.
-
+		Which blending to use when displaying objects with this material. <br />
+		This must be set to [page:Materials CustomBlending] to use custom [property:Constant blendSrc], [property:Constant blendDst] or [property:Constant blendEquation].<br />
+		See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
 		</div>
 		</div>
 
 
 		<h3>[property:Integer blendSrc]</h3>
 		<h3>[property:Integer blendSrc]</h3>
 		<div>
 		<div>
-		Blending source. It's one of the blending mode constants defined in Three.js. Default is [page:CustomBlendingEquation SrcAlphaFactor]. See the destination factors [page:CustomBlendingEquation constants] for all possible values.
+		Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
+		See the source factors [page:CustomBlendingEquation constants] for all possible values.<br />
+		The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
 		</div>
 		</div>
 
 
 		<h3>[property:Integer blendDst]</h3>
 		<h3>[property:Integer blendDst]</h3>
 		<div>
 		<div>
-		Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
+		Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
+		See the destination factors [page:CustomBlendingEquation constants] for all possible values.<br />
+		The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
 		</div>
 		</div>
 
 
 		<h3>[property:Integer blendEquation]</h3>
 		<h3>[property:Integer blendEquation]</h3>
 		<div>
 		<div>
-		Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation AddEquation.]
+		Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation].
+		See the blending equation [page:CustomBlendingEquation constants] for all possible values.<br />
+		The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean depthTest]</h3>
+		<h3>[property:Integer depthFunc]</h3>
 		<div>
 		<div>
-		Whether to have depth test enabled when rendering this material. Default is *true*.
+		Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
 		</div>
 		</div>
 
 
-		<h3>[property:Integer depthFunc]</h3>
+		<h3>[property:Boolean depthTest]</h3>
 		<div>
 		<div>
-		What depth function to use. Default is [page:Materials THREE.LessEqualDepth].
+		Whether to have depth test enabled when rendering this material. Default is *true*.
 		</div>
 		</div>
 
 
 		<h3>[property:Boolean depthWrite]</h3>
 		<h3>[property:Boolean depthWrite]</h3>
@@ -93,91 +141,118 @@
 		When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
 		When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean polygonOffset]</h3>
+		<h3>[property:Array clippingPlanes]</h3>
 		<div>
 		<div>
-		Whether to use polygon offset. Default is *false*. This corresponds to the *POLYGON_OFFSET_FILL* WebGL feature.
+		User-defined clipping planes specified as THREE.Plane objects in world space.
+		These planes apply to the objects this material is attached to.
+		Points in space whose dot product with the plane is negative are cut away.
+		See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
+		Default is *null*.
 		</div>
 		</div>
 
 
-		<h3>[property:Integer polygonOffsetFactor]</h3>
+		<h3>[property:Boolean clipIntersection]</h3>
 		<div>
 		<div>
-		Sets the polygon offset factor. Default is *0*.
+		Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
+		Default is *false*.
 		</div>
 		</div>
 
 
-		<h3>[property:Integer polygonOffsetUnits]</h3>
+		<h3>[property:Boolean clipShadows]</h3>
 		<div>
 		<div>
-		Sets the polygon offset units. Default is *0*.
+		Defines whether to clip shadows according to the clipping planes specified on this material. Default is *false*.
 		</div>
 		</div>
 
 
-		<h3>[property:Number alphaTest]</h3>
+		<h3>[property:Boolean colorWrite]</h3>
 		<div>
 		<div>
-		Sets the alpha value to be used when running an alpha test. Default is *0*.
+		Whether to render the material's color.
+		This can be used in conjunction with a mesh's [property:Integer renderOrder] property to create invisible objects that occlude other objects. Default is *true*.
 		</div>
 		</div>
 
 
-		<h3>[property:Array clippingPlanes]</h3>
-
+		<h3>[property:String precision]</h3>
 		<div>
 		<div>
-		User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply to the objects this material is attached to. Points in space whose dot product with the plane is negative are cut away. Default is null.
+		Override the renderer's default precision for this material. Can be "*highp*", "*mediump*" or "*lowp*".
+		Defaults for the WebGLRenderer is "*highp*" if supported by the device.
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean clipIntersection]</h3>
-
-		<div>Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. Default is false. See <a href="http://threejs.org/examples/#webgl_clipping_intersection">example</a> </div>
+		<h3>[property:Boolean polygonOffset]</h3>
+		<div>
+		Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature.
+		</div>
 
 
-		<h3>[property:Boolean clipShadows]</h3>
+		<h3>[property:Integer polygonOffsetFactor]</h3>
 		<div>
 		<div>
-		Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
+		Sets the polygon offset factor. Default is *0*.
 		</div>
 		</div>
 
 
-		<h3>[property:Float overdraw]</h3>
+		<h3>[property:Integer polygonOffsetUnits]</h3>
 		<div>
 		<div>
-		Amount of triangle expansion at draw time. This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer]. *0.5* tends to give good results across browsers. Default is *0*.
+		Sets the polygon offset units. Default is *0*.
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean visible]</h3>
+		<h3>[property:Float alphaTest]</h3>
 		<div>
 		<div>
-		Defines whether this material is visible. Default is *true*.
+		Sets the alpha value to be used when running an alpha test.
+		The material will not be renderered if the opacity is lower than this value.
+		Default is *0*.
 		</div>
 		</div>
 
 
-		<h3>[property:Enum side]</h3>
+		<h3>[property:Boolean premultipliedAlpha]</h3>
 		<div>
 		<div>
-		Defines which of the face sides will be rendered - front, back or both.
+		Whether to premultiply the alpha (transparency) value.
+		See [Example:webgl_materials_transparency WebGL / Materials / Transparency] for an example of the difference.
+		Default is *false*.
 		</div>
 		</div>
+
+		<h3>[property:Float overdraw]</h3>
 		<div>
 		<div>
-		Default is [page:Materials THREE.FrontSide]. Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
+		Amount of triangle expansion at draw time.
+		This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer].
+		*0.5* tends to give good results across browsers. Default is *0*.
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean needsUpdate]</h3>
+		<h3>[property:Boolean visible]</h3>
 		<div>
 		<div>
-		Specifies that the material needs to be updated at the WebGL level. Set it to true if you made changes that need to be reflected in WebGL.
+		Defines whether this material is visible. Default is *true*.
 		</div>
 		</div>
+
+		<h3>[property:Boolean needsUpdate]</h3>
 		<div>
 		<div>
+		Specifies that the material needs to be updated at the WebGL level.
+		Set it to true if you made changes that need to be reflected in WebGL.<br />
 		This property is automatically set to *true* when instancing a new material.
 		This property is automatically set to *true* when instancing a new material.
 		</div>
 		</div>
 
 
-		
+
 		<h2>Methods</h2>
 		<h2>Methods</h2>
-		
+
 		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
 		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
-		
-		<h3>[method:Material clone]( [page:material material] )</h3>
+
+		<h3>[method:null setValues]( [page:object values] )</h3>
 		<div>
 		<div>
-		material -- this material gets the cloned information (optional). 
+		values -- a container with parameters.<br />
+		Sets the properties based on the *values*.
 		</div>
 		</div>
+
+		<h3>[method:null toJSON]( [page:object meta] )</h3>
 		<div>
 		<div>
-		This clones the material in the optional parameter and returns it.
+		meta -- object containing metadata such as textures or images for the material.<br />
+		Convert the material to Three JSON format.
 		</div>
 		</div>
 
 
-		<h3>[method:null dispose]()</h3>
+		<h3>[method:Material clone]( [page:material material] )</h3>
 		<div>
 		<div>
-		This disposes the material. Textures of a material don't get disposed. These needs to be disposed by [page:Texture Texture]. 
+		material -- this material gets the cloned information (optional).<br />
+		This clones the material in the optional parameter and returns it.
 		</div>
 		</div>
 
 
-		<h3>[method:null setValues]( [page:object values] )</h3>
+		<h3>[method:null update]()</h3>
 		<div>
 		<div>
-		values -- a container with parameters.
+		Call [method:null dispatchEvent]( { type: '[page:object update]' }) on the material.
 		</div>
 		</div>
+
+		<h3>[method:null dispose]()</h3>
 		<div>
 		<div>
-		Sets the properties based on the *values*.
+		This disposes the material. Textures of a material don't get disposed.
+		These needs to be disposed by [page:Texture Texture].
 		</div>
 		</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>

+ 11 - 3
docs/api/materials/MeshBasicMaterial.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="en">
 <html lang="en">
 	<head>
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<script src="page.js"></script>
@@ -41,6 +41,8 @@
 		<div>
 		<div>
 		color — geometry color in hexadecimal. Default is 0xffffff.<br />
 		color — geometry color in hexadecimal. Default is 0xffffff.<br />
 		map — Set texture map. Default is null <br />
 		map — Set texture map. Default is null <br />
+		lightMap — Set light map. Default is null.<br />
+		lightMapIntensity — Set light map intensity. Default is 1.<br />
 		aoMap — Set ao map. Default is null.<br />
 		aoMap — Set ao map. Default is null.<br />
 		aoMapIntensity — Set ao map intensity. Default is 1.<br />
 		aoMapIntensity — Set ao map intensity. Default is 1.<br />
 		specularMap — Set specular map. Default is null.<br />
 		specularMap — Set specular map. Default is null.<br />
@@ -71,11 +73,17 @@
 		Set texture map. Default is  null.
 		Set texture map. Default is  null.
 		</div>
 		</div>
 
 
+		<h3>[property:Texture lightMap]</h3>
+		<div>Set light map. Default is null. The lightMap requires a second set of UVs.</div>
+
+		<h3>[property:Float lightMapIntensity]</h3>
+		<div>Intensity of the baked light. Default is 1.</div>
+
 		<h3>[property:Texture aoMap]</h3>
 		<h3>[property:Texture aoMap]</h3>
 		<div>Set ambient occlusion map. Default is null.</div>
 		<div>Set ambient occlusion map. Default is null.</div>
 
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<h3>[property:Float aoMapIntensity]</h3>
-		<div>TODO</div>
+		<div>Intensity of the ambient occlusion effect. Default is 1. Zero is no occlusion effect.</div>
 
 
 		<h3>[property:Texture specularMap]</h3>
 		<h3>[property:Texture specularMap]</h3>
 		<div>Set specular map. Default is null.</div>
 		<div>Set specular map. Default is null.</div>
@@ -90,7 +98,7 @@
 		<h3>[property:Integer combine]</h3>
 		<h3>[property:Integer combine]</h3>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 
 
-		<div>Options are [page:Textures THREE.Multiply] (default), [page:Textures THREE.MixOperation], [page:Textures THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
+		<div>Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
 
 
 		<h3>[property:Float reflectivity]</h3>
 		<h3>[property:Float reflectivity]</h3>
 		<div>How much the environment map affects the surface; also see "combine".</div>
 		<div>How much the environment map affects the surface; also see "combine".</div>

+ 1 - 1
docs/api/materials/MeshLambertMaterial.html

@@ -113,7 +113,7 @@
 		<h3>[property:Integer combine]</h3>
 		<h3>[property:Integer combine]</h3>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 
 
-		<div>Options are [page:Textures THREE.Multiply] (default), [page:Textures THREE.MixOperation], [page:Textures THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
+		<div>Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
 
 
 		<h3>[property:Float reflectivity]</h3>
 		<h3>[property:Float reflectivity]</h3>
 		<div>How much the environment map affects the surface; also see "combine".</div>
 		<div>How much the environment map affects the surface; also see "combine".</div>

+ 1 - 1
docs/api/materials/MeshPhongMaterial.html

@@ -175,7 +175,7 @@
 		<h3>[property:Integer combine]</h3>
 		<h3>[property:Integer combine]</h3>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 		<div>How to combine the result of the surface's color with the environment map, if any.</div>
 
 
-		<div>Options are [page:Textures THREE.MultiplyOperation] (default), [page:Textures THREE.MixOperation], [page:Textures THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
+		<div>Options are [page:Materials THREE.Multiply] (default), [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation]. If mix is chosen, the reflectivity is used to blend between the two colors.</div>
 
 
 		<h3>[property:Float reflectivity]</h3>
 		<h3>[property:Float reflectivity]</h3>
 		<div>How much the environment map affects the surface; also see "combine".</div>
 		<div>How much the environment map affects the surface; also see "combine".</div>

+ 71 - 0
docs/api/materials/MeshPhysicalMaterial.html

@@ -0,0 +1,71 @@
+<!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>
+		[page:Material] &rarr; [page:MeshStandardMaterial] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">An extension of the [page:MeshStandardMaterial] that allows for greater control over reflectivity.</div>
+
+		<!-- <iframe id="scene" src="scenes/material-browser.html#MeshStandardMaterial"></iframe>
+
+		<script>
+
+		// iOS iframe auto-resize workaround
+
+		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+			var scene = document.getElementById( 'scene' );
+
+			scene.style.width = getComputedStyle( scene ).width;
+			scene.style.height = getComputedStyle( scene ).height;
+			scene.setAttribute( 'scrolling', 'no' );
+
+		}
+
+		</script> -->
+
+		<h2>Examples</h2>
+		[example:webgl_materials_variations_physical materials / variations / physical]<br />
+		[example:webgl_materials_reflectivity materials / reflectivity]
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( [page:Object parameters] )</h3>
+		<div>
+		parameters -- see [page:MeshStandardMaterial]
+		</div>
+
+
+		<h2>Properties</h2>
+		<div>See the base [page:Material] and [page:MeshStandardMaterial] classes for common properties.</div>
+
+		<h3>[property:Float reflectivity]</h3>
+		<div>
+		Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*.<br />
+			
+		This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
+		</div>
+
+		<h3>[property:Float clearCoat]</h3>
+		<div>
+		ClearCoat level, from *0.0* to *1.0*. Default is *0.0*.
+		</div>
+
+		<h3>[property:Float clearCoatRoughness]</h3>
+		<div>
+		How rough the clearCoat appears, from *0.0* to *1.0*. Default is *0.0*.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 10 - 12
docs/api/materials/MeshStandardMaterial.html

@@ -12,7 +12,7 @@
 
 
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
-		<div class="desc">TODO</div>
+		<div class="desc">A standard physically-based material</div>
 
 
 		<iframe id="scene" src="scenes/material-browser.html#MeshStandardMaterial"></iframe>
 		<iframe id="scene" src="scenes/material-browser.html#MeshStandardMaterial"></iframe>
 
 
@@ -91,28 +91,28 @@
 
 
 		<h3>[property:Float roughness]</h3>
 		<h3>[property:Float roughness]</h3>
 		<div>
 		<div>
-		TODO.<br />
+		How rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse.<br />
 		</div>
 		</div>
 
 
 		<h3>[property:Float metalness]</h3>
 		<h3>[property:Float metalness]</h3>
 		<div>
 		<div>
-		TODO<br />
+		How much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, nothing in between. A value between 0.0 and 1.0 could be used for a rusty metal look.<br />
 		</div>
 		</div>
 
 
 		<h3>[property:Texture map]</h3>
 		<h3>[property:Texture map]</h3>
 		<div>Set color texture map. Default is null. The texture map color is modulated by the diffuse color.</div>
 		<div>Set color texture map. Default is null. The texture map color is modulated by the diffuse color.</div>
 
 
 		<h3>[property:Texture lightMap]</h3>
 		<h3>[property:Texture lightMap]</h3>
-		<div>Set light map. Default is null. The lightMap requires a second set of UVs.</div>
+		<div>Set light map, a texture that contains pre-baked diffuse lighting added to the surface. Default is null. The lightMap requires a second set of UVs.</div>
 
 
 		<h3>[property:Float lightMapIntensity]</h3>
 		<h3>[property:Float lightMapIntensity]</h3>
-		<div>TODO</div>
+		<div>A scale factor for the light map's effect, higher being brighter.</div>
 
 
 		<h3>[property:Texture aoMap]</h3>
 		<h3>[property:Texture aoMap]</h3>
-		<div>Set ambient occlusion map. Default is null. The aoMap requires a second set of UVs.</div>
+		<div>Set ambient occlusion map, a texture that contains pre-baked darkening due to crevices on the surface. Default is null. The aoMap requires a second set of UVs.</div>
 
 
 		<h3>[property:Float aoMapIntensity]</h3>
 		<h3>[property:Float aoMapIntensity]</h3>
-		<div>TODO</div>
+		<div>A scale factor for the ambient occlusion map's effect, higher being darker and more pronounced.</div>
 
 
 		<h3>[property:Color emissive]</h3>
 		<h3>[property:Color emissive]</h3>
 		<div>
 		<div>
@@ -165,13 +165,11 @@
 		</div>
 		</div>
 
 
 		<h3>[property:Texture roughnessMap]</h3>
 		<h3>[property:Texture roughnessMap]</h3>
-		<div>
-			TODO.
+		<div>The red channel of this texture is used to alter the roughness of the material.
 		</div>
 		</div>
 
 
 		<h3>[property:Texture metalnessMap]</h3>
 		<h3>[property:Texture metalnessMap]</h3>
-		<div>
-			TODO.
+		<div>The red channel of this texture is used to alter the metalness of the material.
 		</div>
 		</div>
 
 
 		<h3>[property:Texture alphaMap]</h3>
 		<h3>[property:Texture alphaMap]</h3>
@@ -182,7 +180,7 @@
 		<div>Set env map. Default is null.</div>
 		<div>Set env map. Default is null.</div>
 
 
 		<h3>[property:Float envMapIntensity]</h3>
 		<h3>[property:Float envMapIntensity]</h3>
-		<div>TODO</div>
+		<div>Scales the effect of the environment map by multiplying its color.</div>
 
 
 		<h3>[property:Float refractionRatio]</h3>
 		<h3>[property:Float refractionRatio]</h3>
 		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>
 		<div>The index of refraction for an environment map using [page:Textures THREE.CubeRefractionMapping]. Default is *0.98*.</div>

+ 56 - 0
docs/api/materials/ShadowMaterial.html

@@ -0,0 +1,56 @@
+<!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>
+		[page:Material] &rarr; [page:ShaderMaterial] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		This material can recieve shadows, but otherwise is completely transparent.
+		</div>
+
+		<h3>Example</h3>
+		[example:webgl_geometry_spline_editor gemoetry / spline / editor]
+
+		<code>
+var planeGeometry = new THREE.PlaneGeometry( 2000, 2000 );
+planeGeometry.rotateX( - Math.PI / 2 );
+
+var planeMaterial = new THREE.ShadowMaterial();
+planeMaterial.opacity = 0.2;
+
+var plane = new THREE.Mesh( planeGeometry, planeMaterial );
+plane.position.y = -200;
+plane.receiveShadow = true;
+scene.add( plane );
+		</code>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( )</h3>
+
+
+		<h2>Properties</h2>
+		<div>See the base [page:Material] and [page:ShaderMaterial] classes for common properties.</div>
+
+		<h3>[property:Boolean lights]</h3>
+		<div>Whether the material is affected by lights. Default is *true*.</div>
+
+		<h3>[property:Boolean transparent]</h3>
+		<div>Defines whether this material is transparent. Default is *true*.</div>
+
+		<h2>Methods</h2>
+		<div>See the base [page:Material] and [page:ShaderMaterial] classes for common methods.</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 2
docs/api/math/Box2.html

@@ -86,7 +86,7 @@
 		Sets the upper and lower bounds of this box to include all of the points in *points*.
 		Sets the upper and lower bounds of this box to include all of the points in *points*.
 		</div>
 		</div>
 
 
-		<h3>[method:Vector2 size]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
+		<h3>[method:Vector2 getSize]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
 		<div>
 		<div>
 		optionalTarget -- If specified, the result will be copied here.
 		optionalTarget -- If specified, the result will be copied here.
 		</div>
 		</div>
@@ -194,7 +194,7 @@
 		Makes this box empty.
 		Makes this box empty.
 		</div>
 		</div>
 
 
-		<h3>[method:Vector2 center]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
+		<h3>[method:Vector2 getCenter]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
 		<div>
 		<div>
 		optionalTarget -- If specified, the result will be copied here.
 		optionalTarget -- If specified, the result will be copied here.
 		</div>
 		</div>

+ 2 - 2
docs/api/math/Box3.html

@@ -112,7 +112,7 @@
 
 
 
 
 
 
-		<h3>[method:Vector3 size]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
+		<h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
 		<div>
 		<div>
 		optionalTarget -- If specified, the result will be copied here.
 		optionalTarget -- If specified, the result will be copied here.
 		</div>
 		</div>
@@ -237,7 +237,7 @@
 		Makes this box empty.
 		Makes this box empty.
 		</div>
 		</div>
 
 
-		<h3>[method:Vector3 center]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
+		<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
 		<div>
 		<div>
 		optionalTarget -- If specified, the result will be copied here.
 		optionalTarget -- If specified, the result will be copied here.
 		</div>
 		</div>

+ 84 - 0
docs/api/math/Interpolant.html

@@ -0,0 +1,84 @@
+<!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>
+
+		<div class="desc">
+		Abstract base class of interpolants over parametric samples.<br /><br />
+
+		The parameter domain is one dimensional, typically the time or a path along a curve defined by the data.<br /><br />
+
+		The sample values can have any dimensionality and derived classes may apply special interpretations to the data.<br /><br />
+
+		This class provides the interval seek in a Template Method, deferring the actual interpolation to derived classes.<br /><br />
+
+		Time complexity is *O(1)* for linear access crossing at most two points and *O(log N)* for random access,
+		where *N* is the number of positions.<br /><br />
+
+		References:	[link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]
+		</div>
+
+
+		<h2>Constructor</h2>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( parameterPositions, sampleValues, sampleSize, resultBuffer )</h3>
+		<div>
+		parameterPositions -- array of positions<br />
+		sampleValues -- array of samples<br />
+		sampleSize -- number of samples<br />
+		resultBuffer -- buffer to store the interpolation results.<br /><br />
+
+		Note: This is not designed to be called directly.
+		</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h3>[property:null parameterPositions]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null resultBuffer]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null sampleValues]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:Object settings]</h3>
+		<div>
+		Optional, subclass-specific settings structure.
+		</div>
+
+		<h3>[property:null valueSize]</h3>
+		<div>
+
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null evaluate]( [page:Number t] )</h3>
+		<div>
+		Evaluate the interpolant at position *t*.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 1 - 1
docs/api/math/Line3.html

@@ -95,7 +95,7 @@
 		Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
 		Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
 		</div>
 		</div>
 
 
-		<h3>[method:Vector3 center]( [page:Vector3 optionalTarget] )</h3>
+		<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3>
 		<div>
 		<div>
 		optionalTarget -- [page:Vector3] Optional target to set the result.
 		optionalTarget -- [page:Vector3] Optional target to set the result.
 		</div>
 		</div>

+ 54 - 26
docs/api/math/Math.html

@@ -26,45 +26,63 @@
 		Clamps the *value* to be between *min* and *max*.
 		Clamps the *value* to be between *min* and *max*.
 		</div>
 		</div>
 
 
-		<h3>[method:Float mapLinear]( [page:Float x], [page:Float a1], [page:Float a2], [page:Float b1], [page:Float b2] )</h3>
+		<h3>[method:Float degToRad]( [page:Float degrees] )</h3>
 		<div>
 		<div>
-		x — Value to be mapped.<br />
-		a1 — Minimum value for range A.<br />
-		a2 — Maximum value for range A.<br />
-		b1 — Minimum value for range B.<br />
-		b2 — Maximum value for range B.
+		degrees -- [page:Float]
 		</div>
 		</div>
 		<div>
 		<div>
-		Linear mapping of *x* from range [*a1*, *a2*] to range [*b1*, *b2*].
+		Converts degrees to radians.
 		</div>
 		</div>
 
 
-		<h3>[method:Float random16]()</h3>
+		<h3>[method:Integer euclideanModulo]( [page:Integer n], [page:Integer m] )</h3>
 		<div>
 		<div>
-		Random float from 0 to 1 with 16 bits of randomness.<br />
-		Standard Math.random() creates repetitive patterns when applied over larger space.
+		n, m --Integers
+		</div>
+		<div>
+		Compute the Euclidian modulo of m % n, that is:
+		<code>( ( n % m ) + m ) % m</code>
 		</div>
 		</div>
 
 
-		<h3>[method:Integer randInt]( [page:Integer low], [page:Integer high] )</h3>
+		<h3>[method:UUID generateUUID]( )</h3>
 		<div>
 		<div>
-		Random integer from *low* to *high* interval.
+		Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID] (universally unique identifier).
 		</div>
 		</div>
 
 
-		<h3>[method:Float randFloat]( [page:Float low], [page:Float high] )</h3>
+		<h3>[method:Boolean isPowerOfTwo]( n )</h3>
 		<div>
 		<div>
-		Random float from *low* to *high* interval.
+		Return *true* if n is a power of 2.
 		</div>
 		</div>
 
 
-		<h3>[method:Float randFloatSpread]( [page:Float range] )</h3>
+		<h3>[method:Float lerp]( [page:Float x], [page:Float y], [page:Float t] )</h3>
 		<div>
 		<div>
-		Random float from *- range / 2* to *range / 2* interval.
+		x -- Start point. <br />
+		y -- End point. <br />
+		t -- Closed unit interval from [0,1].
+		</div>
+		<div>
+		Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated] from two known points based on the given interval.
 		</div>
 		</div>
 
 
-		<h3>[method:Float degToRad]( [page:Float degrees] )</h3>
+		<h3>[method:Float mapLinear]( [page:Float x], [page:Float a1], [page:Float a2], [page:Float b1], [page:Float b2] )</h3>
 		<div>
 		<div>
-		degrees -- [page:Float]
+		x — Value to be mapped.<br />
+		a1 — Minimum value for range A.<br />
+		a2 — Maximum value for range A.<br />
+		b1 — Minimum value for range B.<br />
+		b2 — Maximum value for range B.
 		</div>
 		</div>
 		<div>
 		<div>
-		Converts degrees to radians.
+		Linear mapping of *x* from range [*a1*, *a2*] to range [*b1*, *b2*].
+		</div>
+
+		<h3>[method:Integer nearestPowerOfTwo]( n )</h3>
+		<div>
+		Return the nearest power of 2 to a given number n.
+		</div>
+
+		<h3>[method:Integer nextPowerOfTwo]( n )</h3>
+		<div>
+		Return the nearest power of 2 that is bigger than n.
 		</div>
 		</div>
 
 
 		<h3>[method:Float radToDeg]( [page:Float radians] )</h3>
 		<h3>[method:Float radToDeg]( [page:Float radians] )</h3>
@@ -75,16 +93,25 @@
 		Converts radians to degrees
 		Converts radians to degrees
 		</div>
 		</div>
 
 
-		<h3>[method:Float lerp]( [page:Float x], [page:Float y], [page:Float t] )</h3>
+		<h3>[method:Float randFloat]( [page:Float low], [page:Float high] )</h3>
 		<div>
 		<div>
-		x -- Start point. <br />
-		y -- End point. <br />
-		t -- Closed unit interval from [0,1].
+		Random float from *low* to *high* interval.
 		</div>
 		</div>
+
+		<h3>[method:Float randFloatSpread]( [page:Float range] )</h3>
 		<div>
 		<div>
-		Returns a value interpolated from two known points based on the interval.<br/><br/>
+		Random float from *- range / 2* to *range / 2* interval.
+		</div>
 
 
-		[link:https://en.wikipedia.org/wiki/Linear_interpolation Wikipedia]
+		<h3>[method:Integer randInt]( [page:Integer low], [page:Integer high] )</h3>
+		<div>
+		Random integer from *low* to *high* interval.
+		</div>
+
+		<h3>[method:Float random16]()</h3>
+		<div>
+		Random float from 0 to 1 with 16 bits of randomness.<br />
+		Standard Math.random() creates repetitive patterns when applied over larger space.
 		</div>
 		</div>
 
 
 		<h3>[method:Float smoothstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
 		<h3>[method:Float smoothstep]( [page:Float x], [page:Float min], [page:Float max] )</h3>
@@ -94,7 +121,8 @@
 		max -- Any x value above max will be 1
 		max -- Any x value above max will be 1
 		</div>
 		</div>
 		<div>
 		<div>
-		Returns a value between 0-1 that represents the percentage that x has moved between min and max, but smoothed or slowed down the closer X is to the min and max.<br/><br/>
+		Returns a value between 0-1 that represents the percentage that x has moved between min and max,
+		but smoothed or slowed down the closer X is to the min and max.<br/><br/>
 
 
 		[link:http://en.wikipedia.org/wiki/Smoothstep Wikipedia]
 		[link:http://en.wikipedia.org/wiki/Smoothstep Wikipedia]
 		</div>
 		</div>

+ 70 - 0
docs/api/math/Spherical.html

@@ -0,0 +1,70 @@
+<!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>
+
+		<div class="desc">A point's spherical coordinates.</div>
+
+
+		<h2>Constructor</h2>
+
+
+		<h3>[name]( [page:Float radius], [page:Float phi], [page:Float theta] )</h3>
+		<div>
+		radius -- [page:Float] the radius<br />
+		phi -- [page:Float] polar angle from the y (up) axis<br />
+		theta -- [page:Float] equator angle around the y (up) axis
+		</div>
+		<div>
+		The poles (phi) are at the positive and negative y axis. The equator (theta) starts at positive z.
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<h3>[property:Float radius]</h3>
+
+		<h3>[property:Float phi]</h3>
+
+		<h3>[property:Float theta]</h3>
+
+
+		<h2>Methods</h2>
+
+		<h3>[method:Spherical set]( [page:Float radius], [page:Float phi], [page:Float theta] ) [page:Spherical this]</h3>
+		<div>
+		Sets values of this spherical's component coordinates.
+		</div>
+
+		<h3>[method:Spherical copy]( [page:Spherical s] ) [page:Spherical this]</h3>
+		<div>
+		Copies value of *s* to this spherical.
+		</div>
+
+		<h3>[method:Spherical clone]() [page:Spherical this]</h3>
+		<div>
+		Clones this spherical.
+		</div>
+
+		<h3>[method:Spherical makeSafe]() [page:Spherical this]</h3>
+		<div>
+		Restricts the polar angle phi to be between 0.000001 and pi - 0.000001.
+		</div>
+
+		<h3>[method:Spherical setFromVector3]( [page:Vector3 v] ) [page:Spherical this]</h3>
+		<div>
+		Sets this object from the vector *v*.
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 5 - 0
docs/api/math/Vector3.html

@@ -197,6 +197,11 @@
 		Sets this vector extracting scale from matrix transform.
 		Sets this vector extracting scale from matrix transform.
 		</div>
 		</div>
 
 
+		<h3>[method:Vector3 setFromSpherical]( [page:Spherical s] ) [page:Vector3 this]</h3>
+		<div>
+		Sets this vector from the spherical coordinates *s*.
+		</div>
+
 		<h3>[method:Vector3 clamp]( [page:Vector3 min], [page:Vector3 max] ) [page:Vector3 this]</h3>
 		<h3>[method:Vector3 clamp]( [page:Vector3 min], [page:Vector3 max] ) [page:Vector3 this]</h3>
 		<div>
 		<div>
 		min -- [page:Vector3] <br />
 		min -- [page:Vector3] <br />

+ 87 - 0
docs/api/math/interpolants/CubicInterpolant.html

@@ -0,0 +1,87 @@
+<!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>
+		[page:Interpolant] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+var interpolant = new THREE.[name](
+		new Float32Array( 2 ),
+		new Float32Array( 2 ),
+		1,
+		new Float32Array( 1 )
+);
+
+interpolant.evaluate( 0.5 );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( parameterPositions, sampleValues, sampleSize, resultBuffer )</h3>
+		<div>
+		parameterPositions -- array of positions<br />
+		sampleValues -- array of samples<br />
+		sampleSize -- number of samples<br />
+		resultBuffer -- buffer to store the interpolation results.<br /><br />
+
+
+		</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h3>[property:null parameterPositions]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null resultBuffer]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null sampleValues]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:Object settings]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null valueSize]</h3>
+		<div>
+
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null evaluate]( [page:Number t] )</h3>
+		<div>
+		Evaluate the interpolant at position *t*.
+		</div>
+
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 87 - 0
docs/api/math/interpolants/DiscreteInterpolant.html

@@ -0,0 +1,87 @@
+<!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>
+		[page:Interpolant] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+var interpolant = new THREE.[name](
+		new Float32Array( 2 ),
+		new Float32Array( 2 ),
+		1,
+		new Float32Array( 1 )
+);
+
+interpolant.evaluate( 0.5 );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( parameterPositions, sampleValues, sampleSize, resultBuffer )</h3>
+		<div>
+		parameterPositions -- array of positions<br />
+		sampleValues -- array of samples<br />
+		sampleSize -- number of samples<br />
+		resultBuffer -- buffer to store the interpolation results.<br /><br />
+
+
+		</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h3>[property:null parameterPositions]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null resultBuffer]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null sampleValues]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:Object settings]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null valueSize]</h3>
+		<div>
+
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null evaluate]( [page:Number t] )</h3>
+		<div>
+		Evaluate the interpolant at position *t*.
+		</div>
+
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 87 - 0
docs/api/math/interpolants/LinearInterpolant.html

@@ -0,0 +1,87 @@
+<!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>
+		[page:Interpolant] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+var interpolant = new THREE.[name](
+		new Float32Array( 2 ),
+		new Float32Array( 2 ),
+		1,
+		new Float32Array( 1 )
+);
+
+interpolant.evaluate( 0.5 );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( parameterPositions, sampleValues, sampleSize, resultBuffer )</h3>
+		<div>
+		parameterPositions -- array of positions<br />
+		sampleValues -- array of samples<br />
+		sampleSize -- number of samples<br />
+		resultBuffer -- buffer to store the interpolation results.<br /><br />
+
+
+		</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h3>[property:null parameterPositions]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null resultBuffer]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null sampleValues]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:Object settings]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null valueSize]</h3>
+		<div>
+
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null evaluate]( [page:Number t] )</h3>
+		<div>
+		Evaluate the interpolant at position *t*.
+		</div>
+
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 87 - 0
docs/api/math/interpolants/QuaternionLinearInterpolant.html

@@ -0,0 +1,87 @@
+<!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>
+		[page:Interpolant] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+
+		</div>
+
+		<h2>Example</h2>
+
+		<code>
+var interpolant = new THREE.[name](
+		new Float32Array( 2 ),
+		new Float32Array( 2 ),
+		1,
+		new Float32Array( 1 )
+);
+
+interpolant.evaluate( 0.5 );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( parameterPositions, sampleValues, sampleSize, resultBuffer )</h3>
+		<div>
+		parameterPositions -- array of positions<br />
+		sampleValues -- array of samples<br />
+		sampleSize -- number of samples<br />
+		resultBuffer -- buffer to store the interpolation results.<br /><br />
+
+
+		</div>
+
+		<h2>Properties</h2>
+
+
+
+		<h3>[property:null parameterPositions]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null resultBuffer]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null sampleValues]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:Object settings]</h3>
+		<div>
+
+		</div>
+
+		<h3>[property:null valueSize]</h3>
+		<div>
+
+		</div>
+
+		<h2>Methods</h2>
+
+		<h3>[method:null evaluate]( [page:Number t] )</h3>
+		<div>
+		Evaluate the interpolant at position *t*.
+		</div>
+
+		</div>
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 59 - 0
docs/api/objects/Group.html

@@ -0,0 +1,59 @@
+<!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>
+		[page:Object3D] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">This is almost identical to an [page:Object3D Object3D]. It's purpose is to make working with groups of objects syntactically clearer.</div>
+
+
+		<h2>Example</h2>
+
+		<code>
+		var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 );
+		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
+
+		var cubeA = new THREE.Mesh( geometry, material );
+		cubeA.position.set( 100, 100, 0 );
+
+		var cubeB = new THREE.Mesh( geometry, material );
+		cubeA.position.set( -100, -100, 0 );
+
+		//create a group and add the two cubes
+		//These cubes can now be rotated / scaled etc as a group
+		var group = new THREE.Group();
+		group.add( cubeA );
+		group.add( cubeB )
+
+		scene.add( group );
+		</code>
+
+
+		<h2>Constructor</h2>
+
+		<h3>[name]( )</h3>
+
+		<h2>Properties</h2>
+
+		Properties are identical to an [page:Object3D]'s properties, with the exception of:
+
+		<h3>[property:String type]</h3>
+		<div>A string 'Group'. This should not be changed.</div>
+
+		<h2>Methods</h2>
+
+		Methods are identical to an [page:Object3D]'s methods.
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 10 - 3
docs/api/renderers/CanvasRenderer.html

@@ -11,7 +11,15 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">
 		<div class="desc">
-			The Canvas renderer displays your beautifully crafted scenes <em>not</em> using WebGL, but draws it using the (slower) <a href="http://drafts.htmlwg.org/2dcontext/html5_canvas_CR/Overview.html">Canvas 2D Context</a> API.<br /><br />
+			The Canvas renderer displays your beautifully crafted scenes <em>not</em> using WebGL,
+			but draws it using the (slower) <a href="http://drafts.htmlwg.org/2dcontext/html5_canvas_CR/Overview.html">Canvas 2D Context</a>
+			API.<br /><br />
+
+			<b>
+			NOTE: The Canvas renderer has been deprecated and is no longer part of the Three.js core.
+			</b>
+			If you still need to use it you can find it here: [link:https://github.com/mrdoob/three.js/blob/master/examples/js/[path].js examples/js/[path].js].<br /><br />
+
 			This renderer can be a nice fallback from [page:WebGLRenderer] for simple scenes:
 			This renderer can be a nice fallback from [page:WebGLRenderer] for simple scenes:
 
 
 			<code>
 			<code>
@@ -38,7 +46,6 @@
 			The "Canvas" in CanvasRenderer means it uses Canvas 2D instead of WebGL.<br /><br />
 			The "Canvas" in CanvasRenderer means it uses Canvas 2D instead of WebGL.<br /><br />
 
 
 			Don't confuse either CanvasRenderer with the SoftwareRenderer example, which simulates a screen buffer in a Javascript array.
 			Don't confuse either CanvasRenderer with the SoftwareRenderer example, which simulates a screen buffer in a Javascript array.
-			Because the Canvas renderer is not part of the three.js core, you have to include it from /examples/js/renderers/.
 		</div>
 		</div>
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
@@ -158,6 +165,6 @@
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
-		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/js/[path].js examples/js/[path].js]
 	</body>
 	</body>
 </html>
 </html>

+ 293 - 164
docs/api/renderers/WebGLRenderer.html

@@ -11,120 +11,134 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.</div>
 		<div class="desc">The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.</div>
-		<div class="desc">This renderer has way better performance than [page:CanvasRenderer].</div>
-
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
-
 		<h3>[name]( [page:Object parameters] )</h3>
 		<h3>[name]( [page:Object parameters] )</h3>
 
 
-		<div>parameters is an optional object with properties defining the renderer's behaviour. The constructor also accepts no parameters at all. In all cases, it will assume sane defaults when parameters are missing.</div>
-
 		<div>
 		<div>
-		canvas — A [page:Canvas] where the renderer draws its output.<br />
-		context — The [page:RenderingContext] context to use.<br />
-		precision — Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*. Defaults to *"highp"* if supported by the device.<br />
-		alpha — [page:Boolean], default is *false*.<br />
-		premultipliedAlpha — [page:Boolean], default is *true*.<br />
-		antialias — [page:Boolean], default is *false*.<br />
-		stencil — [page:Boolean], default is *true*.<br />
-		preserveDrawingBuffer — [page:Boolean], default is *false*.<br />
-		depth — [page:Boolean], default is *true*.<br />
-		logarithmicDepthBuffer — [page:Boolean], default is *false*.<br />
+		parameters is an optional object with properties defining the renderer's behaviour.
+			The constructor also accepts no parameters at all. In all cases, it will assume sane defaults
+			when parameters are missing.
 		</div>
 		</div>
 
 
-		<h2>Properties</h2>
-
-		<h3>[property:DOMElement domElement]</h3>
-
-		<div>A [page:Canvas] where the renderer draws its output.<br />
-		This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page.</div>
+		<div>
+		canvas — A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] where the renderer draws its output.
+		This corresponds to the [page:WebGLRenderer.domElement .domElement] property below.<br />
 
 
-		<h3>[property:WebGLRenderingContext context]</h3>
+		context — This can be used to attach the renderer to an existing [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].<br />
 
 
-		<div>The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.</div>
+		precision — Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*. Defaults to *"highp"* if supported by the device.<br />
 
 
-		<h3>[property:Boolean autoClear]</h3>
+		alpha — whether the canvas contains an alpha (transparency) buffer or not. Default is *false*.<br />
 
 
-		<div>Defines whether the renderer should automatically clear its output before rendering.</div>
+		premultipliedAlpha — whether the renderer will assume that colors have premultiplied alpha. Default is *true*.<br />
 
 
+		antialias — whether to perform antialiasing. Default is *false*.<br />
 
 
-		<h3>[property:Boolean autoClearColor]</h3>
+		stencil — whether the drawing buffer has a stencil buffer of at least 8 bits. Default is *true*.<br />
 
 
-		<div>If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.</div>
+		preserveDrawingBuffer — whether to preserve the buffers until manually cleared or overwritten. Default is *false*.<br />
 
 
+		depth — whether the drawing buffer has a depth buffer of at least 16 bits. Default is *true*.<br />
 
 
-		<h3>[property:Boolean autoClearDepth]</h3>
+		logarithmicDepthBuffer —  whether to use a lograthimic depth buffer. Default is *false*.
+		See the [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] example.
+		</div>
 
 
-		<div>If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.</div>
+		<h2>Properties</h2>
 
 
+		<h3>[property:Boolean autoClear]</h3>
+		<div>Defines whether the renderer should automatically clear its output before rendering.</div>
 
 
-		<h3>[property:Boolean autoClearStencil]</h3>
 
 
-		<div>If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.</div>
+		<h3>[property:Boolean autoClearColor]</h3>
+		<div>If autoClear is true, defines whether the renderer should clear the color buffer. Default is *true*.</div>
 
 
 
 
-		<h3>[property:Boolean sortObjects]</h3>
+		<h3>[property:Boolean autoClearDepth]</h3>
+		<div>If autoClear is true, defines whether the renderer should clear the depth buffer. Default is *true*.</div>
 
 
-		<div>Defines whether the renderer should sort objects. Default is true.</div>
 
 
-		<div>Note: Sorting is used to attempt to properly render objects that have some degree of transparency.  By definition, sorting objects may not work in all cases.  Depending on the needs of application, it may be neccessary to turn off sorting and use other methods to deal with transparency rendering e.g. manually determining the object rendering order.</div>
+		<h3>[property:Boolean autoClearStencil]</h3>
+		<div>If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is *true*.</div>
 
 
+		<h3>[property:Object capabilities]</h3>
+		<div>
+		An object containing details about the capabilities of the current [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].<br />
+
+		- [property:Boolean floatFragmentTextures]: whether the context supports the [link:https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float OES_texture_float] extension.
+			According to [link:https://webglstats.com/ WebGLStats], as of February 2016 over 95% of WebGL enabled devices support this.<br />
+		- [property:Boolean floatVertexTextures]: *true* if [property:Boolean floatFragmentTextures] and [property:Boolean vertexTextures] are both true.<br />
+		- [property:Method getMaxAnisotropy](): see [page:WebGLRenderer.getMaxAnisotropy getMaxAnisotropy] below. <br />
+		- [property:Method getMaxPrecision](): see [page:WebGLRenderer.getMaxPrecision getMaxPrecision] below. <br />
+		- [property:Boolean logarithmicDepthBuffer]: *true* if the [property:parameter logarithmicDepthBuffer] was set to true in the constructor and
+		the context supports the [link:https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth EXT_frag_depth] extension.
+			According to [link:https://webglstats.com/ WebGLStats], as of February 2016 around 66% of WebGL enabled devices support this.<br />
+		- [property:Integer maxAttributes]: The value of *gl.MAX_VERTEX_ATTRIBS*.<br />
+		- [property:Integer maxCubemapSize]: The value of *gl.MAX_CUBE_MAP_TEXTURE_SIZE*.
+		Maximum height * width of cube map textures that a shader can use.<br />
+		- [property:Integer maxFragmentUniforms]: The value of *gl.MAX_FRAGMENT_UNIFORM_VECTORS*.
+		  The number of uniforms that can be used by a fragment shader.<br />
+		- [property:Integer maxTextureSize]: The value of *gl.MAX_TEXTURE_SIZE*.
+		Maximum height * width of a texture that a shader use.<br />
+		- [property:Integer maxTextures]: The value of *gl.MAX_TEXTURE_IMAGE_UNITS*.
+		  The maximum number of textures that can be used by a shader.<br />
+		- [property:Integer maxVaryings]: The value of *gl.MAX_VARYING_VECTORS*.
+		  The number of varying vectors that can used by shaders.<br />
+		- [property:Integer maxVertexTextures]: The value of *gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS*.
+		   The number of textures that can be used in a vertex shader.<br />
+		- [property:Integer maxVertexUniforms]: The value of *gl.MAX_VERTEX_UNIFORM_VECTORS*.
+		   The maximum number of uniforms that can be used in a vertex shader.<br />
+		- [property:String precision]: The shader precision currently being used by the renderer.<br />
+		- [property:Boolean vertexTextures]: *true* if [property:Integer maxVertexTextures] is greater than 0 (i.e. vertext textures can be used).<br />
+		</div>
 
 
 		<h3>[property:Array clippingPlanes]</h3>
 		<h3>[property:Array clippingPlanes]</h3>
-
-		<div>User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply globally. Points in space whose dot product with the plane is negative are cut away. Default is [].</div>
-
-		<h3>[property:Boolean localClippingEnabled]</h3>
-
-		<div>Defines whether the renderer respects object-level clipping planes. Default is false.</div>
-
-
-
-		<h3>[property:Boolean gammaInput]</h3>
-
-		<div>Default is false. If set, then it expects that all textures and colors are premultiplied gamma.</div>
-
-
-		<h3>[property:Boolean gammaOutput]</h3>
-
-		<div>Default is false.  If set, then it expects that all textures and colors need to be outputted in premultiplied gamma.</div>
-
-		<h3>[property:WebGLShadowMap shadowMap]</h3>
 		<div>
 		<div>
-		This contains the reference to the component implementing shadow mapping.
+		User-defined clipping planes specified as THREE.Plane objects in world space.
+			These planes apply globally. Points in space whose dot product with the plane is negative are cut away.
+		 Default is [].
 		</div>
 		</div>
 
 
-		<h3>[property:Boolean shadowMap.enabled]</h3>
-
-		<div>Default is false. If set, use shadow maps in the scene.</div>
-
-		<h3>[property:Integer shadowMap.type]</h3>
-
-		<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
-		<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap, THREE.PCFSoftShadowMap. Default is THREE.PCFShadowMap.</div>
-
-		<h3>[property:Boolean shadowMap.renderReverseSided]</h3>
-
-		<div>Default is true. Whether to render the opposite side as specified by the material into the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>
+		<h3>[property:WebGLRenderingContext context]</h3>
+		<div>
+		The renderer obtains a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext] context
+		  from its [page:WebGLRenderer.domElement domElement][page:WebGLRenderer.domElement domElement] by default, using
+			[link:https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext HTMLCanvasElement.getContext]()</a>.<br /><br />
 
 
-		<h3>[property:Boolean shadowMap.renderSingleSided]</h3>
+		You can create this manually, however it must correspond to the
+		[page:WebGLRenderer.domElement domElement] in order to render to the screen.
+		</div>
 
 
-		<div>Default is true. Whether to treat materials specified as double-sided as if they were specified as front-sided when rendering the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>
+		<h3>[property:DOMElement domElement]</h3>
+		<div>
+		A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] where the renderer draws its output.<br />
+			This is automatically created by the renderer in the constructor (if not provided already);
+			you just need to add it to your page like so:<br />
+		<code>
+			document.body.appendChild( renderer.domElement );
+		</code>
+	  </div>
 
 
-		<h3>[property:Integer maxMorphTargets]</h3>
+		<h3>[property:Object extensions]</h3>
+		<div>
+		A wrapper for the [page:WebGLRenderer.extensions.get .extensions.get] method, used to check whether
+		various WebGL extensions are supported.
+		</div>
 
 
-		<div>Default is 8. The maximum number of MorphTargets allowed in a shader. Keep in mind that the standard materials only allow 8 MorphTargets.</div>
+		<h3>[property:Boolean gammaFactor]</h3>
+		<div>Default is *2*. </div>
 
 
 
 
-		<h3>[property:Integer maxMorphNormals]</h3>
+		<h3>[property:Boolean gammaInput]</h3>
+		<div>If set, then it expects that all textures and colors are premultiplied gamma. Default is *false*.</div>
 
 
-		<div>Default is 4. The maximum number of MorphNormals allowed in a shader. Keep in mind that the standard materials only allow 4 MorphNormals. </div>
 
 
+		<h3>[property:Boolean gammaOutput]</h3>
+		<div>If set, then it expects that all textures and colors need to be outputted in premultiplied gamma. Default is *false*.</div>
 
 
 		<h3>[property:Object info]</h3>
 		<h3>[property:Object info]</h3>
-
 		<div>An object with a series of statistical information about the graphics board memory and the rendering process. Useful for debugging or just for the sake of curiosity. The object contains the following fields:</div>
 		<div>An object with a series of statistical information about the graphics board memory and the rendering process. Useful for debugging or just for the sake of curiosity. The object contains the following fields:</div>
 		<div>
 		<div>
 		<ul>
 		<ul>
@@ -147,167 +161,282 @@
 		</ul>
 		</ul>
 		</div>
 		</div>
 
 
-		<h2>Methods</h2>
+		<h3>[property:Boolean localClippingEnabled]</h3>
+		<div>Defines whether the renderer respects object-level clipping planes. Default is *false*.</div>
 
 
-		<h3>[method:WebGLRenderingContext getContext]()</h3>
+		<h3>[property:Integer maxMorphTargets]</h3>
 		<div>
 		<div>
-		Return the WebGL context.
+		Default is 8. The maximum number of MorphTargets allowed in a shader.
+			Keep in mind that the standard materials only allow 8 MorphTargets.
 		</div>
 		</div>
 
 
-		<h3>[method:WebGLContextAttributes getContextAttributes]()</h3>
+		<h3>[property:Integer maxMorphNormals]</h3>
 		<div>
 		<div>
-		Returns an object that describes the attributes set on the WebGL context when it was created.
+		Default is 4. The maximum number of MorphNormals allowed in a shader.
+			Keep in mind that the standard materials only allow 4 MorphNormals.
 		</div>
 		</div>
 
 
-		<h3>[method:Boolean supportsVertexTextures]()</h3>
+		<h3>[property:Integer physicallyCorrectLights]</h3>
 		<div>
 		<div>
-		Return a [page:Boolean] true if the context supports vertex textures.
+		Whether to use physically correct lighting mode. Default is *false*.
+		See the [example:webgl_lights_physical lights / physical] example.
 		</div>
 		</div>
 
 
-		<h3>[method:number getPixelRatio]()</h3>
-		<div>Returns current device pixel ratio used.</div>
+		<h3>[property:Object properties]</h3>
+		<div>
+		Used internally by the renderer to keep track of various sub object properties.
+		</div>
 
 
-		<h3>[method:null setPixelRatio]( [page:number value] )</h3>
-		<div>Sets device pixel ratio. This is usually used for HiDPI device to prevent bluring output canvas.</div>
+		<h3>[property:WebGLShadowMap shadowMap]</h3>
+		<div>
+		This contains the reference to the shadow map, if used.
+		</div>
 
 
-		<h3>[method:Object getSize]()</h3>
-		<div>Returns an object containing the width and height of the renderer's output canvas, in pixels.</div>
+		<h3>[property:Boolean shadowMap.enabled]</h3>
+		<div>If set, use shadow maps in the scene. Default is *false*.</div>
 
 
-		<h3>[method:null setSize]( [page:Integer width], [page:Integer height], [page:Boolean updateStyle] )</h3>
-		<div>Resizes the output canvas to (width, height) with device pixel ratio taken into account, and also sets the viewport to fit that size, starting in (0, 0). Setting updateStyle to true adds explicit pixel units to the output canvas style.</div>
+		<h3>[property:Integer shadowMap.type]</h3>
+		<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
+		<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap (default), THREE.PCFSoftShadowMap. See [page:WebGLRenderer WebGLRenderer constants] for details.</div>
 
 
-		<h3>[method:null setViewport]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
-		<div>Sets the viewport to render from (x, y) to (x + width, y + height).</div>
+		<h3>[property:Boolean shadowMap.renderReverseSided]</h3>
+		<div>
+		Whether to render the opposite side as specified by the material into the shadow map.
+			When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can
+			both cast and receive shadows at the same time to render correctly. Default is *true*.
+		</div>
 
 
+		<h3>[property:Boolean shadowMap.renderSingleSided]</h3>
+		<div>
+		Whether to treat materials specified as double-sided as if they were specified as front-sided
+		when rendering the shadow map. When disabled, an appropriate shadow.bias must be set on the light
+		source for surfaces that can both cast and receive shadows at the same time to render correctly.
+		Default is *true*.
+		</div>
 
 
-		<h3>[method:null setScissor]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
-		<div>Sets the scissor area from (x, y) to (x + width, y + height).</div>
+		<h3>[property:Boolean sortObjects]</h3>
+		<div>
+		Defines whether the renderer should sort objects. Default is *true*.<br /><br />
 
 
-		<div>NOTE: The point (x, y) is the lower left corner of the area to be set for both of these methods. The area is defined from left to right in width but bottom to top in height. The sense of the vertical definition is opposite to the fill direction of an HTML canvas element.</div>
+		Note: Sorting is used to attempt to properly render objects that have some degree of transparency.
+		By definition, sorting objects may not work in all cases.  Depending on the needs of application,
+		it may be neccessary to turn off sorting and use other methods to deal with transparency
+		rendering e.g. manually determining each object's rendering order.
+		</div>
 
 
-		<h3>[method:null setScissorTest]( [page:Boolean boolean] )</h3>
-		<div>Enable or disable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.</div>
+		<h3>[property:Object state]</h3>
+		<div>
+		Contains functions for setting various properties of the [page:WebGLRenderer.context] state.
+		</div>
 
 
-		<h3>[method:null setClearColor]( [page:Color color], [page:Float alpha] )</h3>
-		<div>Sets the clear color and opacity.</div>
+		<h3>[property:Constant toneMapping]</h3>
+		<div>
+		Default is [page:Renderer LinearToneMapping]. See the [page:Renderer Renderer constants] for other choices.
+		</div>
 
 
-		<code>// Creates a renderer with red background
-		var renderer = new THREE.WebGLRenderer();
-		renderer.setSize( 200, 100 );
-		renderer.setClearColor( 0xff0000 );
-		</code>
+		<h3>[property:Number toneMappingExposure]</h3>
+		<div>
+		Exposure level of tone mapping. Default is *1*.
+		</div>
 
 
-		<h3>[method:Color getClearColor]()</h3>
-		<div>Returns a [page:Color THREE.Color] instance with the current clear color.</div>
+		<h3>[property:Number toneMappingWhitePoint]</h3>
+		<div>
+		Tone mapping white point. Default is *1*.
+		</div>
 
 
-		<h3>[method:Float getClearAlpha]()</h3>
-		<div>Returns a [page:Float float] with the current clear alpha. Ranges from 0 to 1.</div>
+		<h2>Methods</h2>
+
+		<h3>[method:Integer allocTextureUnit]</h3>
+		<div>
+		Attempt to allocate a texture unit for use by a shader. Will warn if trying to allocate
+		more texture units than the GPU supports. This is mainly used internally.
+		See [page:WebGLRenderer.capabilities capabilities.maxTextures].
+		</div>
 
 
 		<h3>[method:null clear]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
 		<h3>[method:null clear]( [page:Boolean color], [page:Boolean depth], [page:Boolean stencil] )</h3>
-		<div>Tells the renderer to clear its color, depth or stencil drawing buffer(s). This method initializes the color buffer to the current clear color value.</div>
-		<div>Arguments default to true.</div>
+		<div>
+		Tells the renderer to clear its color, depth or stencil drawing buffer(s).
+			This method initializes the color buffer to the current clear color value.<br />
+		Arguments default to *true*.
+		</div>
 
 
-		<h3>[method:null renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
-		<div>object — an instance of [page:Object3D]<br />
-		program — an instance of shaderProgram<br />
-		shading — an instance of Material<br />
+		<h3>[method:null clearColor]( )</h3>
+		<div>Clear the color buffer. Equivalent to calling [page:WebGLRenderer.clear .clear]( true, false, false ).</div>
+
+		<h3>[method:null clearDepth]( )</h3>
+		<div>Clear the depth buffer. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, true, false ).</div>
+
+		<h3>[method:null clearStencil]( )</h3>
+		<div>Clear the stencil buffers. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, false, true ).</div>
+
+		<h3>[method:null clearTarget]([page:WebGLRenderTarget renderTarget], [page:boolean color], [page:boolean depth], [page:boolean stencil])</h3>
+		<div>
+		renderTarget -- The [page:WebGLRenderTarget renderTarget] that needs to be cleared.<br />
+		color -- If set, then the color gets cleared. <br />
+		depth -- If set, then the depth gets cleared. <br />
+		stencil -- If set, then the stencil gets cleared.
 		</div>
 		</div>
 		<div>
 		<div>
-		Render an immediate buffer. Gets called by renderImmediateObject.
+		This method clears a rendertarget. To do this, it activates the rendertarget.
 		</div>
 		</div>
 
 
+		<h3>[method:null dispose]( )</h3>
+		<div>Dispose of the current rendering context.</div>
 
 
-		<h3>[method:null renderBufferDirect]( [page:Camera camera], [page:Array lights], [page:Fog fog], [page:Material material], [page:Object geometryGroup], [page:Object3D object] )</h3>
-		<div>Render a buffer geometry group using the camera and with the correct material.</div>
+		<h3>[method:Object extensions.get]( [page:String extensionName] )</h3>
+		<div>
+		Used to check whether various extensions are supported and returns an object with details of the extension if available.
+		This method can check for the following extensions:<br /><br />
+
+		- *WEBGL_depth_texture*<br />
+		- *EXT_texture_filter_anisotropic*<br />
+		- *WEBGL_compressed_texture_s3tc*<br />
+		- *WEBGL_compressed_texture_pvrtc*<br />
+		- *WEBGL_compressed_texture_etc1*
+		</div>
+
+		<h3>[method:null forceContextLoss]( )</h3>
+		<div>
+		Simulate loss of the WebGL context. This requires support for the
+			[link:https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context WEBGL_lose_context] extensions.
+		According to [link:https://webglstats.com/ WebGLStats], as of February 2016 90% of WebGL enabled devices support this.
+		</div>
+
+		<h3>[method:Float getClearAlpha]()</h3>
+		<div>Returns a [page:Float float] with the current clear alpha. Ranges from 0 to 1.</div>
 
 
+		<h3>[method:Color getClearColor]()</h3>
+		<div>Returns a [page:Color THREE.Color] instance with the current clear color.</div>
 
 
-		<h3>[method:null renderBuffer]( [page:Camera camera], [page:Array lights], [page:Fog fog], [page:Material material], [page:Object geometryGroup], [page:Object3D object] )</h3>
-		<div>Render a geometry group using the camera and with the correct material.</div>
+		<h3>[method:WebGLRenderingContext getContext]()</h3>
+		<div>Return the current WebGL context.</div>
 
 
+		<h3>[method:WebGLContextAttributes getContextAttributes]()</h3>
+		<div>Returns an object that describes the attributes set on the WebGL context when it was created.</div>
 
 
-		<h3>[method:null render]( [page:Scene scene], [page:Camera camera], [page:WebGLRenderTarget renderTarget], [page:Boolean forceClear] )</h3>
-		<div>Render a scene using a camera.</div>
-		<div>The render is done to the renderTarget (if specified) or to the canvas as usual.</div>
-		<div>If forceClear is true, the depth, stencil and color buffers will be cleared before rendering even if the renderer's autoClear property is false.</div>
-		<div>Even with forceClear set to true you can prevent certain buffers being cleared by setting either the .autoClearColor, .autoClearStencil or .autoClearDepth properties to false.</div>
+		<h3>[method:RenderTarget getCurrentRenderTarget](  )</h3>
+		<div>Returns the current RenderTarget, if any.</div>
 
 
-		<h3>[method:null readRenderTargetPixels]( [page:WebGLRenderTarget renderTarget], [page:Float x], [page:Float y], [page:Float width], [page:Float height], buffer )</h3>
-		<div>Reads the pixel data from the renderTarget into the buffer you pass in. Buffer should be a Javascript Uint8Array instantiated with new Uint8Array( renderTargetWidth * renderTargetWidth * 4 ) to account for size and color information. This is a wrapper around gl.readPixels.</div>
+		<h3>[method:Number getMaxAnisotropy]()</h3>
+		<div>This returns the anisotropy level of the textures.</div>
 
 
-		<h3>[method:null renderImmediateObject]( camera, lights, fog, material, object )</h3>
-		<div>Renders an immediate Object using a camera.</div>
+		<h3>[method:number getPixelRatio]()</h3>
+		<div>Returns current device pixel ratio used.</div>
+
+		<h3>[method:string getPrecision]()</h3>
+		<div>This gets the precision used by the shaders. It returns "highp","mediump" or "lowp".</div>
 
 
+		<h3>[method:Object getSize]()</h3>
+		<div>Returns an object containing the width and height of the renderer's output canvas, in pixels.</div>
 
 
-		<h3>[method:null setFaceCulling]( cullFace, frontFace )</h3>
+		<h3>[method:null resetGLState]( )</h3>
+		<div>Reset the GL state to default. Called internally if the WebGL context is lost.</div>
+
+		<h3>[method:null readRenderTargetPixels]( [page:WebGLRenderTarget renderTarget], [page:Float x], [page:Float y], [page:Float width], [page:Float height], buffer )</h3>
+		<div>Reads the pixel data from the renderTarget into the buffer you pass in.
+			Buffer should be a Javascript Uint8Array instantiated with
+			new Uint8Array( renderTargetWidth * renderTargetWidth * 4 ) to account for size and color
+			information. This is a wrapper around gl.readPixels.<br />
+		See the [example:webgl_interactive_cubes_gpu interactive / cubes / gpu] example.
+		</div>
+
+		<h3>[method:null render]( [page:Scene scene], [page:Camera camera], [page:WebGLRenderTarget renderTarget], [page:Boolean forceClear] )</h3>
 		<div>
 		<div>
-		[page:String cullFace] —- "back", "front", "front_and_back", or false.<br />
-		[page:String frontFace] —- "ccw" or "cw<br />
+			Render a [page:Scene scene] using a [page:Camera camera].<br />
+
+			The render is done to the [page:WebGLRenderTarget renderTarget] (if specified) or to the canvas as usual.<br />
+
+			If [page:Boolean forceClear] is *true*, the depth, stencil and color buffers will be cleared
+			before rendering even if the renderer's [page:WebGLRenderer.autoClear autoClear] property is false.<br />
+
+			Even with forceClear set to true you can prevent certain buffers being cleared by setting
+			either the [page:WebGLRenderer.autoClearColor autoClearColor], [page:WebGLRenderer.autoClearStencil autoClearStencil] or [page:WebGLRenderer.autoClearDepth autoClearDepth] properties to false.
 		</div>
 		</div>
-		<div>Used for setting the gl frontFace, cullFace states in the GPU, thus enabling/disabling face culling when rendering.</div>
-		<div>If cullFace is false, culling will be disabled.</div>
 
 
+		<h3>[method:null renderBufferDirect]( [page:Camera camera], [page:Array lights], [page:Fog fog], [page:Material material], [page:Object geometryGroup], [page:Object3D object] )</h3>
+		<div>Render a buffer geometry group using the camera and with the specified material.</div>
 
 
-		<h3>[method:null setTexture]( [page:Texture texture], [page:number slot] )</h3>
-		<div>
-		texture -- The [page:Texture texture] that needs to be set.<br />
-		slot -- The number indicating which slot should be used by the texture.
+		<h3>[method:null renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
+		<div>object — an instance of [page:Object3D]<br />
+		program — an instance of shaderProgram<br />
+		shading — an instance of Material<br /><br />
+
+		Render an immediate buffer. Gets called by renderImmediateObject.
 		</div>
 		</div>
+
+		<h3>[method:null setClearAlpha]( [page:Float alpha] )</h3>
+		<div>Sets the clear alpha. Valid input is a float between *0.0* and *1.0*.</div>
+
+		<h3>[method:null setClearColor]( [page:Color color], [page:Float alpha] )</h3>
+		<div>Sets the clear color and opacity.</div>
+
+		<h3>[method:null setFaceCulling]( [page:Renderer cullFace], [page:Renderer frontFace] )</h3>
 		<div>
 		<div>
-		This method sets the correct texture to the correct slot for the wegl shader. The slot number can be found as a value of the uniform of the sampler.
+		See [page:Renderer WebGLRenderer constants] for all possible values for [page:Renderer cullFace] and [page:Renderer frontFace].<br />
+		Used for setting the gl.frontFace and gl.cullFace states in the GPU, thus enabling/disabling face culling when rendering.<br />
+		If cullFace is set to [page:Renderer CullFaceNone], culling will be disabled.<br />
 		</div>
 		</div>
 
 
+		<h3>[method:null setPixelRatio]( [page:number value] )</h3>
+		<div>Sets device pixel ratio. This is usually used for HiDPI device to prevent bluring output canvas.</div>
+
 		<h3>[method:null setRenderTarget]( [page:WebGLRenderTarget renderTarget] )</h3>
 		<h3>[method:null setRenderTarget]( [page:WebGLRenderTarget renderTarget] )</h3>
 		<div>
 		<div>
-		renderTarget -- The [page:WebGLRenderTarget renderTarget] that needs to be activated (optional).<br />
-		</div>
-		<div>
+		renderTarget -- The [page:WebGLRenderTarget renderTarget] that needs to be activated (optional).<br /><br />
 		This method sets the active rendertarget. If the parameter is omitted the canvas is set as the active rendertarget.
 		This method sets the active rendertarget. If the parameter is omitted the canvas is set as the active rendertarget.
 		</div>
 		</div>
 
 
-		<h3>[method:boolean supportsCompressedTextureS3TC]()</h3>
+		<h3>[method:null setScissor]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
 		<div>
 		<div>
-		This method returns true if the webgl implementation supports compressed textures of the format S3TC.
+		Sets the scissor area from (x, y) to (x + width, y + height)
 		</div>
 		</div>
 
 
-		<h3>[method:number getMaxAnisotropy]()</h3>
+		<h3>[method:null setScissorTest]( [page:Boolean boolean] )</h3>
 		<div>
 		<div>
-		This returns the anisotropy level of the textures.
-		</div>
+		Enable or disable the scissor test. When this is enabled, only the pixels within
+			the defined scissor area will be affected by further renderer actions..<br /><br />
 
 
-		<h3>[method:string getPrecision]()</h3>
-		<div>
-		This gets the precision used by the shaders. It returns "highp","mediump" or "lowp".
+		NOTE: The point (x, y) is the lower left corner of the area to be set for both of these methods.
+			The area is defined from left to right in width but bottom to top in height.
+			The sense of the vertical definition is opposite to the fill direction of an HTML canvas element.
 		</div>
 		</div>
 
 
-		<h3>[method:null setMaterialFaces]([page:Material material])</h3>
-		<div>
-		material -- The [page:Material material] with side that shouldn't be culled.
-		</div>
+		<h3>[method:Boolean supportsVertexTextures]()</h3>
 		<div>
 		<div>
-		This sets which side needs to be culled in the webgl renderer.
+		Return a [page:Boolean] true if the context supports vertex textures.
+		This has been deprecated in favour of [page:WebGLRenderer.capabilities capabilities.vertexTexures].
 		</div>
 		</div>
 
 
-		<h3>[method:boolean supportsStandardDerivatives]()</h3>
+		<h3>[method:null setSize]( [page:Integer width], [page:Integer height], [page:Boolean updateStyle] )</h3>
 		<div>
 		<div>
-		This method returns true if the webgl implementation supports standard derivatives.
+		Resizes the output canvas to (width, height) with device pixel ratio taken into account,
+			and also sets the viewport to fit that size, starting in (0, 0).
+			Setting [page:Boolean updateStyle] to true adds explicit pixel units to the output canvas style.
 		</div>
 		</div>
 
 
-		<h3>[method:boolean supportsFloatTextures]()</h3>
+		<h3>[method:null setTexture2D]( [page:Texture texture], [page:number slot] )</h3>
 		<div>
 		<div>
-		This method returns true if the webgl implementation supports float textures.
-		</div>
+		texture -- The [page:Texture texture] that needs to be set.<br />
+		slot -- The number indicating which slot should be used by the texture.<br /><br />
 
 
-		<h3>[method:null clearTarget]([page:WebGLRenderTarget renderTarget], [page:boolean color], [page:boolean depth], [page:boolean stencil])</h3>
-		<div>
-		renderTarget -- The [page:WebGLRenderTarget renderTarget] that needs to be cleared.<br />
-		color -- If set, then the color gets cleared. <br />
-		depth -- If set, then the depth gets cleared. <br />
-		stencil -- If set, then the stencil gets cleared.
+		This method sets the correct texture to the correct slot for the WebGL shader.
+		The slot number can be found as a value of the uniform of the sampler.<br /><br />
+
+		Note: This method replaces the older [method:null setTexture] method.
 		</div>
 		</div>
+
+		<h3>[method:null setTextureCube]( [page:CubeTexture cubeTexture], [page:Number slot] )</h3>
 		<div>
 		<div>
-		This method clears a rendertarget. To do this, it activates the rendertarget.
+		texture -- The [page:CubeTexture cubeTexture] that needs to be set.<br />
+		slot -- The number indicating which slot should be used by the texture.<br /><br />
+
+		This method sets the correct texture to the correct slot for the WebGL shader.
+		The slot number can be found as a value of the uniform of the sampler.
 		</div>
 		</div>
 
 
+		<h3>[method:null setViewport]( [page:Integer x], [page:Integer y], [page:Integer width], [page:Integer height] )</h3>
+		<div>Sets the viewport to render from (x, y) to (x + width, y + height).</div>
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 8 - 5
docs/api/scenes/Fog.html

@@ -14,7 +14,7 @@
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
-		
+
 
 
 		<h3>[name]( [page:Integer hex], [page:Float near], [page:Float far] )</h3>
 		<h3>[name]( [page:Integer hex], [page:Float near], [page:Float far] )</h3>
 		<div>The hex parameter is passed to the [page:Color] constructor to set the color property.  Hex can be a hexadecimal integer or a CSS-style string.</div>
 		<div>The hex parameter is passed to the [page:Color] constructor to set the color property.  Hex can be a hexadecimal integer or a CSS-style string.</div>
@@ -22,7 +22,7 @@
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>[property:String name]</h3>
 		<h3>[property:String name]</h3>
-		<div>Default is the empty string.</div>
+		<div>Optional name of the object (doesn't need to be unique). Default is an empty string.</div>
 
 
 		<h3>[property:Color color]</h3>
 		<h3>[property:Color color]</h3>
 		<div>Fog color.  Example: If set to black, far away objects will be rendered black.</div>
 		<div>Fog color.  Example: If set to black, far away objects will be rendered black.</div>
@@ -30,15 +30,18 @@
 		<h3>[property:Float near]</h3>
 		<h3>[property:Float near]</h3>
 		<div>The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.</div>
 		<div>The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.</div>
 		<div>Default is 1.</div>
 		<div>Default is 1.</div>
-		
+
 		<h3>[property:Float far]</h3>
 		<h3>[property:Float far]</h3>
 		<div>The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.</div>
 		<div>The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.</div>
 		<div>Default is 1000.</div>
 		<div>Default is 1000.</div>
-		
+
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 		<h3>[method:Fog clone]()</h3>
 		<h3>[method:Fog clone]()</h3>
-		<div>Returns a copy of this.</div>
+		<div>Returns a new fog instance with the same parameters as this one.</div>
+
+		<h3>[method:Fog toJSON]()</h3>
+		<div>Return fog data in JSON format.</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 5 - 3
docs/api/scenes/FogExp2.html

@@ -22,7 +22,7 @@
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
 		<h3>[property:String name]</h3>
 		<h3>[property:String name]</h3>
-		<div>Default is the empty string.</div>
+		<div>Optional name of the object (doesn't need to be unique). Default is an empty string.</div>
 
 
 		<h3>[property:Color color]</h3>
 		<h3>[property:Color color]</h3>
 		<div>Fog color. Example: If set to black, far away objects will be rendered black.</div>
 		<div>Fog color. Example: If set to black, far away objects will be rendered black.</div>
@@ -32,10 +32,12 @@
 		<div>Default is 0.00025.</div>
 		<div>Default is 0.00025.</div>
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
-		
+
 		<h3>[method:FogExp2 clone]()</h3>
 		<h3>[method:FogExp2 clone]()</h3>
-		<div>Returns a copy of this.</div>
+		<div>Returns a new FogExp2 instance with the same parameters as this one.</div>
 
 
+		<h3>[method:FogExp2 toJSON]()</h3>
+		<div>Return FogExp2 data in JSON format.</div>
 
 
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 

+ 5 - 0
docs/api/scenes/Scene.html

@@ -46,6 +46,11 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
+		<h3>[method:JSON toJSON]</h3>
+		<div>
+		Return the scene data in JSON format.
+		</div>
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 77 - 0
docs/api/textures/CanvasTexture.html

@@ -0,0 +1,77 @@
+<!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>
+		[page:Texture] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Creates a texture from a canvas element.<br /><br />
+
+		This is almost the same as the base [page:Texture Texture] class, except that it sets [page:Texture.needsUpdate needsUpdate] to *true* immediately.
+		</div>
+
+
+		<h2>Constructor</h2>
+		<h3>[name]( [page:HTMLElement canvas], [page:Constant mapping], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Constant format], [page:Constant type], [page:Number anisotropy] )</h3>
+		<div>
+		[page:HTMLElement canvas] -- The HTML canvas element from which to load the texture. <br />
+
+		[page:Constant mapping] --  How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
+		See [page:Textures mapping constants] for other choices.<br />
+
+		[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+    [page:Constant format] -- The format used in the texture.
+     See [page:Textures format constants] for other choices.<br />
+
+    [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
+     See [page:Textures type constants] for other choices.<br />
+
+		[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+		By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+		Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+    See the base [page:Texture Texture] class for common properties.
+    </div>
+
+		<h3>[property:boolean needsUpdate]</h3>
+
+		<div>
+			True by default. This is required so that the canvas data is loaded.
+		</div>
+
+		<h2>Methods</h2>
+
+    <div>
+    See the base [page:Texture Texture] class for common methods.
+    </div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 41 - 17
docs/api/textures/CompressedTexture.html

@@ -13,41 +13,65 @@
 		<h1>[name]</h1>
 		<h1>[name]</h1>
 
 
 		<div class="desc">
 		<div class="desc">
-			Creates a texture based on data in compressed form.
+		Creates a texture based on data in compressed form, for example from a <a href="https://en.wikipedia.org/wiki/DirectDraw_Surface">DDS</a> file.<br /><br />
+
+		
+		For use with the [page:CompressedTextureLoader CompressedTextureLoader].
 		</div>
 		</div>
 
 
 
 
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>
 
 
 
 
-		<h3>[name]( [page:Array mipmaps], [page:Number width], [page:Number height], [page:Number format], [page:Number type], [page:Number mapping], [page:Number wrapS], [page:Number wrapT], [page:Number magFilter], [page:Number minFilter], [page:Number anisotropy] )</h3>
-		<div>
-		mipmaps -- The mipmaps array should contains objects with data, width and height. The mipmaps should be from of the correct format and type. <br />
-		width -- The width of the biggest mipmap<br />
-		height -- The height of the biggest mipmap <br />
-		format -- The format used in the mipmaps <br />
-		type -- The type used in the mipmaps <br />
-		mapping --  How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.<br />
-		wrapS -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
-		wrapT -- The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.<br />
-		magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texels.<br />
-		minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.<br />
-		anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.</div>
+		<h3>[name]( [page:Array mipmaps], [page:Number width], [page:Number height], [page:Constant format], [page:Constant type], [page:Constant mapping], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Number anisotropy] )</h3>
 		<div>
 		<div>
-		This creates a texture from compressed data. This is mostly used in ImageUtils.loadCompressedTexture.
+		[page:Array mipmaps] -- The mipmaps array should contains objects with data, width and height. The mipmaps should be from of the correct format and type. <br />
+
+		[page:Number width] -- The width of the biggest mipmap<br />
+
+		[page:Number height] -- The height of the biggest mipmap <br />
+
+		[page:Constant format] -- The format used in the mipmaps.
+		See [page:Textures ST3C Compressed Texture Formats],
+		[page:Textures PVRTC Compressed Texture Formats] and
+		[page:Textures ETC Compressed Texture Format] for other choices.<br />
+
+		[page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
+		See [page:Textures type constants] for other choices.<br />
+
+		[page:Constant mapping] --  How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
+		See [page:Textures mapping constants] for other choices.<br />
+
+		[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+		[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+		By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+		Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
 		</div>
 		</div>
 
 
 
 
 		<h2>Properties</h2>
 		<h2>Properties</h2>
 
 
+		See the base [page:Texture Texture] class for common properties.
+
 		<h3>[property:boolean flipY]</h3>
 		<h3>[property:boolean flipY]</h3>
-		
+
 		<div>
 		<div>
 			False by default. Flipping textures does not work for compressed textures.
 			False by default. Flipping textures does not work for compressed textures.
 		</div>
 		</div>
 
 
 		<h3>[property:boolean generateMipmaps]</h3>
 		<h3>[property:boolean generateMipmaps]</h3>
-		
+
 		<div>
 		<div>
 			False by default. Mipmaps can't be generated for compressed textures
 			False by default. Mipmaps can't be generated for compressed textures
 		</div>
 		</div>

+ 118 - 0
docs/api/textures/DepthTexture.html

@@ -0,0 +1,118 @@
+<!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>
+		[page:Texture] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Creates a texture for use as a Depth Texture. Require support for the
+    <a href="https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/">WEBGL_depth_texture</a>
+    extension. According to <a href="https://webglstats.com/">WebGLStats</a>, as of February 2016 around 85%
+    of WebGL enabled devices support this.
+    <br /><br />
+
+			</div>
+
+    <h2>Example</h2>
+
+    [example:webgl_depth_texture depth / texture]
+
+		<h2>Constructor</h2>
+		<h3>[name]( [page:Number width], [page:Number height], [page:Constant type], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Number anisotropy], [page:Constant format] )</h3>
+
+    <div>
+		[page:Number width] -- width of the texture.<br />
+
+		[page:Number height] -- height of the texture.<br />
+
+    [page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType].
+     See [page:Textures type constants] for other choices.<br />
+
+    [page:Constant mapping] --
+    See [page:Textures type constants] for details.<br />
+
+    [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.NearestFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+     [page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+     By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+     Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br />
+
+    [page:Constant format] -- must be either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
+     See [page:Textures format constants] for details.<br />
+
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+    See the base [page:Texture Texture] class for common properties
+    - the following are also part of the texture class, but have different defaults here.
+    </div>
+
+		<h3>[page:Texture.format .format]</h3>
+		<div>
+    Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
+    See [page:Textures format constants] for details.<br />
+		</div>
+
+    <h3>[page:Texture.type .type]</h3>
+    <div>
+    Default is [page:Textures THREE.UnsignedShortType].
+    See [page:Textures format constants] for details.<br />
+    </div>
+
+    <h3>[page:Texture.magFilter .magFilter]</h3>
+    <div>
+      How the texture is sampled when a texel covers more than one pixel.
+  		The default is [page:Textures THREE.NearestFilter].
+      See [page:Textures magnification filter constants] for other choices.
+    </div>
+
+    <h3>[page:Texture.minFilter .minFilter]</h3>
+    <div>
+    How the texture is sampled when a texel covers less than one pixel.
+  	The default is [page:Textures THREE.NearestFilter].
+    See [page:Textures magnification filter constants] for other choices.
+    </div>
+
+    <h3>[page:Texture.flipY .flipY]</h3>
+    <div>
+    Depth textures do not need to be flipped so this is *false* by default.
+    </div>
+
+    <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
+    <div>
+    Depth textures do not use mipmaps.
+    </div>
+
+		<h2>Methods</h2>
+
+    <div>
+    See the base [page:Texture Texture] class for common methods.
+    </div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 102 - 39
docs/api/textures/Texture.html

@@ -31,81 +31,123 @@
 
 
 		<h3>[property:Integer id]</h3>
 		<h3>[property:Integer id]</h3>
 		<div>
 		<div>
-		Unique number for this texture instance.
+		Readonly - unique number for this texture instance.
 		</div>
 		</div>
 
 
-		<h3>[property:Image image]</h3>
+		<h3>[property:String uuid]</h3>
 		<div>
 		<div>
-		An Image object, typically created using the ImageUtils or [page:ImageLoader ImageLoader] classes. The Image object can include an image (e.g., PNG, JPG, GIF, DDS), video (e.g., MP4, OGG/OGV), or set of six images for a cube map. To use video as a texture you need to have a playing HTML5 video element as a source for your texture image and continuously update this texture as long as video is playing.
+		[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
+		This gets automatically assigned, so this shouldn't be edited.
 		</div>
 		</div>
 
 
-		<h3>[property:object mapping]</h3>
+		<h3>[property:String name]</h3>
 		<div>
 		<div>
-		How the image is applied to the object. An object type of THREE.UVMapping is the default, where the U,V coordinates are used to apply the map, and a single texture is expected. The other types are THREE.CubeReflectionMapping, for cube maps used as a reflection map; THREE.CubeRefractionMapping, refraction mapping; and THREE.SphericalReflectionMapping, a spherical reflection map projection.
+		Optional name of the object (doesn't need to be unique). Default is an empty string.
 		</div>
 		</div>
 
 
-		<h3>[property:number wrapS]</h3>
+		<h3>[property:Image image]</h3>
 		<div>
 		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		An image object, typically created using the [page:TextureLoader.load] method.
+		This can be any image (e.g., PNG, JPG, GIF, DDS) or video (e.g., MP4, OGG/OGV) type supported by Three.<br /><br />
+
+		To use video as a texture you need to have a playing HTML5
+		video element as a source for your texture image and continuously update this texture
+		as long as video is playing - the [page:VideoTexture VideoTexture] class handles this automatically.
 		</div>
 		</div>
 
 
-		<h3>[property:number wrapT]</h3>
+		<h3>[property:array mipmaps]</h3>
 		<div>
 		<div>
-		The default is THREE.ClampToEdgeWrapping, where the edge is clamped to the outer edge texels. The other two choices are THREE.RepeatWrapping and THREE.MirroredRepeatWrapping.
+		Array of user-specified mipmaps (optional).
 		</div>
 		</div>
 
 
+		<h3>[property:object mapping]</h3>
 		<div>
 		<div>
-		NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL, not Three.js.
+		How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default,
+		where the U,V coordinates are used to apply the map.<br />
+
+		See the [page:Textures texture constants] page for other mapping types.
 		</div>
 		</div>
 
 
-		<h3>[property:number magFilter]</h3>
+		<h3>[property:number wrapS]</h3>
 		<div>
 		<div>
-		How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter, which takes the four closest texels and bilinearly interpolates among them. The other option is THREE.NearestFilter, which uses the value of the closest texel.
+		This defines how the texture is wrapped horizontally and corresponds to *U* in UV mapping.<br />
+		The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
+		The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
+		See the [page:Textures texture constants] page for details.
 		</div>
 		</div>
 
 
-		<h3>[property:number minFilter]</h3>
+		<h3>[property:number wrapT]</h3>
 		<div>
 		<div>
-		How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter, which uses mipmapping and a trilinear filter. Other choices are THREE.NearestFilter, THREE.NearestMipMapNearestFilter, THREE.NearestMipMapLinearFilter, THREE.LinearFilter, and THREE.LinearMipMapNearestFilter. These vary whether the nearest texel or nearest four texels are retrieved on the nearest mipmap or nearest two mipmaps. Interpolation occurs among the samples retrieved.
+		This defines how the texture is wrapped vertically and corresponds to *V* in UV mapping.<br />
+		The same choices are available as for [property:number wrapS].<br /><br />
+
+		NOTE: tiling of images in textures only functions if image dimensions are powers of two
+		 (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
+		 Individual dimensions need not be equal, but each must be a power of two.
+		 This is a limitation of WebGL, not Three.js.
 		</div>
 		</div>
 
 
-		<h3>[property:number format]</h3>
+		<h3>[property:number magFilter]</h3>
 		<div>
 		<div>
-		The default is THREE.RGBAFormat for the texture. Other formats are: THREE.AlphaFormat, THREE.RGBFormat, THREE.LuminanceFormat, and THREE.LuminanceAlphaFormat. There are also compressed texture formats, if the S3TC extension is supported: THREE.RGB_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT1_Format, THREE.RGBA_S3TC_DXT3_Format, and THREE.RGBA_S3TC_DXT5_Format.
+		How the texture is sampled when a texel covers more than one pixel. The default is
+		 [page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
+		 The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.<br />
+		 See the [page:Textures texture constants] page for details.
 		</div>
 		</div>
 
 
-		<h3>[property:number type]</h3>
+		<h3>[property:number minFilter]</h3>
 		<div>
 		<div>
-		The default is THREE.UnsignedByteType. Other valid types (as WebGL allows) are THREE.ByteType, THREE.ShortType, THREE.UnsignedShortType, THREE.IntType, THREE.UnsignedIntType, THREE.FloatType, THREE.UnsignedShort4444Type, THREE.UnsignedShort5551Type, and THREE.UnsignedShort565Type.
+		How the texture is sampled when a texel covers less than one pixel. The default is
+		[page:Textures THREE.LinearMipMapLinearFilter], which uses mipmapping and a trilinear filter. <br /><br />
+
+		See the [page:Textures texture constants] page for all possible choices.
 		</div>
 		</div>
 
 
 		<h3>[property:number anisotropy]</h3>
 		<h3>[property:number anisotropy]</h3>
 		<div>
 		<div>
-		The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
+		The number of samples taken along the axis through the pixel that has the highest density of texels.
+		By default, this value is 1. A higher value gives a less blurry result than a basic mipmap,
+		at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to
+		find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
 		</div>
 		</div>
 
 
-		<h3>[property:boolean needsUpdate]</h3>
+		<h3>[property:number format]</h3>
 		<div>
 		<div>
-		If a texture is changed after creation, set this flag to true so that the texture is properly set up. Particularly important for setting the wrap mode.
+		The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically
+		et this to [page:Textures THREE.RGBFormat] for JPG images. <br /><br />
+
+		See the [page:Textures texture constants] page for details of other formats.
 		</div>
 		</div>
 
 
-		<h3>[property:Vector2 repeat]</h3>
+		<h3>[property:number type]</h3>
 		<div>
 		<div>
-		How many times the texture is repeated across the surface, in each direction U and V.
+		This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType],
+		which will be used for most texture formats.<br /><br />
+
+		See the [page:Textures texture constants] page for details of other formats.
 		</div>
 		</div>
 
 
 		<h3>[property:Vector2 offset]</h3>
 		<h3>[property:Vector2 offset]</h3>
 		<div>
 		<div>
-		How much a single repetition of the texture is offset from the beginning, in each direction U and V. Typical range is 0.0 to 1.0.
+		How much a single repetition of the texture is offset from the beginning, in each direction U and V.
+		Typical range is *0.0* to *1.0*.
 		</div>
 		</div>
 
 
-		<h3>[property:string name]</h3>
+		<h3>[property:Vector2 repeat]</h3>
 		<div>
 		<div>
-		Given name of the texture, empty string by default.
+		How many times the texture is repeated across the surface, in each direction U and V.
 		</div>
 		</div>
 
 
 		<h3>[property:boolean generateMipmaps]</h3>
 		<h3>[property:boolean generateMipmaps]</h3>
 		<div>
 		<div>
-		Whether to generate mipmaps (if possible) for a texture. True by default.
+		Whether to generate mipmaps (if possible) for a texture. True by default. Set this to false if you are
+		creating mipmaps manually.
+		</div>
+
+		<h3>[property:boolean premultiplyAlpha]</h3>
+		<div>
+		False by default, which is the norm for PNG images. Set to true if the RGB values have
+		been stored premultiplied by alpha.
 		</div>
 		</div>
 
 
 		<h3>[property:boolean flipY]</h3>
 		<h3>[property:boolean flipY]</h3>
@@ -113,29 +155,38 @@
 		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
 		True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
 		</div>
 		</div>
 
 
-		<h3>[property:array mipmaps]</h3>
+		<h3>[property:number unpackAlignment]</h3>
 		<div>
 		<div>
-		Array of user-specified mipmaps (optional).
+		4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
+		The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
+		4 (word-alignment), and 8 (rows start on double-word boundaries).
+		See <a href="http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml">glPixelStorei</a>
+		for more information.
 		</div>
 		</div>
 
 
-		<h3>[property:number unpackAlignment]</h3>
+		<h3>[property:number encoding]</h3>
 		<div>
 		<div>
-		4 by default. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). See <a href="http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml">glPixelStorei</a> for more information.
+		[page:Textures THREE.LinearEncoding] is the default.
+		See the [page:Textures texture constants] page for details of other formats.<br /><br />
+
+		Note that ff this value is changed on a texture after the material has been used,
+		it is necessary to trigger a Material.needsUpdate for this value to be realized in the shader.
 		</div>
 		</div>
 
 
-		<h3>[property:boolean premultiplyAlpha]</h3>
+		<h3>[property:Integer version]</h3>
 		<div>
 		<div>
-		False by default, which is the norm for PNG images. Set to true if the RGB values have been stored premultiplied by alpha.
+		This starts at *0* and counts how many times [property:Boolean needsUpdate] is set to *true*.
 		</div>
 		</div>
 
 
-		<h3>[property:number encoding]</h3>
+		<h3>[property:Function onUpdate]</h3>
 		<div>
 		<div>
-		Set to THREE.LinearEncoding by default, but supports sRGB, RGBE, RGBM, RGBD, LogLuv and Gamma corrected encodings.  IMPORTANT: If this value is changed on a texture after the material has been used, it is necessary to trigger a Material.needsUpdate for this value to be realized in the shader.
+		A callback function, called when the texture is updated (e.g., when needsUpdate has been set to true
+		and then the texture is used).
 		</div>
 		</div>
 
 
-		<h3>[property:object onUpdate]</h3>
+		<h3>[property:Boolean needsUpdate]</h3>
 		<div>
 		<div>
-		A callback function, called when the texture is updated (e.g., when needsUpdate has been set to true and then the texture is used).
+		Set this to *true* to trigger an update next time the texture is used. Particularly important for setting the wrap mode.
 		</div>
 		</div>
 
 
 
 
@@ -143,9 +194,15 @@
 
 
 		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
 		<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
 
 
-		<h3>[method:Material clone]( [page:Texture texture] )</h3>
+		<h3>[method:Texture clone]( [page:Texture texture] )</h3>
 		<div>
 		<div>
-		Make copy of texture. Note this is not a "deep copy", the image is shared.
+		Make copy of the texture. Note this is not a "deep copy", the image is shared.
+		</div>
+
+		<h3>[method:Texture toJSON]( meta )</h3>
+		<div>
+		meta -- optional object containing metadata.<br />
+		Convert the material to Three JSON format.
 		</div>
 		</div>
 
 
 		<h3>[method:null dispose]()</h3>
 		<h3>[method:null dispose]()</h3>
@@ -153,6 +210,12 @@
 		Call [page:EventDispatcher EventDispatcher].dispatchEvent with a 'dispose' event type.
 		Call [page:EventDispatcher EventDispatcher].dispatchEvent with a 'dispose' event type.
 		</div>
 		</div>
 
 
+		<h3>[method:null transformUv]( uv )</h3>
+		<div>
+		Transform the uv based on the value of this texture's [page:Texture.repeat .repeat], [page:Texture.offset .offset],
+		[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
+		</div>
+
 		<h2>Source</h2>
 		<h2>Source</h2>
 
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 100 - 0
docs/api/textures/VideoTexture.html

@@ -0,0 +1,100 @@
+<!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>
+		[page:Texture] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Creates a texture for use with a video texture.<br /><br />
+
+		This is almost the same as the base [page:Texture Texture] class,
+    except that it continuosly sets [page:Texture.needsUpdate needsUpdate] to *true*
+    (using <a href="https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame">requestAnimationFrame</a>)
+    so that the texture is updated as the video plays. Automatic creation of [page:Texture.mipmaps mipmaps]
+    is also disabled.
+		</div>
+
+    <h2>Example</h2>
+
+		<div>[example:webgl_materials_video materials / video ]</div>
+
+		<code>
+//assuming you have created a HTML video element with id="video"
+var video = document.getElementById( 'video' );
+
+var texture = new THREE.VideoTexture( video );
+texture.minFilter = THREE.LinearFilter;
+texture.magFilter = THREE.LinearFilter;
+texture.format = THREE.RGBFormat;
+    </code>
+
+
+		<h2>Constructor</h2>
+		<h3>[name]( [page:Video video], [page:Constant mapping], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Constant format], [page:Constant type], [page:Number anisotropy] )</h3>
+		<div>
+		[page:Video video] -- The video element to use as the texture. <br />
+
+		[page:Constant mapping] --  How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
+		See [page:Textures mapping constants] for other choices.<br />
+
+		[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+    [page:Constant format] -- The format used in the texture.
+     See [page:Textures format constants] for other choices.<br />
+
+    [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
+     See [page:Textures type constants] for other choices.<br />
+
+		[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+		By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+		Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+    See the base [page:Texture Texture] class for common properties.
+    </div>
+
+		<h3>[property:boolean needsUpdate]</h3>
+		<div>
+		You will not need to set this manually here as it is handled by the [page:VideoTexture.update update] method.
+		</div>
+
+		<h2>Methods</h2>
+
+    <div>
+    See the base [page:Texture Texture] class for common methods.
+    </div>
+
+    <h3>[method:null update]()</h3>
+		<div>
+		This is called automatically and sets [property:boolean needsUpdate] to *true* every time
+    a new frame is available.
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 43 - 13
docs/list.js

@@ -9,19 +9,20 @@ var list = {
 
 
 	"Reference": {
 	"Reference": {
 		"Constants": [
 		"Constants": [
+			[ "Animation", "api/constants/Animation" ],
 			[ "CustomBlendingEquation", "api/constants/CustomBlendingEquations" ],
 			[ "CustomBlendingEquation", "api/constants/CustomBlendingEquations" ],
 			[ "DrawModes", "api/constants/DrawModes" ],
 			[ "DrawModes", "api/constants/DrawModes" ],
-			[ "GLState", "api/constants/GLState" ],
 			[ "Materials", "api/constants/Materials" ],
 			[ "Materials", "api/constants/Materials" ],
-			[ "ShadowingTypes", "api/constants/ShadowingTypes" ],
-			[ "Textures", "api/constants/Textures" ]
+			[ "Textures", "api/constants/Textures" ],
+			[ "Renderer", "api/constants/Renderer" ]
 		],
 		],
 
 
 		"Cameras": [
 		"Cameras": [
 			[ "Camera", "api/cameras/Camera" ],
 			[ "Camera", "api/cameras/Camera" ],
 			[ "CubeCamera", "api/cameras/CubeCamera" ],
 			[ "CubeCamera", "api/cameras/CubeCamera" ],
 			[ "OrthographicCamera", "api/cameras/OrthographicCamera" ],
 			[ "OrthographicCamera", "api/cameras/OrthographicCamera" ],
-			[ "PerspectiveCamera", "api/cameras/PerspectiveCamera" ]
+			[ "PerspectiveCamera", "api/cameras/PerspectiveCamera" ],
+			[ "StereoCamera", "api/cameras/StereoCamera" ]
 		],
 		],
 
 
 		"Core": [
 		"Core": [
@@ -48,6 +49,7 @@ var list = {
 			[ "CylinderGeometry", "api/geometries/CylinderGeometry" ],
 			[ "CylinderGeometry", "api/geometries/CylinderGeometry" ],
 			[ "DodecahedronBufferGeometry", "api/geometries/DodecahedronBufferGeometry" ],
 			[ "DodecahedronBufferGeometry", "api/geometries/DodecahedronBufferGeometry" ],
 			[ "DodecahedronGeometry", "api/geometries/DodecahedronGeometry" ],
 			[ "DodecahedronGeometry", "api/geometries/DodecahedronGeometry" ],
+			[ "EdgesGeometry", "api/geometries/EdgesGeometry" ],
 			[ "ExtrudeGeometry", "api/geometries/ExtrudeGeometry" ],
 			[ "ExtrudeGeometry", "api/geometries/ExtrudeGeometry" ],
 			[ "IcosahedronBufferGeometry", "api/geometries/IcosahedronBufferGeometry" ],
 			[ "IcosahedronBufferGeometry", "api/geometries/IcosahedronBufferGeometry" ],
 			[ "IcosahedronGeometry", "api/geometries/IcosahedronGeometry" ],
 			[ "IcosahedronGeometry", "api/geometries/IcosahedronGeometry" ],
@@ -63,6 +65,7 @@ var list = {
 			[ "PolyhedronGeometry", "api/geometries/PolyhedronGeometry" ],
 			[ "PolyhedronGeometry", "api/geometries/PolyhedronGeometry" ],
 			[ "RingBufferGeometry", "api/geometries/RingBufferGeometry" ],
 			[ "RingBufferGeometry", "api/geometries/RingBufferGeometry" ],
 			[ "RingGeometry", "api/geometries/RingGeometry" ],
 			[ "RingGeometry", "api/geometries/RingGeometry" ],
+			[ "ShapeBufferGeometry", "api/geometries/ShapeBufferGeometry" ],
 			[ "ShapeGeometry", "api/geometries/ShapeGeometry" ],
 			[ "ShapeGeometry", "api/geometries/ShapeGeometry" ],
 			[ "SphereBufferGeometry", "api/geometries/SphereBufferGeometry" ],
 			[ "SphereBufferGeometry", "api/geometries/SphereBufferGeometry" ],
 			[ "SphereGeometry", "api/geometries/SphereGeometry" ],
 			[ "SphereGeometry", "api/geometries/SphereGeometry" ],
@@ -74,7 +77,8 @@ var list = {
 			[ "TorusKnotBufferGeometry", "api/geometries/TorusKnotBufferGeometry" ],
 			[ "TorusKnotBufferGeometry", "api/geometries/TorusKnotBufferGeometry" ],
 			[ "TorusKnotGeometry", "api/geometries/TorusKnotGeometry" ],
 			[ "TorusKnotGeometry", "api/geometries/TorusKnotGeometry" ],
 			[ "TubeGeometry", "api/geometries/TubeGeometry" ],
 			[ "TubeGeometry", "api/geometries/TubeGeometry" ],
-			[ "TubeBufferGeometry", "api/geometries/TubeBufferGeometry" ]
+			[ "TubeBufferGeometry", "api/geometries/TubeBufferGeometry" ],
+			[ "WireframeGeometry", "api/geometries/WireframeGeometry" ]
 		],
 		],
 
 
 		"Lights": [
 		"Lights": [
@@ -96,6 +100,7 @@ var list = {
 			[ "BufferGeometryLoader", "api/loaders/BufferGeometryLoader" ],
 			[ "BufferGeometryLoader", "api/loaders/BufferGeometryLoader" ],
 			[ "Cache", "api/loaders/Cache" ],
 			[ "Cache", "api/loaders/Cache" ],
 			[ "ColladaLoader", "api/loaders/ColladaLoader" ],
 			[ "ColladaLoader", "api/loaders/ColladaLoader" ],
+			[ "FileLoader", "api/loaders/FileLoader" ],
 			[ "GLTFLoader", "api/loaders/GLTFLoader" ],
 			[ "GLTFLoader", "api/loaders/GLTFLoader" ],
 			[ "ImageLoader", "api/loaders/ImageLoader" ],
 			[ "ImageLoader", "api/loaders/ImageLoader" ],
 			[ "JSONLoader", "api/loaders/JSONLoader" ],
 			[ "JSONLoader", "api/loaders/JSONLoader" ],
@@ -108,8 +113,7 @@ var list = {
 			[ "PDBLoader", "api/loaders/PDBLoader" ],
 			[ "PDBLoader", "api/loaders/PDBLoader" ],
 			[ "SVGLoader", "api/loaders/SVGLoader" ],
 			[ "SVGLoader", "api/loaders/SVGLoader" ],
 			[ "TextureLoader", "api/loaders/TextureLoader" ],
 			[ "TextureLoader", "api/loaders/TextureLoader" ],
-			[ "TGALoader", "api/loaders/TGALoader" ],
-			[ "XHRLoader", "api/loaders/XHRLoader" ]
+			[ "TGALoader", "api/loaders/TGALoader" ]
 		],
 		],
 
 
 		"Materials": [
 		"Materials": [
@@ -122,10 +126,12 @@ var list = {
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshLambertMaterial", "api/materials/MeshLambertMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshNormalMaterial", "api/materials/MeshNormalMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
 			[ "MeshPhongMaterial", "api/materials/MeshPhongMaterial" ],
+			[ "MeshPhysicalMaterial", "api/materials/MeshPhysicalMaterial" ],
 			[ "MeshStandardMaterial", "api/materials/MeshStandardMaterial" ],
 			[ "MeshStandardMaterial", "api/materials/MeshStandardMaterial" ],
 			[ "PointsMaterial", "api/materials/PointsMaterial" ],
 			[ "PointsMaterial", "api/materials/PointsMaterial" ],
 			[ "RawShaderMaterial", "api/materials/RawShaderMaterial" ],
 			[ "RawShaderMaterial", "api/materials/RawShaderMaterial" ],
 			[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
 			[ "ShaderMaterial", "api/materials/ShaderMaterial" ],
+			[ "ShadowMaterial", "api/materials/ShadowMaterial" ],
 			[ "SpriteMaterial", "api/materials/SpriteMaterial" ]
 			[ "SpriteMaterial", "api/materials/SpriteMaterial" ]
 		],
 		],
 
 
@@ -135,6 +141,7 @@ var list = {
 			[ "Color", "api/math/Color" ],
 			[ "Color", "api/math/Color" ],
 			[ "Euler", "api/math/Euler" ],
 			[ "Euler", "api/math/Euler" ],
 			[ "Frustum", "api/math/Frustum" ],
 			[ "Frustum", "api/math/Frustum" ],
+			[ "Interpolant", "api/math/Interpolant" ],
 			[ "Line3", "api/math/Line3" ],
 			[ "Line3", "api/math/Line3" ],
 			[ "Math", "api/math/Math" ],
 			[ "Math", "api/math/Math" ],
 			[ "Matrix3", "api/math/Matrix3" ],
 			[ "Matrix3", "api/math/Matrix3" ],
@@ -143,6 +150,7 @@ var list = {
 			[ "Quaternion", "api/math/Quaternion" ],
 			[ "Quaternion", "api/math/Quaternion" ],
 			[ "Ray", "api/math/Ray" ],
 			[ "Ray", "api/math/Ray" ],
 			[ "Sphere", "api/math/Sphere" ],
 			[ "Sphere", "api/math/Sphere" ],
+			[ "Spherical", "api/math/Spherical" ],
 			[ "Spline", "api/math/Spline" ],
 			[ "Spline", "api/math/Spline" ],
 			[ "Triangle", "api/math/Triangle" ],
 			[ "Triangle", "api/math/Triangle" ],
 			[ "Vector2", "api/math/Vector2" ],
 			[ "Vector2", "api/math/Vector2" ],
@@ -150,8 +158,17 @@ var list = {
 			[ "Vector4", "api/math/Vector4" ]
 			[ "Vector4", "api/math/Vector4" ]
 		],
 		],
 
 
+		"Math / Interpolants": [
+			[ "CubicInterpolant", "api/math/interpolants/CubicInterpolant" ],
+			[ "DiscreteInterpolant", "api/math/interpolants/DiscreteInterpolant" ],
+			[ "LinearInterpolant", "api/math/interpolants/LinearInterpolant" ],
+			[ "QuaternionLinearInterpolant", "api/math/interpolants/QuaternionLinearInterpolant" ]
+		],
+
+
 		"Objects": [
 		"Objects": [
 			[ "Bone", "api/objects/Bone" ],
 			[ "Bone", "api/objects/Bone" ],
+			[ "Group", "api/objects/Group" ],
 			[ "LensFlare", "api/objects/LensFlare" ],
 			[ "LensFlare", "api/objects/LensFlare" ],
 			[ "Line", "api/objects/Line" ],
 			[ "Line", "api/objects/Line" ],
 			[ "LineSegments", "api/objects/LineSegments" ],
 			[ "LineSegments", "api/objects/LineSegments" ],
@@ -195,25 +212,37 @@ var list = {
 		],
 		],
 
 
 		"Textures": [
 		"Textures": [
+			[ "CanvasTexture", "api/textures/CanvasTexture" ],
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
-			[ "Texture", "api/textures/Texture" ]
+			[ "DepthTexture", "api/textures/DepthTexture" ],
+			[ "Texture", "api/textures/Texture" ],
+			[ "VideoTexture", "api/textures/VideoTexture" ]
+		],
+
+		"Animation": [
+			[ "AnimationAction", "api/animation/AnimationAction" ],
+			[ "AnimationClip", "api/animation/AnimationClip" ],
+			[ "AnimationMixer", "api/animation/AnimationMixer" ]
 		],
 		],
 
 
 		"Extras": [
 		"Extras": [
-			[ "SceneUtils", "api/extras/SceneUtils" ]
+			[ "CurveUtils", "api/extras/CurveUtils" ],
+			[ "SceneUtils", "api/extras/SceneUtils" ],
+			[ "ShapeUtils", "api/extras/ShapeUtils" ]
 		],
 		],
 
 
-		"Extras / Animation": [
-			[ "Animation", "api/extras/animation/Animation" ],
-			[ "AnimationHandler", "api/extras/animation/AnimationHandler" ],
-			[ "KeyFrameAnimation", "api/extras/animation/KeyFrameAnimation" ]
+		"Extras / Collada Animation": [
+			[ "Animation", "api/extras/collada-animation/Animation" ],
+			[ "AnimationHandler", "api/extras/collada-animation/AnimationHandler" ],
+			[ "KeyFrameAnimation", "api/extras/collada-animation/KeyFrameAnimation" ]
 		],
 		],
 
 
 		"Extras / Core": [
 		"Extras / Core": [
 			[ "Curve", "api/extras/core/Curve" ],
 			[ "Curve", "api/extras/core/Curve" ],
 			[ "CurvePath", "api/extras/core/CurvePath" ],
 			[ "CurvePath", "api/extras/core/CurvePath" ],
+			[ "Font", "api/extras/core/Font" ],
 			[ "Path", "api/extras/core/Path" ],
 			[ "Path", "api/extras/core/Path" ],
 			[ "Shape", "api/extras/core/Shape" ]
 			[ "Shape", "api/extras/core/Shape" ]
 		],
 		],
@@ -244,6 +273,7 @@ var list = {
 			[ "GridHelper", "api/extras/helpers/GridHelper" ],
 			[ "GridHelper", "api/extras/helpers/GridHelper" ],
 			[ "HemisphereLightHelper", "api/extras/helpers/HemisphereLightHelper" ],
 			[ "HemisphereLightHelper", "api/extras/helpers/HemisphereLightHelper" ],
 			[ "PointLightHelper", "api/extras/helpers/PointLightHelper" ],
 			[ "PointLightHelper", "api/extras/helpers/PointLightHelper" ],
+			[ "SkeletonHelper", "api/extras/helpers/SkeletonHelper" ],
 			[ "SpotLightHelper", "api/extras/helpers/SpotLightHelper" ],
 			[ "SpotLightHelper", "api/extras/helpers/SpotLightHelper" ],
 			[ "VertexNormalsHelper", "api/extras/helpers/VertexNormalsHelper" ]
 			[ "VertexNormalsHelper", "api/extras/helpers/VertexNormalsHelper" ]
 		],
 		],

+ 40 - 9
docs/scenes/js/geometry.js

@@ -111,6 +111,20 @@ var CustomSinCurve = THREE.Curve.create(
 
 
 );
 );
 
 
+// heart shape
+
+var x = 0, y = 0;
+
+var heartShape = new THREE.Shape();
+
+heartShape.moveTo( x + 5, y + 5 );
+heartShape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );
+heartShape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );
+heartShape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );
+heartShape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );
+heartShape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );
+heartShape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );
+
 var guis = {
 var guis = {
 
 
 	BoxBufferGeometry : function( mesh ) {
 	BoxBufferGeometry : function( mesh ) {
@@ -1206,24 +1220,41 @@ var guis = {
 
 
 	ShapeGeometry: function( mesh ) {
 	ShapeGeometry: function( mesh ) {
 
 
-		var length = 16, width = 12;
-
-		var shape = new THREE.Shape();
-		shape.moveTo( 0,0 );
-		shape.lineTo( 0, width );
-		shape.lineTo( length, width );
-		shape.lineTo( length, 0 );
-		shape.lineTo( 0, 0 );
+		var data = {
+			segments : 12
+		};
 
 
 		function generateGeometry() {
 		function generateGeometry() {
 
 
 			updateGroupGeometry( mesh,
 			updateGroupGeometry( mesh,
-				new THREE.ShapeGeometry( shape )
+				new THREE.ShapeGeometry( heartShape, data.segments )
 			);
 			);
 
 
 		}
 		}
 
 
 		var folder = gui.addFolder( 'THREE.ShapeGeometry' );
 		var folder = gui.addFolder( 'THREE.ShapeGeometry' );
+		folder.add( data, 'segments', 1, 100 ).step( 1 ).onChange( generateGeometry );
+
+		generateGeometry();
+
+	},
+
+	ShapeBufferGeometry: function( mesh ) {
+
+		var data = {
+			segments : 12
+		};
+
+		function generateGeometry() {
+
+			updateGroupGeometry( mesh,
+				new THREE.ShapeBufferGeometry( heartShape, data.segments )
+			);
+
+		}
+
+		var folder = gui.addFolder( 'THREE.ShapeBufferGeometry' );
+		folder.add( data, 'segments', 1, 100 ).step( 1 ).onChange( generateGeometry );
 
 
 		generateGeometry();
 		generateGeometry();
 
 

+ 1 - 1
editor/index.html

@@ -365,7 +365,7 @@
 
 
 				if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) {
 				if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) {
 
 
-					var loader = new THREE.XHRLoader();
+					var loader = new THREE.FileLoader();
 					loader.crossOrigin = '';
 					loader.crossOrigin = '';
 					loader.load( file, function ( text ) {
 					loader.load( file, function ( text ) {
 
 

+ 1 - 1
editor/js/Menubar.Examples.js

@@ -25,7 +25,7 @@ Menubar.Examples = function ( editor ) {
 		{ title: 'Pong', file: 'pong.app.json' }
 		{ title: 'Pong', file: 'pong.app.json' }
 	];
 	];
 
 
-	var loader = new THREE.XHRLoader();
+	var loader = new THREE.FileLoader();
 
 
 	for ( var i = 0; i < items.length; i ++ ) {
 	for ( var i = 0; i < items.length; i ++ ) {
 
 

+ 1 - 1
editor/js/Menubar.File.js

@@ -233,7 +233,7 @@ Menubar.File = function ( editor ) {
 
 
 		} );
 		} );
 
 
-		var loader = new THREE.XHRLoader( manager );
+		var loader = new THREE.FileLoader( manager );
 		loader.load( 'js/libs/app/index.html', function ( content ) {
 		loader.load( 'js/libs/app/index.html', function ( content ) {
 
 
 			var includes = [];
 			var includes = [];

+ 1 - 1
editor/js/libs/app/index.html

@@ -33,7 +33,7 @@
 		<!-- includes -->
 		<!-- includes -->
 		<script>
 		<script>
 
 
-			var loader = new THREE.XHRLoader();
+			var loader = new THREE.FileLoader();
 			loader.load( 'app.json', function ( text ) {
 			loader.load( 'app.json', function ( text ) {
 
 
 				var json = JSON.parse( text );
 				var json = JSON.parse( text );

+ 7 - 7
editor/js/libs/tern-threejs/threejs.js

@@ -970,7 +970,7 @@
       "!doc": "A class containing useful utility functions for scene manipulation."
       "!doc": "A class containing useful utility functions for scene manipulation."
     },
     },
     "Animation": {
     "Animation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/animation/Animation",
+      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/Animation",
       "prototype": {
       "prototype": {
         "root": {
         "root": {
           "!type": "Object3d",
           "!type": "Object3d",
@@ -1037,7 +1037,7 @@
       "!type": "fn(root: Object3d, name: string)"
       "!type": "fn(root: Object3d, name: string)"
     },
     },
     "AnimationHandler": {
     "AnimationHandler": {
-      "!url": "http://threejs.org/docs/#Reference/extras/animation/AnimationHandler",
+      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationHandler",
       "prototype": {
       "prototype": {
         "CATMULLROM": {
         "CATMULLROM": {
           "!type": "number",
           "!type": "number",
@@ -1080,7 +1080,7 @@
       "!type": "fn()"
       "!type": "fn()"
     },
     },
     "AnimationMorphTarget": {
     "AnimationMorphTarget": {
-      "!url": "http://threejs.org/docs/#Reference/extras/animation/AnimationMorphTarget",
+      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/AnimationMorphTarget",
       "prototype": {
       "prototype": {
         "root": {
         "root": {
           "!type": "todo",
           "!type": "todo",
@@ -1139,7 +1139,7 @@
       "!type": "fn(root: todo, data: todo)"
       "!type": "fn(root: todo, data: todo)"
     },
     },
     "KeyFrameAnimation": {
     "KeyFrameAnimation": {
-      "!url": "http://threejs.org/docs/#Reference/extras/animation/KeyFrameAnimation",
+      "!url": "http://threejs.org/docs/#Reference/extras/collada-animation/KeyFrameAnimation",
       "prototype": {
       "prototype": {
         "root": {
         "root": {
           "!type": "todo",
           "!type": "todo",
@@ -2207,7 +2207,7 @@
           "!doc": "Remove all values from the cache."
           "!doc": "Remove all values from the cache."
         }
         }
       },
       },
-      "!doc": "A simple caching classe, used internaly by [page:XHRLoader].",
+      "!doc": "A simple caching classe, used internaly by [page:FileLoader].",
       "!type": "fn()"
       "!type": "fn()"
     },
     },
     "ColladaLoader": {
     "ColladaLoader": {
@@ -2513,8 +2513,8 @@
       "!doc": "Class for loading a [page:Texture texture].",
       "!doc": "Class for loading a [page:Texture texture].",
       "!type": "fn(manager: +THREE.LoadingManager)"
       "!type": "fn(manager: +THREE.LoadingManager)"
     },
     },
-    "XHRLoader": {
-      "!url": "http://threejs.org/docs/#Reference/loaders/XHRLoader",
+    "FileLoader": {
+      "!url": "http://threejs.org/docs/#Reference/loaders/FileLoader",
       "prototype": {
       "prototype": {
         "cache": {
         "cache": {
           "!type": "+THREE.Cache",
           "!type": "+THREE.Cache",

+ 3 - 0
examples/files.js

@@ -262,6 +262,9 @@ var files = {
 	"webgl deferred": [
 	"webgl deferred": [
 		"webgldeferred_animation"
 		"webgldeferred_animation"
 	],
 	],
+	"webgl2": [
+		"webgl2_sandbox"
+	],
 	"webvr": [
 	"webvr": [
 		"webvr_cubes",
 		"webvr_cubes",
 		"webvr_panorama",
 		"webvr_panorama",

+ 1 - 0
examples/js/SkyShader.js

@@ -66,6 +66,7 @@ THREE.ShaderLib[ 'sky' ] = {
 
 
 		"float sunIntensity(float zenithAngleCos)",
 		"float sunIntensity(float zenithAngleCos)",
 		"{",
 		"{",
+			"zenithAngleCos = clamp(zenithAngleCos, -1.0, 1.0);",
 			"return EE * max(0.0, 1.0 - pow(e, -((cutoffAngle - acos(zenithAngleCos))/steepness)));",
 			"return EE * max(0.0, 1.0 - pow(e, -((cutoffAngle - acos(zenithAngleCos))/steepness)));",
 		"}",
 		"}",
 
 

+ 269 - 12
examples/js/animation/CCDIKSolver.js

@@ -6,12 +6,16 @@
  *
  *
  * mesh.geometry needs to have iks array.
  * mesh.geometry needs to have iks array.
  *
  *
- * ik parameter example
- *
+ * // ik parameter example
+ * //
+ * // target, effector, index in links are bone index in skeleton.
+ * // the bones relation should be
+ * // <-- parent                                  child -->
+ * // links[ n ], links[ n - 1 ], ..., links[ 0 ], effector
  * ik = {
  * ik = {
  *	target: 1,
  *	target: 1,
  *	effector: 2,
  *	effector: 2,
- *	links: [ { index: 5 }, { index: 4, limitation: new THREE.Vector3( 1, 0, 0 ) }, { index : 3 } ],
+ *	links: [ { index: 5, limitation: new THREE.Vector3( 1, 0, 0 ) }, { index: 4, enabled: false }, { index : 3 } ],
  *	iteration: 10,
  *	iteration: 10,
  *	minAngle: 0.0,
  *	minAngle: 0.0,
  *	maxAngle: 1.0,
  *	maxAngle: 1.0,
@@ -22,43 +26,103 @@ THREE.CCDIKSolver = function ( mesh ) {
 
 
 	this.mesh = mesh;
 	this.mesh = mesh;
 
 
+	this._valid();
+
 };
 };
 
 
 THREE.CCDIKSolver.prototype = {
 THREE.CCDIKSolver.prototype = {
 
 
 	constructor: THREE.CCDIKSolver,
 	constructor: THREE.CCDIKSolver,
 
 
+	_valid: function () {
+
+		var iks = this.mesh.geometry.iks;
+		var bones = this.mesh.skeleton.bones;
+
+		for ( var i = 0, il = iks.length; i < il; i ++ ) {
+
+			var ik = iks[ i ];
+
+			var effector = bones[ ik.effector ];
+
+			var links = ik.links;
+
+			var link0, link1;
+
+			link0 = effector;
+
+			for ( var j = 0, jl = links.length; j < jl; j ++ ) {
+
+				link1 = bones[ links[ j ].index ];
+
+				if ( link0.parent !== link1 ) {
+
+					console.warn( 'THREE.CCDIKSolver: bone ' + link0.name + ' is not the child of bone ' + link1.name );
+
+				}
+
+				link0 = link1;
+
+			}
+
+		}
+
+	},
+
 	update: function () {
 	update: function () {
 
 
-		var effectorVec = new THREE.Vector3();
+		var q = new THREE.Quaternion();
+
+		var targetPos = new THREE.Vector3();
 		var targetVec = new THREE.Vector3();
 		var targetVec = new THREE.Vector3();
+		var effectorPos = new THREE.Vector3();
+		var effectorVec = new THREE.Vector3();
+		var linkPos = new THREE.Vector3();
+		var invLinkQ = new THREE.Quaternion();
 		var axis = new THREE.Vector3();
 		var axis = new THREE.Vector3();
-		var q = new THREE.Quaternion();
 
 
 		var bones = this.mesh.skeleton.bones;
 		var bones = this.mesh.skeleton.bones;
 		var iks = this.mesh.geometry.iks;
 		var iks = this.mesh.geometry.iks;
 
 
+		var boneParams = this.mesh.geometry.bones;
+
 		// for reference overhead reduction in loop
 		// for reference overhead reduction in loop
 		var math = Math;
 		var math = Math;
 
 
+		this.mesh.updateMatrixWorld( true );
+
 		for ( var i = 0, il = iks.length; i < il; i++ ) {
 		for ( var i = 0, il = iks.length; i < il; i++ ) {
 
 
 			var ik = iks[ i ];
 			var ik = iks[ i ];
 			var effector = bones[ ik.effector ];
 			var effector = bones[ ik.effector ];
 			var target = bones[ ik.target ];
 			var target = bones[ ik.target ];
-			var targetPos = target.getWorldPosition();
+
+			// don't use getWorldPosition() here for the performance
+			// because it calls updateMatrixWorld( true ) inside.
+			targetPos.setFromMatrixPosition( target.matrixWorld );
+
 			var links = ik.links;
 			var links = ik.links;
 			var iteration = ik.iteration !== undefined ? ik.iteration : 1;
 			var iteration = ik.iteration !== undefined ? ik.iteration : 1;
 
 
 			for ( var j = 0; j < iteration; j++ ) {
 			for ( var j = 0; j < iteration; j++ ) {
 
 
+				var rotated = false;
+
 				for ( var k = 0, kl = links.length; k < kl; k++ ) {
 				for ( var k = 0, kl = links.length; k < kl; k++ ) {
 
 
 					var link = bones[ links[ k ].index ];
 					var link = bones[ links[ k ].index ];
+
+					// skip this link and following links.
+					// this skip is used for MMD performance optimization.
+					if ( links[ k ].enabled === false ) break;
+
 					var limitation = links[ k ].limitation;
 					var limitation = links[ k ].limitation;
-					var linkPos = link.getWorldPosition();
-					var invLinkQ = link.getWorldQuaternion().inverse();
-					var effectorPos = effector.getWorldPosition();
+
+					// don't use getWorldPosition/Quaternion() here for the performance
+					// because they call updateMatrixWorld( true ) inside.
+					linkPos.setFromMatrixPosition( link.matrixWorld );
+					invLinkQ.setFromRotationMatrix( link.matrixWorld ).inverse();
+					effectorPos.setFromMatrixPosition( effector.matrixWorld );
 
 
 					// work in link world
 					// work in link world
 					effectorVec.subVectors( effectorPos, linkPos );
 					effectorVec.subVectors( effectorPos, linkPos );
@@ -71,9 +135,6 @@ THREE.CCDIKSolver.prototype = {
 
 
 					var angle = targetVec.dot( effectorVec );
 					var angle = targetVec.dot( effectorVec );
 
 
-					// TODO: continue (or break) the loop for the performance
-					//       if no longer needs to rotate (angle > 1.0-1e-5 ?)
-
 					if ( angle > 1.0 ) {
 					if ( angle > 1.0 ) {
 
 
 						angle = 1.0;
 						angle = 1.0;
@@ -86,6 +147,10 @@ THREE.CCDIKSolver.prototype = {
 
 
 					angle = math.acos( angle );
 					angle = math.acos( angle );
 
 
+					// skip if changing angle is too small to prevent vibration of bone
+					// Refer to http://www20.atpages.jp/katwat/three.js_r58/examples/mytest37/mmd.three.js
+					if ( angle < 1e-5 ) continue;
+
 					if ( ik.minAngle !== undefined && angle < ik.minAngle ) {
 					if ( ik.minAngle !== undefined && angle < ik.minAngle ) {
 
 
 						angle = ik.minAngle;
 						angle = ik.minAngle;
@@ -124,14 +189,206 @@ THREE.CCDIKSolver.prototype = {
 					}
 					}
 
 
 					link.updateMatrixWorld( true );
 					link.updateMatrixWorld( true );
+					rotated = true;
 
 
 				}
 				}
 
 
+				if ( ! rotated ) break;
+
 			}
 			}
 
 
 		}
 		}
 
 
+		// just in case
+		this.mesh.updateMatrixWorld( true );
+
+	}
+
+};
+
+
+THREE.CCDIKHelper = function ( mesh ) {
+
+	if ( mesh.geometry.iks === undefined || mesh.skeleton === undefined ) {
+
+		throw 'THREE.CCDIKHelper requires iks in mesh.geometry and skeleton in mesh.';
+
+	}
+
+	THREE.Object3D.call( this );
+
+	this.root = mesh;
+
+	this.matrix = mesh.matrixWorld;
+	this.matrixAutoUpdate = false;
+
+	this.sphereGeometry = new THREE.SphereBufferGeometry( 0.25, 16, 8 );
+
+	this.targetSphereMaterial = new THREE.MeshBasicMaterial( {
+		color: new THREE.Color( 0xff8888 ),
+		depthTest: false,
+		depthWrite: false,
+		transparent: true
+	} );
+
+	this.effectorSphereMaterial = new THREE.MeshBasicMaterial( {
+		color: new THREE.Color( 0x88ff88 ),
+		depthTest: false,
+		depthWrite: false,
+		transparent: true
+	} );
+
+	this.linkSphereMaterial = new THREE.MeshBasicMaterial( {
+		color: new THREE.Color( 0x8888ff ),
+		depthTest: false,
+		depthWrite: false,
+		transparent: true
+	} );
+
+	this.lineMaterial = new THREE.LineBasicMaterial( {
+		color: new THREE.Color( 0xff0000 ),
+		depthTest: false,
+		depthWrite: false,
+		transparent: true
+	} );
+
+	this._init();
+	this.update();
+
+};
+
+THREE.CCDIKHelper.prototype = Object.create( THREE.Object3D.prototype );
+THREE.CCDIKHelper.prototype.constructor = THREE.CCDIKHelper;
+
+THREE.CCDIKHelper.prototype._init = function () {
+
+	var self = this;
+	var mesh = this.root;
+	var iks = mesh.geometry.iks;
+
+	function createLineGeometry( ik ) {
+
+		var geometry = new THREE.BufferGeometry();
+		var vertices = new Float32Array( ( 2 + ik.links.length ) * 3 );
+		geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
+
+		return geometry;
+
+	}
+
+	function createTargetMesh() {
+
+		return new THREE.Mesh( self.sphereGeometry, self.targetSphereMaterial );
+
+	}
+
+	function createEffectorMesh() {
+
+		return new THREE.Mesh( self.sphereGeometry, self.effectorSphereMaterial );
+
+	}
+
+	function createLinkMesh() {
+
+		return new THREE.Mesh( self.sphereGeometry, self.linkSphereMaterial );
+
+	}
+
+	function createLine( ik ) {
+
+		return new THREE.Line( createLineGeometry( ik ), self.lineMaterial );
+
+	}
+
+	for ( var i = 0, il = iks.length; i < il; i ++ ) {
+
+		var ik = iks[ i ];
+
+		this.add( createTargetMesh() );
+		this.add( createEffectorMesh() );
+
+		for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+			this.add( createLinkMesh() );
+
+		}
+
+		this.add( createLine( ik ) );
+
 	}
 	}
 
 
 };
 };
 
 
+THREE.CCDIKHelper.prototype.update = function () {
+
+	var offset = 0;
+
+	var mesh = this.root;
+	var iks = mesh.geometry.iks;
+	var bones = mesh.skeleton.bones;
+
+	var matrixWorldInv = new THREE.Matrix4().getInverse( mesh.matrixWorld );
+	var vector = new THREE.Vector3();
+
+	function getPosition( bone ) {
+
+		vector.setFromMatrixPosition( bone.matrixWorld );
+		vector.applyMatrix4( matrixWorldInv );
+
+		return vector;
+
+	}
+
+	function setPositionOfBoneToAttributeArray( array, index, bone ) {
+
+		var v = getPosition( bone );
+
+		array[ index * 3 + 0 ] = v.x;
+		array[ index * 3 + 1 ] = v.y;
+		array[ index * 3 + 2 ] = v.z;
+
+	}
+
+	for ( var i = 0, il = iks.length; i < il; i ++ ) {
+
+		var ik = iks[ i ];
+
+		var targetBone = bones[ ik.target ];
+		var effectorBone = bones[ ik.effector ];
+
+		var targetMesh = this.children[ offset ++ ];
+		var effectorMesh = this.children[ offset ++ ];
+
+		targetMesh.position.copy( getPosition( targetBone ) );
+		effectorMesh.position.copy( getPosition( effectorBone ) );
+
+		for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+			var link = ik.links[ j ];
+			var linkBone = bones[ link.index ];
+
+			var linkMesh = this.children[ offset ++ ];
+
+			linkMesh.position.copy( getPosition( linkBone ) );
+
+		}
+
+		var line = this.children[ offset ++ ];
+		var array = line.geometry.attributes.position.array;
+
+		setPositionOfBoneToAttributeArray( array, 0, targetBone );
+		setPositionOfBoneToAttributeArray( array, 1, effectorBone );
+
+		for ( var j = 0, jl = ik.links.length; j < jl; j ++ ) {
+
+			var link = ik.links[ j ];
+			var linkBone = bones[ link.index ];
+			setPositionOfBoneToAttributeArray( array, j + 2, linkBone );
+
+		}
+
+		line.geometry.attributes.position.needsUpdate = true;
+
+	}
+
+};

+ 261 - 25
examples/js/animation/MMDPhysics.js

@@ -4,37 +4,36 @@
  * Dependencies
  * Dependencies
  *  - Ammo.js https://github.com/kripken/ammo.js
  *  - Ammo.js https://github.com/kripken/ammo.js
  *
  *
- *
  * MMD specific Physics class.
  * MMD specific Physics class.
  *
  *
  * See THREE.MMDLoader for the passed parameter list of RigidBody/Constraint.
  * See THREE.MMDLoader for the passed parameter list of RigidBody/Constraint.
  *
  *
+ * Requirement:
+ *  - don't change object's scale from (1,1,1) after setting physics to object
  *
  *
  * TODO
  * TODO
+ *  - optimize for the performance
  *  - use Physijs http://chandlerprall.github.io/Physijs/
  *  - use Physijs http://chandlerprall.github.io/Physijs/
  *    and improve the performance by making use of Web worker.
  *    and improve the performance by making use of Web worker.
  *  - if possible, make this class being non-MMD specific.
  *  - if possible, make this class being non-MMD specific.
+ *  - object scale change support
  */
  */
 
 
 THREE.MMDPhysics = function ( mesh, params ) {
 THREE.MMDPhysics = function ( mesh, params ) {
 
 
+	if ( params === undefined ) params = {};
+
 	this.mesh = mesh;
 	this.mesh = mesh;
-	this.helper = new THREE.MMDPhysics.PhysicsHelper();
+	this.helper = new THREE.MMDPhysics.ResourceHelper();
 
 
-	/*
-	 * Note: Default 1 / 65 unit step is a workaround that
-	 *       some bones go wrong at near 60fps if it's 1 / 60.
-	 *       Be careful that small unitStep could cause heavy
-	 *       physics calculation.
-	 */
-	this.unitStep = ( params && params.unitStep ) ? params.unitStep : 1 / 65;
-	this.maxStepNum = ( params && params.maxStepNum ) ? params.maxStepNum : 3;
+	this.unitStep = ( params.unitStep !== undefined ) ? params.unitStep : 1 / 60;
+	this.maxStepNum = ( params.maxStepNum !== undefined ) ? params.maxStepNum : 3;
 
 
 	this.world = null;
 	this.world = null;
 	this.bodies = [];
 	this.bodies = [];
 	this.constraints = [];
 	this.constraints = [];
 
 
-	this.init();
+	this.init( mesh );
 
 
 };
 };
 
 
@@ -42,11 +41,42 @@ THREE.MMDPhysics.prototype = {
 
 
 	constructor: THREE.MMDPhysics,
 	constructor: THREE.MMDPhysics,
 
 
-	init: function () {
+	init: function ( mesh ) {
+
+		var parent = mesh.parent;
+
+		if ( parent !== null ) {
+
+			parent.remove( mesh );
+
+		}
+
+		var currentPosition = mesh.position.clone();
+		var currentRotation = mesh.rotation.clone();
+		var currentScale = mesh.scale.clone();
+
+		mesh.position.set( 0, 0, 0 );
+		mesh.rotation.set( 0, 0, 0 );
+		mesh.scale.set( 1, 1, 1 );
+
+		mesh.updateMatrixWorld( true );
 
 
 		this.initWorld();
 		this.initWorld();
 		this.initRigidBodies();
 		this.initRigidBodies();
 		this.initConstraints();
 		this.initConstraints();
+
+		if ( parent !== null ) {
+
+			parent.add( mesh );
+
+		}
+
+		mesh.position.copy( currentPosition );
+		mesh.rotation.copy( currentRotation );
+		mesh.scale.copy( currentScale );
+
+		mesh.updateMatrixWorld( true );
+
 		this.reset();
 		this.reset();
 
 
 	},
 	},
@@ -58,7 +88,7 @@ THREE.MMDPhysics.prototype = {
 		var cache = new Ammo.btDbvtBroadphase();
 		var cache = new Ammo.btDbvtBroadphase();
 		var solver = new Ammo.btSequentialImpulseConstraintSolver();
 		var solver = new Ammo.btSequentialImpulseConstraintSolver();
 		var world = new Ammo.btDiscreteDynamicsWorld( dispatcher, cache, solver, config );
 		var world = new Ammo.btDiscreteDynamicsWorld( dispatcher, cache, solver, config );
-		world.setGravity( new Ammo.btVector3( 0, -10 * 10, 0 ) );
+		world.setGravity( new Ammo.btVector3( 0, -9.8 * 10, 0 ) );
 		this.world = world;
 		this.world = world;
 
 
 	},
 	},
@@ -99,6 +129,13 @@ THREE.MMDPhysics.prototype = {
 		var stepTime = delta;
 		var stepTime = delta;
 		var maxStepNum = ( ( delta / unitStep ) | 0 ) + 1;
 		var maxStepNum = ( ( delta / unitStep ) | 0 ) + 1;
 
 
+		if ( stepTime < unitStep ) {
+
+			stepTime = unitStep;
+			maxStepNum = 1;
+
+		}
+
 		if ( maxStepNum > this.maxStepNum ) {
 		if ( maxStepNum > this.maxStepNum ) {
 
 
 			maxStepNum = this.maxStepNum;
 			maxStepNum = this.maxStepNum;
@@ -145,7 +182,7 @@ THREE.MMDPhysics.prototype = {
 
 
 		for ( var i = 0; i < cycles; i++ ) {
 		for ( var i = 0; i < cycles; i++ ) {
 
 
-			this.update( 1 );
+			this.update( 1 / 60 );
 
 
 		}
 		}
 
 
@@ -162,12 +199,13 @@ THREE.MMDPhysics.prototype = {
  *
  *
  * 2. provide simple Ammo object operations.
  * 2. provide simple Ammo object operations.
  */
  */
-THREE.MMDPhysics.PhysicsHelper = function () {
+THREE.MMDPhysics.ResourceHelper = function () {
 
 
 	// for Three.js
 	// for Three.js
 	this.threeVector3s = [];
 	this.threeVector3s = [];
 	this.threeMatrix4s = [];
 	this.threeMatrix4s = [];
 	this.threeQuaternions = [];
 	this.threeQuaternions = [];
+	this.threeEulers = [];
 
 
 	// for Ammo.js
 	// for Ammo.js
 	this.transforms = [];
 	this.transforms = [];
@@ -176,7 +214,7 @@ THREE.MMDPhysics.PhysicsHelper = function () {
 
 
 };
 };
 
 
-THREE.MMDPhysics.PhysicsHelper.prototype = {
+THREE.MMDPhysics.ResourceHelper.prototype = {
 
 
 	allocThreeVector3: function () {
 	allocThreeVector3: function () {
 
 
@@ -214,6 +252,18 @@ THREE.MMDPhysics.PhysicsHelper.prototype = {
 
 
 	},
 	},
 
 
+	allocThreeEuler: function () {
+
+		return ( this.threeEulers.length > 0 ) ? this.threeEulers.pop() : new THREE.Euler();
+
+	},
+
+	freeThreeEuler: function ( e ) {
+
+		this.threeEulers.push( e );
+
+	},
+
 	allocTransform: function () {
 	allocTransform: function () {
 
 
 		return ( this.transforms.length > 0 ) ? this.transforms.pop() : new Ammo.btTransform();
 		return ( this.transforms.length > 0 ) ? this.transforms.pop() : new Ammo.btTransform();
@@ -314,7 +364,13 @@ THREE.MMDPhysics.PhysicsHelper.prototype = {
 
 
 	setBasisFromArray3: function ( t, a ) {
 	setBasisFromArray3: function ( t, a ) {
 
 
-		t.getBasis().setEulerZYX( a[ 0 ], a[ 1 ], a[ 2 ] );
+		var thQ = this.allocThreeQuaternion();
+		var thE = this.allocThreeEuler();
+		thE.set( a[ 0 ], a[ 1 ], a[ 2 ] );
+		this.setBasisFromArray4( t, thQ.setFromEuler( thE ).toArray() );
+
+		this.freeThreeEuler( thE );
+		this.freeThreeQuaternion( thQ );
 
 
 	},
 	},
 
 
@@ -598,7 +654,7 @@ THREE.MMDPhysics.RigidBody.prototype = {
 
 
 	init: function () {
 	init: function () {
 
 
-		function generateShape ( p ) {
+		function generateShape( p ) {
 
 
 			switch( p.shapeType ) {
 			switch( p.shapeType ) {
 
 
@@ -648,13 +704,19 @@ THREE.MMDPhysics.RigidBody.prototype = {
 
 
 		var info = new Ammo.btRigidBodyConstructionInfo( weight, state, shape, localInertia );
 		var info = new Ammo.btRigidBodyConstructionInfo( weight, state, shape, localInertia );
 		info.set_m_friction( params.friction );
 		info.set_m_friction( params.friction );
-		info.set_m_restitution( params.restriction );
+		info.set_m_restitution( params.restitution );
 
 
 		var body = new Ammo.btRigidBody( info );
 		var body = new Ammo.btRigidBody( info );
 
 
 		if ( params.type === 0 ) {
 		if ( params.type === 0 ) {
 
 
 			body.setCollisionFlags( body.getCollisionFlags() | 2 );
 			body.setCollisionFlags( body.getCollisionFlags() | 2 );
+
+			/*
+			 * It'd be better to comment out this line though in general I should call this method
+			 * because I'm not sure why but physics will be more like MMD's
+			 * if I comment out.
+			 */
 			body.setActivationState( 4 );
 			body.setActivationState( 4 );
 
 
 		}
 		}
@@ -695,12 +757,6 @@ THREE.MMDPhysics.RigidBody.prototype = {
 
 
 		}
 		}
 
 
-		if ( this.params.type === 2 ) {
-
-			this.setPositionFromBone();
-
-		}
-
 	},
 	},
 
 
 	updateBone: function () {
 	updateBone: function () {
@@ -721,6 +777,12 @@ THREE.MMDPhysics.RigidBody.prototype = {
 
 
 		this.bone.updateMatrixWorld( true );
 		this.bone.updateMatrixWorld( true );
 
 
+		if ( this.params.type === 2 ) {
+
+			this.setPositionFromBone();
+
+		}
+
 	},
 	},
 
 
 	getBoneTransform: function () {
 	getBoneTransform: function () {
@@ -932,6 +994,23 @@ THREE.MMDPhysics.Constraint.prototype = {
 
 
 		}
 		}
 
 
+		/*
+		 * Currently(10/31/2016) official ammo.js doesn't support
+		 * btGeneric6DofSpringConstraint.setParam method.
+		 * You need custom ammo.js (add the method into idl) if you wanna use.
+		 * By setting this parameter, physics will be more like MMD's
+		 */
+		if ( constraint.setParam !== undefined ) {
+
+			for ( var i = 0; i < 6; i ++ ) {
+
+				// this parameter is from http://www20.atpages.jp/katwat/three.js_r58/examples/mytest37/mmd.three.js
+				constraint.setParam( 2, 0.475, i );
+
+			}
+
+		}
+
 		this.world.addConstraint( constraint, true );
 		this.world.addConstraint( constraint, true );
 		this.constraint = constraint;
 		this.constraint = constraint;
 
 
@@ -950,3 +1029,160 @@ THREE.MMDPhysics.Constraint.prototype = {
 	}
 	}
 
 
 };
 };
+
+
+THREE.MMDPhysicsHelper = function ( mesh ) {
+
+	if ( mesh.physics === undefined || mesh.geometry.rigidBodies === undefined ) {
+
+		throw 'THREE.MMDPhysicsHelper requires physics in mesh and rigidBodies in mesh.geometry.';
+
+	}
+
+	THREE.Object3D.call( this );
+
+	this.root = mesh;
+
+	this.matrix = mesh.matrixWorld;
+	this.matrixAutoUpdate = false;
+
+	this.materials = [];
+
+	this.materials.push(
+		new THREE.MeshBasicMaterial( {
+			color: new THREE.Color( 0xff8888 ),
+			wireframe: true,
+			depthTest: false,
+			depthWrite: false,
+			opacity: 0.25,
+			transparent: true
+		} )
+	);
+
+	this.materials.push(
+		new THREE.MeshBasicMaterial( {
+			color: new THREE.Color( 0x88ff88 ),
+			wireframe: true,
+			depthTest: false,
+			depthWrite: false,
+			opacity: 0.25,
+			transparent: true
+		} )
+	);
+
+	this.materials.push(
+		new THREE.MeshBasicMaterial( {
+			color: new THREE.Color( 0x8888ff ),
+			wireframe: true,
+			depthTest: false,
+			depthWrite: false,
+			opacity: 0.25,
+			transparent: true
+		} )
+	);
+
+	this._init();
+	this.update();
+
+};
+
+THREE.MMDPhysicsHelper.prototype = Object.create( THREE.Object3D.prototype );
+THREE.MMDPhysicsHelper.prototype.constructor = THREE.MMDPhysicsHelper;
+
+THREE.MMDPhysicsHelper.prototype._init = function () {
+
+	var mesh = this.root;
+	var rigidBodies = mesh.geometry.rigidBodies;
+
+	function createGeometry( param ) {
+
+		switch ( param.shapeType ) {
+
+			case 0:
+				return new THREE.SphereBufferGeometry( param.width, 16, 8 );
+
+			case 1:
+				return new THREE.BoxBufferGeometry( param.width * 2, param.height * 2, param.depth * 2, 8, 8, 8);
+
+			case 2:
+				return new createCapsuleGeometry( param.width, param.height, 16, 8 );
+
+			default:
+				return null;
+
+		}
+
+	}
+
+	// copy from http://www20.atpages.jp/katwat/three.js_r58/examples/mytest37/mytest37.js?ver=20160815
+	function createCapsuleGeometry( radius, cylinderHeight, segmentsRadius, segmentsHeight ) {
+
+		var geometry = new THREE.CylinderBufferGeometry( radius, radius, cylinderHeight, segmentsRadius, segmentsHeight, true );
+		var upperSphere = new THREE.Mesh( new THREE.SphereBufferGeometry( radius, segmentsRadius, segmentsHeight, 0, Math.PI * 2, 0, Math.PI / 2 ) );
+		var lowerSphere = new THREE.Mesh( new THREE.SphereBufferGeometry( radius, segmentsRadius, segmentsHeight, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2 ) );
+
+		upperSphere.position.set( 0, cylinderHeight / 2, 0 );
+		lowerSphere.position.set( 0, -cylinderHeight / 2, 0 );
+
+		upperSphere.updateMatrix();
+		lowerSphere.updateMatrix();
+
+		geometry.merge( upperSphere.geometry, upperSphere.matrix );
+		geometry.merge( lowerSphere.geometry, lowerSphere.matrix );
+
+		return geometry;
+
+	}
+
+	for ( var i = 0, il = rigidBodies.length; i < il; i ++ ) {
+
+		var param = rigidBodies[ i ];
+		this.add( new THREE.Mesh( createGeometry( param ), this.materials[ param.type ] ) );
+
+	}
+
+};
+
+THREE.MMDPhysicsHelper.prototype.update = function () {
+
+	var mesh = this.root;
+	var rigidBodies = mesh.geometry.rigidBodies;
+	var bodies = mesh.physics.bodies;
+
+	var matrixWorldInv = new THREE.Matrix4().getInverse( mesh.matrixWorld );
+	var vector = new THREE.Vector3();
+	var quaternion = new THREE.Quaternion();
+	var quaternion2 = new THREE.Quaternion();
+
+	function getPosition( origin ) {
+
+		vector.set( origin.x(), origin.y(), origin.z() );
+		vector.applyMatrix4( matrixWorldInv );
+
+		return vector;
+
+	}
+
+	function getQuaternion( rotation ) {
+
+		quaternion.set( rotation.x(), rotation.y(), rotation.z(), rotation.w() );
+		quaternion2.setFromRotationMatrix( matrixWorldInv );
+		quaternion2.multiply( quaternion );
+
+		return quaternion2;
+
+	}
+
+	for ( var i = 0, il = rigidBodies.length; i < il; i ++ ) {
+
+		var body = bodies[ i ].body;
+		var mesh = this.children[ i ];
+
+		var tr = body.getCenterOfMassTransform();
+
+		mesh.position.copy( getPosition( tr.getOrigin() ) );
+		mesh.quaternion.copy( getQuaternion( tr.getRotation() ) );
+
+	}
+
+};

+ 1 - 1
examples/js/controls/OrbitControls.js

@@ -11,7 +11,7 @@
 //
 //
 //    Orbit - left mouse / touch: one finger move
 //    Orbit - left mouse / touch: one finger move
 //    Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
 //    Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
-//    Pan - right mouse, or arrow keys / touch: three finter swipe
+//    Pan - right mouse, or arrow keys / touch: three finger swipe
 
 
 THREE.OrbitControls = function ( object, domElement ) {
 THREE.OrbitControls = function ( object, domElement ) {
 
 

+ 209 - 35
examples/js/effects/OutlineEffect.js

@@ -7,19 +7,20 @@
  * new THREE.OutlineEffect( renderer, {
  * new THREE.OutlineEffect( renderer, {
  * 	defaultThickNess: 0.01,
  * 	defaultThickNess: 0.01,
  * 	defaultColor: new THREE.Color( 0x888888 ),
  * 	defaultColor: new THREE.Color( 0x888888 ),
- * 	defaultAlpha: 0.8
+ * 	defaultAlpha: 0.8,
+ * 	defaultKeepAlive: true // keeps outline material in cache even if material is removed from scene
  * } );
  * } );
  *
  *
  * // How to set outline parameters for each material
  * // How to set outline parameters for each material
  * material.outlineParameters = {
  * material.outlineParameters = {
- * 	thickNess: 0.01,
- * 	color: new THREE.Color( 0x888888 ),
- * 	alpha: 0.8,
- * 	visible: true
+ * 	thickNess: 0.01,                     // this paremeter won't work for MultiMaterial
+ * 	color: new THREE.Color( 0x888888 ),  // this paremeter won't work for MultiMaterial
+ * 	alpha: 0.8,                          // this paremeter won't work for MultiMaterial
+ * 	visible: true,
+ * 	keepAlive: true  // this paremeter won't work for Material in materials of MultiMaterial
  * };
  * };
  *
  *
  * TODO
  * TODO
- *  - shared material
  *  - support shader material without objectNormal in its vertexShader
  *  - support shader material without objectNormal in its vertexShader
  */
  */
 
 
@@ -34,6 +35,27 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 	var defaultThickness = parameters.defaultThickness !== undefined ? parameters.defaultThickness : 0.003;
 	var defaultThickness = parameters.defaultThickness !== undefined ? parameters.defaultThickness : 0.003;
 	var defaultColor = parameters.defaultColor !== undefined ? parameters.defaultColor : new THREE.Color( 0x000000 );
 	var defaultColor = parameters.defaultColor !== undefined ? parameters.defaultColor : new THREE.Color( 0x000000 );
 	var defaultAlpha = parameters.defaultAlpha !== undefined ? parameters.defaultAlpha : 1.0;
 	var defaultAlpha = parameters.defaultAlpha !== undefined ? parameters.defaultAlpha : 1.0;
+	var defaultKeepAlive = parameters.defaultKeepAlive !== undefined ? parameters.defaultKeepAlive : false;
+
+	// object.material.uuid -> outlineMaterial
+	// (no mapping from children of MultiMaterial)
+	// save at the outline material creation and release
+	// if it's unused removeThresholdCount frames
+	// unless keepAlive is true.
+	var cache = {};
+
+	var removeThresholdCount = 60;
+
+	// outlineMaterial.uuid (or object.uuid for invisibleMaterial) -> originalMaterial
+	// including children of MultiMaterial.
+	// save before render and release after render.
+	var originalMaterials = {};
+
+	// object.uuid -> originalOnBeforeRender
+	// save before render and release after render.
+	var originalOnBeforeRenders = {};
+
+	//this.cache = cache;  // for debug
 
 
 	var invisibleMaterial = new THREE.ShaderMaterial( { visible: false } );
 	var invisibleMaterial = new THREE.ShaderMaterial( { visible: false } );
 
 
@@ -110,7 +132,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 	].join( "\n" );
 	].join( "\n" );
 
 
-	function createMaterial ( originalMaterial ) {
+	function createMaterial( originalMaterial ) {
 
 
 		var shaderID = shaderIDs[ originalMaterial.type ];
 		var shaderID = shaderIDs[ originalMaterial.type ];
 		var originalUniforms, originalVertexShader;
 		var originalUniforms, originalVertexShader;
@@ -133,10 +155,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 		}
 		}
 
 
-		var uniforms = THREE.UniformsUtils.merge( [
-			originalUniforms,
-			uniformsChunk
-		] );
+		var uniforms = Object.assign( {}, originalUniforms, uniformsChunk );
 
 
 		var vertexShader = originalVertexShader
 		var vertexShader = originalVertexShader
 					// put vertexShaderChunk right before "void main() {...}"
 					// put vertexShaderChunk right before "void main() {...}"
@@ -150,7 +169,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 					.replace( /#include\s+<[\w_]*light[\w_]*>/g, '' );
 					.replace( /#include\s+<[\w_]*light[\w_]*>/g, '' );
 
 
 		var material = new THREE.ShaderMaterial( {
 		var material = new THREE.ShaderMaterial( {
-			uniforms: THREE.UniformsUtils.clone( uniforms ),
+			uniforms: uniforms,
 			vertexShader: vertexShader,
 			vertexShader: vertexShader,
 			fragmentShader: fragmentShader,
 			fragmentShader: fragmentShader,
 			side: THREE.BackSide,
 			side: THREE.BackSide,
@@ -165,7 +184,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 	}
 	}
 
 
-	function createMultiMaterial ( originalMaterial ) {
+	function createMultiMaterial( originalMaterial ) {
 
 
 		var materials = [];
 		var materials = [];
 
 
@@ -179,43 +198,99 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 	}
 	}
 
 
-	function setOutlineMaterial ( object ) {
+	function setOutlineMaterial( object ) {
 
 
 		if ( object.material === undefined ) return;
 		if ( object.material === undefined ) return;
 
 
-		object.userData.originalMaterial = object.material;
+		var data = cache[ object.material.uuid ];
+
+		if ( data === undefined ) {
 
 
-		if ( object.userData.outlineMaterial === undefined ) {
+			data = {
+				material: object.material.isMultiMaterial === true ? createMultiMaterial( object.material ) : createMaterial( object.material ),
+				used: true,
+				keepAlive: defaultKeepAlive,
+				count: 0
+			};
 
 
-			object.userData.outlineMaterial = object.material.type === 'MultiMaterial' ? createMultiMaterial( object.material ) : createMaterial( object.material );
+			cache[ object.material.uuid ] = data;
 
 
 		}
 		}
 
 
-		if ( object.userData.outlineMaterial.type === 'MultiMaterial' ) {
+		var outlineMaterial = data.material;
+		data.used = true;
+
+		var uuid= outlineMaterial !== invisibleMaterial ? outlineMaterial.uuid : object.uuid;
+		originalMaterials[ uuid ] = object.material;
+
+		if ( object.material.isMultiMaterial === true ) {
+
+			for ( var i = 0, il = object.material.materials.length; i < il; i ++ ) {
+
+				// originalMaterial of leaf material of MultiMaterial is used only for
+				// updating outlineMaterial. so need not to save for invisibleMaterial.
+				if ( outlineMaterial.materials[ i ] !== invisibleMaterial ) {
+
+					originalMaterials[ outlineMaterial.materials[ i ].uuid ] = object.material.materials[ i ];
+
+				}
+
+			}
 
 
-			updateOutlineMultiMaterial( object.userData.outlineMaterial, object.userData.originalMaterial );
+			updateOutlineMultiMaterial( outlineMaterial, object.material );
 
 
 		} else {
 		} else {
 
 
-			updateOutlineMaterial( object.userData.outlineMaterial, object.userData.originalMaterial );
+			updateOutlineMaterial( outlineMaterial, object.material );
+
+		}
+
+		object.material = outlineMaterial;
+
+		originalOnBeforeRenders[ object.uuid ] = object.onBeforeRender;
+		object.onBeforeRender = onBeforeRender;
+
+	}
+
+	function restoreOriginalMaterial( object ) {
+
+		if ( object.material === undefined ) return;
+
+		var originalMaterial = originalMaterials[ object.material.uuid ]
+
+		if ( originalMaterial === undefined ) {
+
+			originalMaterial = originalMaterials[ object.uuid ]
+
+			if ( originalMaterial === undefined ) return;
 
 
 		}
 		}
 
 
-		object.material = object.userData.outlineMaterial;
+		object.material = originalMaterial;
+		object.onBeforeRender = originalOnBeforeRenders[ object.uuid ];
 
 
 	}
 	}
 
 
-	function updateOutlineMaterial ( material, originalMaterial ) {
+	function onBeforeRender( renderer, scene, camera, geometry, material, group ) {
+
+		// check some things before updating just in case
 
 
 		if ( material === invisibleMaterial ) return;
 		if ( material === invisibleMaterial ) return;
 
 
+		if ( material.isMultiMaterial === true ) return;
+
+		var originalMaterial = originalMaterials[ material.uuid ];
+
+		if ( originalMaterial === undefined ) return;
+
+		updateUniforms( material, originalMaterial );
+
+	}
+
+	function updateUniforms( material, originalMaterial ) {
+
 		var outlineParameters = originalMaterial.outlineParameters;
 		var outlineParameters = originalMaterial.outlineParameters;
 
 
-		material.skinning = originalMaterial.skinning;
-		material.morphTargets = originalMaterial.morphTargets;
-		material.morphNormals = originalMaterial.morphNormals;
-		material.fog = originalMaterial.fog;
-		material.visible = originalMaterial.visible;
 		material.uniforms.outlineAlpha.value = originalMaterial.opacity;
 		material.uniforms.outlineAlpha.value = originalMaterial.opacity;
 
 
 		if ( outlineParameters !== undefined ) {
 		if ( outlineParameters !== undefined ) {
@@ -223,23 +298,73 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 			if ( outlineParameters.thickness !== undefined ) material.uniforms.outlineThickness.value = outlineParameters.thickness;
 			if ( outlineParameters.thickness !== undefined ) material.uniforms.outlineThickness.value = outlineParameters.thickness;
 			if ( outlineParameters.color !== undefined ) material.uniforms.outlineColor.value.copy( outlineParameters.color );
 			if ( outlineParameters.color !== undefined ) material.uniforms.outlineColor.value.copy( outlineParameters.color );
 			if ( outlineParameters.alpha !== undefined ) material.uniforms.outlineAlpha.value = outlineParameters.alpha;
 			if ( outlineParameters.alpha !== undefined ) material.uniforms.outlineAlpha.value = outlineParameters.alpha;
-			if ( outlineParameters.visible !== undefined ) material.visible = outlineParameters.visible;
 
 
 		}
 		}
 
 
-		if ( material.uniforms.outlineAlpha.value < 1.0 ) material.transparent = true;
-
 	}
 	}
 
 
-	function updateOutlineMultiMaterial ( material, originalMaterial ) {
+	function updateOutlineMaterial( material, originalMaterial ) {
+
+		if ( material === invisibleMaterial ) return;
 
 
 		var outlineParameters = originalMaterial.outlineParameters;
 		var outlineParameters = originalMaterial.outlineParameters;
 
 
-		material.visible = originalMaterial.visible;
+		material.skinning = originalMaterial.skinning;
+		material.morphTargets = originalMaterial.morphTargets;
+		material.morphNormals = originalMaterial.morphNormals;
+		material.fog = originalMaterial.fog;
 
 
 		if ( outlineParameters !== undefined ) {
 		if ( outlineParameters !== undefined ) {
 
 
-			if ( outlineParameters.visible !== undefined ) material.visible = outlineParameters.visible;
+			if ( originalMaterial.visible === false ) {
+
+				material.visible = false;
+
+			} else {
+
+				material.visible = ( outlineParameters.visible !== undefined ) ? outlineParameters.visible : true;
+
+			}
+
+			material.transparent = ( outlineParameters.alpha !== undefined && outlineParameters.alpha < 1.0 ) ? true : originalMaterial.transparent;
+
+			// cache[ originalMaterial.uuid ] is undefined if originalMaterial is in materials of MultiMaterial
+			if ( outlineParameters.keepAlive !== undefined && cache[ originalMaterial.uuid ] !== undefined ) cache[ originalMaterial.uuid ].keepAlive = outlineParameters.keepAlive;
+
+		} else {
+
+			material.transparent = originalMaterial.transparent;
+			material.visible = originalMaterial.visible;
+
+		}
+
+		if ( originalMaterial.wireframe === true || originalMaterial.depthTest === false ) material.visible = false;
+
+	}
+
+	function updateOutlineMultiMaterial( material, originalMaterial ) {
+
+		if ( material === invisibleMaterial ) return;
+
+		var outlineParameters = originalMaterial.outlineParameters;
+
+		if ( outlineParameters !== undefined ) {
+
+			if ( originalMaterial.visible === false ) {
+
+				material.visible = false;
+
+			} else {
+
+				material.visible = ( outlineParameters.visible !== undefined ) ? outlineParameters.visible : true;
+
+			}
+
+			if ( outlineParameters.keepAlive !== undefined ) cache[ originalMaterial.uuid ].keepAlive = outlineParameters.keepAlive;
+
+		} else {
+
+			material.visible = originalMaterial.visible;
 
 
 		}
 		}
 
 
@@ -251,9 +376,53 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 	}
 	}
 
 
-	function restoreOriginalMaterial ( object ) {
+	function cleanupCache() {
 
 
-		if ( object.userData.originalMaterial !== undefined ) object.material = object.userData.originalMaterial;
+		var keys;
+
+		// clear originialMaterials
+		keys = Object.keys( originalMaterials );
+
+		for ( var i = 0, il = keys.length; i < il; i ++ ) {
+
+			originalMaterials[ keys[ i ] ] = undefined;
+
+		}
+
+		// clear originalOnBeforeRenders
+		keys = Object.keys( originalOnBeforeRenders );
+
+		for ( var i = 0, il = keys.length; i < il; i ++ ) {
+
+			originalOnBeforeRenders[ keys[ i ] ] = undefined;
+
+		}
+
+		// remove unused outlineMaterial from cache
+		keys = Object.keys( cache );
+
+		for ( var i = 0, il = keys.length; i < il; i ++ ) {
+
+			var key = keys[ i ];
+
+			if ( cache[ key ].used === false ) {
+
+				cache[ key ].count++;
+
+				if ( cache[ key ].keepAlive === false && cache[ key ].count > removeThresholdCount ) {
+
+					delete cache[ key ];
+
+				}
+
+			} else {
+
+				cache[ key ].used = false;
+				cache[ key ].count = 0;
+
+			}
+
+		}
 
 
 	}
 	}
 
 
@@ -273,9 +442,11 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 		// 2. render outline
 		// 2. render outline
 		var currentSceneAutoUpdate = scene.autoUpdate;
 		var currentSceneAutoUpdate = scene.autoUpdate;
+		var currentSceneBackground = scene.background;
 		var currentShadowMapEnabled = renderer.shadowMap.enabled;
 		var currentShadowMapEnabled = renderer.shadowMap.enabled;
 
 
 		scene.autoUpdate = false;
 		scene.autoUpdate = false;
+		scene.background = null;
 		renderer.autoClear = false;
 		renderer.autoClear = false;
 		renderer.shadowMap.enabled = false;
 		renderer.shadowMap.enabled = false;
 
 
@@ -285,7 +456,10 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
 
 
 		scene.traverse( restoreOriginalMaterial );
 		scene.traverse( restoreOriginalMaterial );
 
 
+		cleanupCache();
+
 		scene.autoUpdate = currentSceneAutoUpdate;
 		scene.autoUpdate = currentSceneAutoUpdate;
+		scene.background = currentSceneBackground;
 		renderer.autoClear = currentAutoClear;
 		renderer.autoClear = currentAutoClear;
 		renderer.shadowMap.enabled = currentShadowMapEnabled;
 		renderer.shadowMap.enabled = currentShadowMapEnabled;
 
 

+ 20 - 23
examples/js/effects/VREffect.js

@@ -9,7 +9,7 @@
  *
  *
  */
  */
 
 
-THREE.VREffect = function ( renderer, onError ) {
+THREE.VREffect = function( renderer, onError ) {
 
 
 	var vrDisplay, vrDisplays;
 	var vrDisplay, vrDisplays;
 	var eyeTranslationL = new THREE.Vector3();
 	var eyeTranslationL = new THREE.Vector3();
@@ -20,7 +20,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	if ( 'VRFrameData' in window ) {
 	if ( 'VRFrameData' in window ) {
 
 
-		frameData = new VRFrameData();
+		frameData = new window.VRFrameData();
 
 
 	}
 	}
 
 
@@ -42,7 +42,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	if ( navigator.getVRDisplays ) {
 	if ( navigator.getVRDisplays ) {
 
 
-		navigator.getVRDisplays().then( gotVRDisplays ).catch ( function () {
+		navigator.getVRDisplays().then( gotVRDisplays ).catch( function() {
 
 
 			console.warn( 'THREE.VREffect: Unable to get VR Displays' );
 			console.warn( 'THREE.VREffect: Unable to get VR Displays' );
 
 
@@ -61,26 +61,26 @@ THREE.VREffect = function ( renderer, onError ) {
 	var rendererUpdateStyle = false;
 	var rendererUpdateStyle = false;
 	var rendererPixelRatio = renderer.getPixelRatio();
 	var rendererPixelRatio = renderer.getPixelRatio();
 
 
-	this.getVRDisplay = function () {
+	this.getVRDisplay = function() {
 
 
 		return vrDisplay;
 		return vrDisplay;
 
 
 	};
 	};
 
 
-	this.setVRDisplay = function ( value ) {
+	this.setVRDisplay = function( value ) {
 
 
 		vrDisplay = value;
 		vrDisplay = value;
 
 
 	};
 	};
 
 
-	this.getVRDisplays = function () {
+	this.getVRDisplays = function() {
 
 
 		console.warn( 'THREE.VREffect: getVRDisplays() is being deprecated.' );
 		console.warn( 'THREE.VREffect: getVRDisplays() is being deprecated.' );
 		return vrDisplays;
 		return vrDisplays;
 
 
 	};
 	};
 
 
-	this.setSize = function ( width, height, updateStyle ) {
+	this.setSize = function( width, height, updateStyle ) {
 
 
 		rendererSize = { width: width, height: height };
 		rendererSize = { width: width, height: height };
 		rendererUpdateStyle = updateStyle;
 		rendererUpdateStyle = updateStyle;
@@ -100,12 +100,9 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	};
 	};
 
 
-	// fullscreen
+	// VR presentation
 
 
 	var canvas = renderer.domElement;
 	var canvas = renderer.domElement;
-	var requestFullscreen;
-	var exitFullscreen;
-	var fullscreenElement;
 	var defaultLeftBounds = [ 0.0, 0.0, 0.5, 1.0 ];
 	var defaultLeftBounds = [ 0.0, 0.0, 0.5, 1.0 ];
 	var defaultRightBounds = [ 0.5, 0.0, 0.5, 1.0 ];
 	var defaultRightBounds = [ 0.5, 0.0, 0.5, 1.0 ];
 
 
@@ -120,7 +117,7 @@ THREE.VREffect = function ( renderer, onError ) {
 			var eyeWidth = eyeParamsL.renderWidth;
 			var eyeWidth = eyeParamsL.renderWidth;
 			var eyeHeight = eyeParamsL.renderHeight;
 			var eyeHeight = eyeParamsL.renderHeight;
 
 
-			if ( !wasPresenting ) {
+			if ( ! wasPresenting ) {
 
 
 				rendererPixelRatio = renderer.getPixelRatio();
 				rendererPixelRatio = renderer.getPixelRatio();
 				rendererSize = renderer.getSize();
 				rendererSize = renderer.getSize();
@@ -141,9 +138,9 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
 	window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
 
 
-	this.setFullScreen = function ( boolean ) {
+	this.setFullScreen = function( boolean ) {
 
 
-		return new Promise( function ( resolve, reject ) {
+		return new Promise( function( resolve, reject ) {
 
 
 			if ( vrDisplay === undefined ) {
 			if ( vrDisplay === undefined ) {
 
 
@@ -173,19 +170,19 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	};
 	};
 
 
-	this.requestPresent = function () {
+	this.requestPresent = function() {
 
 
 		return this.setFullScreen( true );
 		return this.setFullScreen( true );
 
 
 	};
 	};
 
 
-	this.exitPresent = function () {
+	this.exitPresent = function() {
 
 
 		return this.setFullScreen( false );
 		return this.setFullScreen( false );
 
 
 	};
 	};
 
 
-	this.requestAnimationFrame = function ( f ) {
+	this.requestAnimationFrame = function( f ) {
 
 
 		if ( vrDisplay !== undefined ) {
 		if ( vrDisplay !== undefined ) {
 
 
@@ -199,7 +196,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	};
 	};
 
 
-	this.cancelAnimationFrame = function ( h ) {
+	this.cancelAnimationFrame = function( h ) {
 
 
 		if ( vrDisplay !== undefined ) {
 		if ( vrDisplay !== undefined ) {
 
 
@@ -213,7 +210,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	};
 	};
 
 
-	this.submitFrame = function () {
+	this.submitFrame = function() {
 
 
 		if ( vrDisplay !== undefined && scope.isPresenting ) {
 		if ( vrDisplay !== undefined && scope.isPresenting ) {
 
 
@@ -233,7 +230,7 @@ THREE.VREffect = function ( renderer, onError ) {
 	var cameraR = new THREE.PerspectiveCamera();
 	var cameraR = new THREE.PerspectiveCamera();
 	cameraR.layers.enable( 2 );
 	cameraR.layers.enable( 2 );
 
 
-	this.render = function ( scene, camera, renderTarget, forceClear ) {
+	this.render = function( scene, camera, renderTarget, forceClear ) {
 
 
 		if ( vrDisplay && scope.isPresenting ) {
 		if ( vrDisplay && scope.isPresenting ) {
 
 
@@ -284,13 +281,13 @@ THREE.VREffect = function ( renderer, onError ) {
 				x: Math.round( size.width * leftBounds[ 0 ] ),
 				x: Math.round( size.width * leftBounds[ 0 ] ),
 				y: Math.round( size.height * leftBounds[ 1 ] ),
 				y: Math.round( size.height * leftBounds[ 1 ] ),
 				width: Math.round( size.width * leftBounds[ 2 ] ),
 				width: Math.round( size.width * leftBounds[ 2 ] ),
-				height: Math.round(size.height * leftBounds[ 3 ] )
+				height: Math.round( size.height * leftBounds[ 3 ] )
 			};
 			};
 			renderRectR = {
 			renderRectR = {
 				x: Math.round( size.width * rightBounds[ 0 ] ),
 				x: Math.round( size.width * rightBounds[ 0 ] ),
 				y: Math.round( size.height * rightBounds[ 1 ] ),
 				y: Math.round( size.height * rightBounds[ 1 ] ),
 				width: Math.round( size.width * rightBounds[ 2 ] ),
 				width: Math.round( size.width * rightBounds[ 2 ] ),
-				height: Math.round(size.height * rightBounds[ 3 ] )
+				height: Math.round( size.height * rightBounds[ 3 ] )
 			};
 			};
 
 
 			if ( renderTarget ) {
 			if ( renderTarget ) {
@@ -397,7 +394,7 @@ THREE.VREffect = function ( renderer, onError ) {
 
 
 	};
 	};
 
 
-	this.dispose = function () {
+	this.dispose = function() {
 
 
 		window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
 		window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false );
 
 

+ 1 - 1
examples/js/loaders/3MFLoader.js

@@ -12,7 +12,7 @@ THREE.ThreeMFLoader.prototype = {
 	load: function ( url, onLoad, onProgress, onError ) {
 	load: function ( url, onLoad, onProgress, onError ) {
 
 
 		var scope = this;
 		var scope = this;
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function( text ) {
 		loader.load( url, function( text ) {
 
 

+ 1 - 1
examples/js/loaders/AMFLoader.js

@@ -33,7 +33,7 @@ THREE.AMFLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function( text ) {
 		loader.load( url, function( text ) {
 
 

+ 1 - 1
examples/js/loaders/AWDLoader.js

@@ -109,7 +109,7 @@
 			this._url = url;
 			this._url = url;
 			this._baseDir = url.substr( 0, url.lastIndexOf( '/' ) + 1 );
 			this._baseDir = url.substr( 0, url.lastIndexOf( '/' ) + 1 );
 
 
-			var loader = new THREE.XHRLoader( this.manager );
+			var loader = new THREE.FileLoader( this.manager );
 			loader.setResponseType( 'arraybuffer' );
 			loader.setResponseType( 'arraybuffer' );
 			loader.load( url, function ( text ) {
 			loader.load( url, function ( text ) {
 
 

+ 1 - 1
examples/js/loaders/AssimpJSONLoader.js

@@ -27,7 +27,7 @@ THREE.AssimpJSONLoader.prototype = {
 
 
 		this.texturePath = this.texturePath && ( typeof this.texturePath === "string" ) ? this.texturePath : this.extractUrlBase( url );
 		this.texturePath = this.texturePath && ( typeof this.texturePath === "string" ) ? this.texturePath : this.extractUrlBase( url );
 
 
-		var loader = new THREE.XHRLoader( this.manager );
+		var loader = new THREE.FileLoader( this.manager );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 
 			var json = JSON.parse( text ), scene, metadata;
 			var json = JSON.parse( text ), scene, metadata;

+ 1 - 1
examples/js/loaders/BVHLoader.js

@@ -24,7 +24,7 @@ THREE.BVHLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function( buffer ) {
 		loader.load( url, function( buffer ) {
 
 

+ 1 - 1
examples/js/loaders/BabylonLoader.js

@@ -16,7 +16,7 @@ THREE.BabylonLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 
 			onLoad( scope.parse( JSON.parse( text ) ) );
 			onLoad( scope.parse( JSON.parse( text ) ) );

+ 2 - 2
examples/js/loaders/BinaryLoader.js

@@ -37,14 +37,14 @@ THREE.BinaryLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var jsonloader = new THREE.XHRLoader( this.manager );
+		var jsonloader = new THREE.FileLoader( this.manager );
 		jsonloader.load( url, function ( data ) {
 		jsonloader.load( url, function ( data ) {
 
 
 			var json = JSON.parse( data );
 			var json = JSON.parse( data );
 
 
 			var bufferUrl = binaryPath + json.buffers;
 			var bufferUrl = binaryPath + json.buffers;
 
 
-			var bufferLoader = new THREE.XHRLoader( scope.manager );
+			var bufferLoader = new THREE.FileLoader( scope.manager );
 			bufferLoader.setResponseType( 'arraybuffer' );
 			bufferLoader.setResponseType( 'arraybuffer' );
 			bufferLoader.load( bufferUrl, function ( bufData ) {
 			bufferLoader.load( bufferUrl, function ( bufData ) {
 
 

+ 1 - 1
examples/js/loaders/ColladaLoader2.js

@@ -24,7 +24,7 @@ THREE.ColladaLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 
 			onLoad( scope.parse( text, getBaseUrl( url ) ) );
 			onLoad( scope.parse( text, getBaseUrl( url ) ) );

+ 2 - 2
examples/js/loaders/FBXLoader.js

@@ -33,7 +33,7 @@
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		// loader.setCrossOrigin( this.crossOrigin );
 		// loader.setCrossOrigin( this.crossOrigin );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 
@@ -528,7 +528,7 @@
 
 
 	THREE.FBXLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType ) {
 	THREE.FBXLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType ) {
 
 
-		var loader = new THREE.XHRLoader( this.manager );
+		var loader = new THREE.FileLoader( this.manager );
 
 
 		loader.setResponseType( responseType );
 		loader.setResponseType( responseType );
 
 

+ 5 - 5
examples/js/loaders/GLTFLoader.js

@@ -24,7 +24,7 @@ THREE.GLTFLoader.prototype = {
 
 
 		var path = this.path && ( typeof this.path === "string" ) ? this.path : THREE.Loader.prototype.extractUrlBase( url );
 		var path = this.path && ( typeof this.path === "string" ) ? this.path : THREE.Loader.prototype.extractUrlBase( url );
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.load( url, function( text ) {
 		loader.load( url, function( text ) {
 
 
 			scope.parse( JSON.parse( text ), onLoad, path );
 			scope.parse( JSON.parse( text ), onLoad, path );
@@ -664,7 +664,7 @@ var replaceTHREEShaderAttributes = function( shaderText, technique ) {
 
 
 		var semantic = param.semantic;
 		var semantic = param.semantic;
 
 
-		var regEx = new RegExp( pname, "g" );
+		var regEx = new RegExp( "\\b" + pname + "\\b", "g" );
 
 
 		switch ( semantic ) {
 		switch ( semantic ) {
 
 
@@ -822,7 +822,7 @@ GLTFParser.prototype.loadShaders = function() {
 
 
 		return new Promise( function( resolve ) {
 		return new Promise( function( resolve ) {
 
 
-			var loader = new THREE.XHRLoader();
+			var loader = new THREE.FileLoader();
 			loader.responseType = 'text';
 			loader.responseType = 'text';
 			loader.load( resolveURL( shader.uri, this.options.path ), function( shaderText ) {
 			loader.load( resolveURL( shader.uri, this.options.path ), function( shaderText ) {
 
 
@@ -844,7 +844,7 @@ GLTFParser.prototype.loadBuffers = function() {
 
 
 			return new Promise( function( resolve ) {
 			return new Promise( function( resolve ) {
 
 
-				var loader = new THREE.XHRLoader();
+				var loader = new THREE.FileLoader();
 				loader.responseType = 'arraybuffer';
 				loader.responseType = 'arraybuffer';
 				loader.load( resolveURL( buffer.uri, this.options.path ), function( buffer ) {
 				loader.load( resolveURL( buffer.uri, this.options.path ), function( buffer ) {
 
 
@@ -1080,7 +1080,7 @@ GLTFParser.prototype.loadMaterials = function() {
 
 
 									}
 									}
 
 
-									if ( value ) {
+									if ( value !== undefined ) {
 
 
 										uvalue = value;
 										uvalue = value;
 
 

+ 1 - 1
examples/js/loaders/HDRCubeTextureLoader.js

@@ -27,7 +27,7 @@ THREE.HDRCubeTextureLoader.prototype.load = function(type, urls, onLoad, onProgr
   var loaded = 0;
   var loaded = 0;
 
 
   function loadHDRData(i, onLoad, onProgress, onError) {
   function loadHDRData(i, onLoad, onProgress, onError) {
-    var loader = new THREE.XHRLoader( this.manager );
+    var loader = new THREE.FileLoader( this.manager );
     loader.setResponseType( 'arraybuffer' );
     loader.setResponseType( 'arraybuffer' );
 
 
     loader.load( urls[i], function ( buffer ) {
     loader.load( urls[i], function ( buffer ) {

+ 1 - 1
examples/js/loaders/KMZLoader.js

@@ -16,7 +16,7 @@ THREE.KMZLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 

+ 1 - 1
examples/js/loaders/MD2Loader.js

@@ -16,7 +16,7 @@ THREE.MD2Loader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function ( buffer ) {
 		loader.load( url, function ( buffer ) {
 
 

+ 304 - 141
examples/js/loaders/MMDLoader.js

@@ -41,19 +41,31 @@ THREE.MMDLoader = function ( manager ) {
 
 
 	THREE.Loader.call( this );
 	THREE.Loader.call( this );
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
 	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
-	this.defaultTexturePath = './models/default/';
 
 
 };
 };
 
 
 THREE.MMDLoader.prototype = Object.create( THREE.Loader.prototype );
 THREE.MMDLoader.prototype = Object.create( THREE.Loader.prototype );
 THREE.MMDLoader.prototype.constructor = THREE.MMDLoader;
 THREE.MMDLoader.prototype.constructor = THREE.MMDLoader;
 
 
-THREE.MMDLoader.prototype.setDefaultTexturePath = function ( path ) {
-
-	this.defaultTexturePath = path;
-	if ( this.defaultTexturePath.lastIndexOf( '/' ) !== this.defaultTexturePath.length - 1 ) this.defaultTexturePath += '/';
-
-};
+/*
+ * base64 encoded defalut toon textures toon00.bmp - toon10.bmp
+ * Users don't need to prepare default texture files.
+ *
+ * This idea is from http://www20.atpages.jp/katwat/three.js_r58/examples/mytest37/mmd.three.js
+ */
+THREE.MMDLoader.prototype.defaultToonTextures = [
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/bWiiMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh8aBHZBl14e8wAAAABJRU5ErkJggg==',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOUlEQVRYR+3WMREAMAwDsYY/yoDI7MLwIiP40+RJklfcCCBAgAABAgTqArfb/QMCCBAgQIAAgbbAB3z/e0F3js2cAAAAAElFTkSuQmCC',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAN0lEQVRYR+3WQREAMBACsZ5/B5ilMvgEBTt5cW37hjsBBAgQIECAwFwgyfYPCCBAgAABAgTWAh81dWyx0gFwKAAAAABJRU5ErkJggg==',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAOklEQVRYR+3WoREAMAwDsWb/UQtCy9wxTOQJ/oQ8SXKKGwEECBAgQIBAXeDt7f4BAQQIECBAgEBb4AOz8Hzx7WLY4wAAAABJRU5ErkJggg==',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPUlEQVRYR+1XwW7CMAy1+f9fZOMysSEOEweEOPRNdm3HbdOyIhAcklPrOs/PLy9RygBALxzcCDQFmgJNgaZAU6Ap0BR4PwX8gsRMVLssMRH5HcpzJEaWL7EVg9F1IHRlyqQohgVr4FGUlUcMJSjcUlDw0zvjeun70cLWmneoyf7NgBTQSniBTQQSuJAZsOnnaczjIMb5hCiuHKxokCrJfVnrctyZL0PkJAJe1HMil4nxeyi3Ypfn1kX51jpPvo/JeCNC4PhVdHdJw2XjBR8brF8PEIhNVn12AgP7uHsTBguBn53MUZCqv7Lp07Pn5k1Ro+uWmUNn7D+M57rtk7aG0Vo73xyF/fbFf0bPJjDXngnGocDTdFhygZjwUQrMNrDcmZlQT50VJ/g/UwNyHpu778+yW+/ksOz/BFo54P4AsUXMfRq7XWsAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACMElEQVRYR+2Xv4pTQRTGf2dubhLdICiii2KnYKHVolhauKWPoGAnNr6BD6CvIVaihYuI2i1ia0BY0MZGRHQXjZj/mSPnnskfNWiWZUlzJ5k7M2cm833nO5Mziej2DWWJRUoCpQKlAntSQCqgw39/iUWAGmh37jrRnVsKlgpiqmkoGVABA7E57fvY+pJDdgKqF6HzFCSADkDq+F6AHABtQ+UMVE5D7zXod7fFNhTEckTbj5XQgHzNN+5tQvc5NG7C6BNkp6D3EmpXHDR+dQAjFLchW3VS9rlw3JBh+B7ys5Cf9z0GW1C/7P32AyBAOAz1q4jGliIH3YPuBnSfQX4OGreTIgEYQb/pBDtPnEQ4CivXYPAWBk13oHrB54yA9QuSn2H4AcKRpEILDt0BUzj+RLR1V5EqjD66NPRBVpLcQwjHoHYJOhsQv6U4mnzmrIXJCFr4LDwm/xBUoboG9XX4cc9VKdYoSA2yk5NQLJaKDUjTBoveG3Z2TElTxwjNK4M3LEZgUdDdruvcXzKBpStgp2NPiWi3ks9ZXxIoFVi+AvHLdc9TqtjL3/aYjpPlrzOcEnK62Szhimdd7xX232zFDTgtxezOu3WNMRLjiKgjtOhHVMd1loynVHvOgjuIIJMaELEqhJAV/RCSLbWTcfPFakFgFlALTRRvx+ok6Hlp/Q+v3fmx90bMyUzaEAhmM3KvHlXTL5DxnbGf/1M8RNNACLL5MNtPxP/mypJAqcDSFfgFhpYqWUzhTEAAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII=',
+	'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAL0lEQVRYR+3QQREAAAzCsOFfNJPBJ1XQS9r2hsUAAQIECBAgQIAAAQIECBAgsBZ4MUx/ofm2I/kAAAAASUVORK5CYII='
+];
 
 
 THREE.MMDLoader.prototype.load = function ( modelUrl, vmdUrls, callback, onProgress, onError ) {
 THREE.MMDLoader.prototype.load = function ( modelUrl, vmdUrls, callback, onProgress, onError ) {
 
 
@@ -309,9 +321,11 @@ THREE.MMDLoader.prototype.extractExtension = function ( url ) {
 
 
 };
 };
 
 
-THREE.MMDLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType ) {
+THREE.MMDLoader.prototype.loadFile = function ( url, onLoad, onProgress, onError, responseType, mimeType ) {
 
 
-	var loader = new THREE.XHRLoader( this.manager );
+	var loader = new THREE.FileLoader( this.manager );
+
+	if ( mimeType !== undefined ) loader.setMimeType( mimeType );
 
 
 	loader.setResponseType( responseType );
 	loader.setResponseType( responseType );
 
 
@@ -339,15 +353,7 @@ THREE.MMDLoader.prototype.loadFileAsText = function ( url, onLoad, onProgress, o
 
 
 THREE.MMDLoader.prototype.loadFileAsShiftJISText = function ( url, onLoad, onProgress, onError ) {
 THREE.MMDLoader.prototype.loadFileAsShiftJISText = function ( url, onLoad, onProgress, onError ) {
 
 
-	var request = this.loadFile( url, onLoad, onProgress, onError, 'text' );
-
-	/*
-	 * TODO: some browsers seem not support overrideMimeType
-	 *       so some workarounds for them may be necessary.
-	 * Note: to set property of request after calling request.send(null)
-	 *       (it's called in THREE.XHRLoader.load()) could be a bad manner.
-	 */
-	request.overrideMimeType( 'text/plain; charset=shift_jis' );
+	var request = this.loadFile( url, onLoad, onProgress, onError, 'text', 'text/plain; charset=shift_jis' );
 
 
 };
 };
 
 
@@ -787,7 +793,7 @@ THREE.MMDLoader.prototype.parsePmd = function ( buffer ) {
 			p.weight = dv.getFloat32();
 			p.weight = dv.getFloat32();
 			p.positionDamping = dv.getFloat32();
 			p.positionDamping = dv.getFloat32();
 			p.rotationDamping = dv.getFloat32();
 			p.rotationDamping = dv.getFloat32();
-			p.restriction = dv.getFloat32();
+			p.restitution = dv.getFloat32();
 			p.friction = dv.getFloat32();
 			p.friction = dv.getFloat32();
 			p.type = dv.getUint8();
 			p.type = dv.getUint8();
 			return p;
 			return p;
@@ -1232,6 +1238,22 @@ THREE.MMDLoader.prototype.parsePmx = function ( buffer ) {
 					m.uv = dv.getFloat32Array( 4 );
 					m.uv = dv.getFloat32Array( 4 );
 					p.elements.push( m );
 					p.elements.push( m );
 
 
+				} else if ( p.type === 4 ) {  // additional uv1
+
+					// TODO: implement
+
+				} else if ( p.type === 5 ) {  // additional uv2
+
+					// TODO: implement
+
+				} else if ( p.type === 6 ) {  // additional uv3
+
+					// TODO: implement
+
+				} else if ( p.type === 7 ) {  // additional uv4
+
+					// TODO: implement
+
 				} else if ( p.type === 8 ) {  // material morph
 				} else if ( p.type === 8 ) {  // material morph
 
 
 					var m = {};
 					var m = {};
@@ -1325,7 +1347,7 @@ THREE.MMDLoader.prototype.parsePmx = function ( buffer ) {
 			p.weight = dv.getFloat32();
 			p.weight = dv.getFloat32();
 			p.positionDamping = dv.getFloat32();
 			p.positionDamping = dv.getFloat32();
 			p.rotationDamping = dv.getFloat32();
 			p.rotationDamping = dv.getFloat32();
-			p.restriction = dv.getFloat32();
+			p.restitution = dv.getFloat32();
 			p.friction = dv.getFloat32();
 			p.friction = dv.getFloat32();
 			p.type = dv.getUint8();
 			p.type = dv.getUint8();
 			return p;
 			return p;
@@ -1682,41 +1704,54 @@ THREE.MMDLoader.prototype.parseVpd = function ( text ) {
 THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress, onError ) {
 THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress, onError ) {
 
 
 	var scope = this;
 	var scope = this;
-	var geometry = new THREE.Geometry();
-        var material = new THREE.MultiMaterial();
+	var geometry = new THREE.BufferGeometry();
+	var material = new THREE.MultiMaterial();
 	var helper = new THREE.MMDLoader.DataCreationHelper();
 	var helper = new THREE.MMDLoader.DataCreationHelper();
 
 
+	var buffer = {};
+
+	buffer.vertices = [];
+	buffer.uvs = [];
+	buffer.normals = [];
+	buffer.skinIndices = [];
+	buffer.skinWeights = [];
+	buffer.indices = [];
+
 	var initVartices = function () {
 	var initVartices = function () {
 
 
 		for ( var i = 0; i < model.metadata.vertexCount; i++ ) {
 		for ( var i = 0; i < model.metadata.vertexCount; i++ ) {
 
 
 			var v = model.vertices[ i ];
 			var v = model.vertices[ i ];
 
 
-			geometry.vertices.push(
-				new THREE.Vector3(
-					v.position[ 0 ],
-					v.position[ 1 ],
-					v.position[ 2 ]
-				)
-			);
+			for ( var j = 0, jl = v.position.length; j < jl; j ++ ) {
 
 
-			geometry.skinIndices.push(
-				new THREE.Vector4(
-					v.skinIndices.length >= 1 ? v.skinIndices[ 0 ] : 0.0,
-					v.skinIndices.length >= 2 ? v.skinIndices[ 1 ] : 0.0,
-					v.skinIndices.length >= 3 ? v.skinIndices[ 2 ] : 0.0,
-					v.skinIndices.length >= 4 ? v.skinIndices[ 3 ] : 0.0
-				)
-			);
+				buffer.vertices.push( v.position[ j ] );
 
 
-			geometry.skinWeights.push(
-				new THREE.Vector4(
-					v.skinWeights.length >= 1 ? v.skinWeights[ 0 ] : 0.0,
-					v.skinWeights.length >= 2 ? v.skinWeights[ 1 ] : 0.0,
-					v.skinWeights.length >= 3 ? v.skinWeights[ 2 ] : 0.0,
-					v.skinWeights.length >= 4 ? v.skinWeights[ 3 ] : 0.0
-				)
-			);
+			}
+
+			for ( var j = 0, jl = v.normal.length; j < jl; j ++ ) {
+
+				buffer.normals.push( v.normal[ j ] );
+
+			}
+
+			for ( var j = 0, jl = v.uv.length; j < jl; j ++ ) {
+
+				buffer.uvs.push( v.uv[ j ] );
+
+			}
+
+			for ( var j = 0; j < 4; j ++ ) {
+
+				buffer.skinIndices.push( v.skinIndices.length - 1 >= j ? v.skinIndices[ j ] : 0.0 );
+
+			}
+
+			for ( var j = 0; j < 4; j ++ ) {
+
+				buffer.skinWeights.push( v.skinWeights.length - 1 >= j ? v.skinWeights[ j ] : 0.0 );
+
+			}
 
 
 		}
 		}
 
 
@@ -1726,22 +1761,11 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 		for ( var i = 0; i < model.metadata.faceCount; i++ ) {
 		for ( var i = 0; i < model.metadata.faceCount; i++ ) {
 
 
-			geometry.faces.push(
-				new THREE.Face3(
-					model.faces[ i ].indices[ 0 ],
-					model.faces[ i ].indices[ 1 ],
-					model.faces[ i ].indices[ 2 ]
-				)
-			);
+			var f = model.faces[ i ];
 
 
-			for ( var j = 0; j < 3; j++ ) {
+			for ( var j = 0, jl = f.indices.length; j < jl; j ++ ) {
 
 
-				geometry.faces[ i ].vertexNormals[ j ] =
-					new THREE.Vector3(
-						model.vertices[ model.faces[ i ].indices[ j ] ].normal[ 0 ],
-						model.vertices[ model.faces[ i ].indices[ j ] ].normal[ 1 ],
-						model.vertices[ model.faces[ i ].indices[ j ] ].normal[ 2 ]
-					);
+				buffer.indices.push( f.indices[ j ] );
 
 
 			}
 			}
 
 
@@ -1753,6 +1777,21 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 		var bones = [];
 		var bones = [];
 
 
+		var rigidBodies = model.rigidBodies;
+		var dictionary = {};
+
+		for ( var i = 0, il = rigidBodies.length; i < il; i ++ ) {
+
+			var body = rigidBodies[ i ];
+			var value = dictionary[ body.boneIndex ];
+
+			// keeps greater number if already value is set without any special reasons
+			value = value === undefined ? body.type : Math.max( body.type, value );
+
+			dictionary[ body.boneIndex ] = value;
+
+		}
+
 		for ( var i = 0; i < model.metadata.boneCount; i++ ) {
 		for ( var i = 0; i < model.metadata.boneCount; i++ ) {
 
 
 			var bone = {};
 			var bone = {};
@@ -1772,6 +1811,8 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 			}
 			}
 
 
+			bone.rigidBodyType = dictionary[ i ] !== undefined ? dictionary[ i ] : -1;
+
 			bones.push( bone );
 			bones.push( bone );
 
 
 		}
 		}
@@ -1842,6 +1883,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 					var link = {};
 					var link = {};
 					link.index = ik.links[ j ].index;
 					link.index = ik.links[ j ].index;
+					link.enabled = true;
 
 
 					if ( ik.links[ j ].angleLimitation === 1 ) {
 					if ( ik.links[ j ].angleLimitation === 1 ) {
 
 
@@ -1906,15 +1948,15 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 	var initMorphs = function () {
 	var initMorphs = function () {
 
 
-		function updateVertex ( params, index, v, ratio ) {
+		function updateVertex( attribute, index, v, ratio ) {
 
 
-			params.vertices[ index ].x += v.position[ 0 ] * ratio;
-			params.vertices[ index ].y += v.position[ 1 ] * ratio;
-			params.vertices[ index ].z += v.position[ 2 ] * ratio;
+			attribute.array[ index * 3 + 0 ] += v.position[ 0 ] * ratio;
+			attribute.array[ index * 3 + 1 ] += v.position[ 1 ] * ratio;
+			attribute.array[ index * 3 + 2 ] += v.position[ 2 ] * ratio;
 
 
 		};
 		};
 
 
-		function updateVertices ( params, m, ratio ) {
+		function updateVertices( attribute, m, ratio ) {
 
 
 			for ( var i = 0; i < m.elementCount; i++ ) {
 			for ( var i = 0; i < m.elementCount; i++ ) {
 
 
@@ -1932,26 +1974,25 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 				}
 				}
 
 
-				updateVertex( params, index, v, ratio );
+				updateVertex( attribute, index, v, ratio );
 
 
 			}
 			}
 
 
 		};
 		};
 
 
+		var morphTargets = [];
+		var attributes = [];
+
 		for ( var i = 0; i < model.metadata.morphCount; i++ ) {
 		for ( var i = 0; i < model.metadata.morphCount; i++ ) {
 
 
 			var m = model.morphs[ i ];
 			var m = model.morphs[ i ];
-			var params = {};
+			var params = { name: m.name };
 
 
-			params.name = m.name;
-			params.vertices = [];
+			var attribute = new THREE.Float32Attribute( model.metadata.vertexCount * 3, 3 );
 
 
-			for ( var j = 0; j < model.metadata.vertexCount; j++ ) {
+			for ( var j = 0; j < model.metadata.vertexCount * 3; j++ ) {
 
 
-				params.vertices[ j ] = new THREE.Vector3( 0, 0, 0 );
-				params.vertices[ j ].x = geometry.vertices[ j ].x;
-				params.vertices[ j ].y = geometry.vertices[ j ].y;
-				params.vertices[ j ].z = geometry.vertices[ j ].z;
+				attribute.array[ j ] = buffer.vertices[ j ];
 
 
 			}
 			}
 
 
@@ -1959,13 +2000,13 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 				if ( i !== 0 ) {
 				if ( i !== 0 ) {
 
 
-					updateVertices( params, m, 1.0 );
+					updateVertices( attribute, m, 1.0 );
 
 
 				}
 				}
 
 
 			} else {
 			} else {
 
 
-				if ( m.type === 0 ) {
+				if ( m.type === 0 ) {    // group
 
 
 					for ( var j = 0; j < m.elementCount; j++ ) {
 					for ( var j = 0; j < m.elementCount; j++ ) {
 
 
@@ -1974,25 +2015,60 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 						if ( m2.type === 1 ) {
 						if ( m2.type === 1 ) {
 
 
-							updateVertices( params, m2, ratio );
+							updateVertices( attribute, m2, ratio );
+
+						} else {
+
+							// TODO: implement
 
 
 						}
 						}
 
 
 					}
 					}
 
 
-				} else if ( m.type === 1 ) {
+				} else if ( m.type === 1 ) {    // vertex
+
+					updateVertices( attribute, m, 1.0 );
+
+				} else if ( m.type === 2 ) {    // bone
+
+					// TODO: implement
 
 
-					updateVertices( params, m, 1.0 );
+				} else if ( m.type === 3 ) {    // uv
+
+					// TODO: implement
+
+				} else if ( m.type === 4 ) {    // additional uv1
+
+					// TODO: implement
+
+				} else if ( m.type === 5 ) {    // additional uv2
+
+					// TODO: implement
+
+				} else if ( m.type === 6 ) {    // additional uv3
+
+					// TODO: implement
+
+				} else if ( m.type === 7 ) {    // additional uv4
+
+					// TODO: implement
+
+				} else if ( m.type === 8 ) {    // material
+
+					// TODO: implement
 
 
 				}
 				}
 
 
 			}
 			}
 
 
-			// TODO: skip if this's non-vertex morphing of PMX to reduce CPU/Memory use
-			geometry.morphTargets.push( params );
+			morphTargets.push( params );
+			attributes.push( attribute );
 
 
 		}
 		}
 
 
+		geometry.morphTargets = morphTargets;
+		geometry.morphAttributes.position = attributes;
+
 	};
 	};
 
 
 	var initMaterials = function () {
 	var initMaterials = function () {
@@ -2012,8 +2088,26 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 			}
 			}
 
 
-			var directoryPath = ( params.defaultTexturePath === true ) ? scope.defaultTexturePath : texturePath;
-			var fullPath = directoryPath + filePath;
+			var fullPath;
+
+			if ( params.defaultTexturePath === true ) {
+
+				try {
+
+					fullPath = scope.defaultToonTextures[ parseInt( filePath.match( 'toon([0-9]{2})\.bmp$' )[ 1 ] ) ];
+
+				} catch ( e ) {
+
+					console.warn( 'THREE.MMDLoader: ' + filePath + ' seems like not right default texture path. Using toon00.bmp instead.' )
+					fullPath = scope.defaultToonTextures[ 0 ];
+
+				}
+
+			} else {
+
+				fullPath = texturePath + filePath;
+
+			}
 
 
 			var loader = THREE.Loader.Handlers.get( fullPath );
 			var loader = THREE.Loader.Handlers.get( fullPath );
 
 
@@ -2067,12 +2161,6 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 		};
 		};
 
 
-		for ( var i = 0; i < model.metadata.materialCount; i++ ) {
-
-			geometry.faceVertexUvs.push( [] );
-
-		}
-
 		for ( var i = 0; i < model.metadata.materialCount; i++ ) {
 		for ( var i = 0; i < model.metadata.materialCount; i++ ) {
 
 
 			var m = model.materials[ i ];
 			var m = model.materials[ i ];
@@ -2081,24 +2169,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 			params.faceOffset = offset;
 			params.faceOffset = offset;
 			params.faceNum = m.faceCount;
 			params.faceNum = m.faceCount;
 
 
-			for ( var j = 0; j < m.faceCount; j++ ) {
-
-				geometry.faces[ offset ].materialIndex = i;
-
-				var uvs = [];
-
-				for ( var k = 0; k < 3; k++ ) {
-
-					var v = model.vertices[ model.faces[ offset ].indices[ k ] ];
-					uvs.push( new THREE.Vector2( v.uv[ 0 ], v.uv[ 1 ] ) );
-
-				}
-
-				geometry.faceVertexUvs[ 0 ].push( uvs );
-
-				offset++;
-
-			}
+			offset += m.faceCount;
 
 
 			params.name = m.name;
 			params.name = m.name;
 			params.color = color.fromArray( [ m.diffuse[ 0 ], m.diffuse[ 1 ], m.diffuse[ 2 ] ] ).clone();
 			params.color = color.fromArray( [ m.diffuse[ 0 ], m.diffuse[ 1 ], m.diffuse[ 2 ] ] ).clone();
@@ -2212,15 +2283,14 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 			var p2 = model.materials[ i ];
 			var p2 = model.materials[ i ];
 			var m = new THREE.MeshPhongMaterial();
 			var m = new THREE.MeshPhongMaterial();
 
 
-			m.faceOffset = p.faceOffset;
-			m.faceNum = p.faceNum;
+			geometry.addGroup( p.faceOffset * 3, p.faceNum * 3, i );
 
 
 			if ( p.name !== undefined ) m.name = p.name;
 			if ( p.name !== undefined ) m.name = p.name;
 
 
 			m.skinning = geometry.bones.length > 0 ? true : false;
 			m.skinning = geometry.bones.length > 0 ? true : false;
 			m.morphTargets = geometry.morphTargets.length > 0 ? true : false;
 			m.morphTargets = geometry.morphTargets.length > 0 ? true : false;
 			m.lights = true;
 			m.lights = true;
-			m.side = p.side;
+			m.side = ( model.metadata.format === 'pmx' && ( p2.flag & 0x1 ) === 1 ) ? THREE.DoubleSide : p.side;
 			m.transparent = p.transparent;
 			m.transparent = p.transparent;
 			m.fog = true;
 			m.fog = true;
 
 
@@ -2232,6 +2302,9 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 			if ( p.map !== undefined ) {
 			if ( p.map !== undefined ) {
 
 
+				m.faceOffset = p.faceOffset;
+				m.faceNum = p.faceNum;
+
 				// Check if this part of the texture image the material uses requires transparency
 				// Check if this part of the texture image the material uses requires transparency
 				function checkTextureTransparency ( m ) {
 				function checkTextureTransparency ( m ) {
 
 
@@ -2251,7 +2324,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 						};
 						};
 
 
-						function detectTextureTransparency ( image, uvs ) {
+						function detectTextureTransparency( image, uvs, indices ) {
 
 
 							var width = image.width;
 							var width = image.width;
 							var height = image.height;
 							var height = image.height;
@@ -2264,13 +2337,14 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 							}
 							}
 
 
-							for ( var i = 0; i < uvs.length; i++ ) {
+							for ( var i = 0; i < indices.length; i += 3 ) {
 
 
 								var centerUV = { x: 0.0, y: 0.0 };
 								var centerUV = { x: 0.0, y: 0.0 };
 
 
 								for ( var j = 0; j < 3; j++ ) {
 								for ( var j = 0; j < 3; j++ ) {
 
 
-									var uv = uvs[ i ][ j ];
+									var index = indices[ i * 3 + j ];
+									var uv = { x: uvs[ index * 2 + 0 ], y: uvs[ index * 2 + 1 ] };
 
 
 									if ( getAlphaByUv( image, uv ) < threshold ) {
 									if ( getAlphaByUv( image, uv ) < threshold ) {
 
 
@@ -2286,7 +2360,6 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 								centerUV.x /= 3;
 								centerUV.x /= 3;
 								centerUV.y /= 3;
 								centerUV.y /= 3;
 
 
-
 								if ( getAlphaByUv( image, centerUV ) < threshold ) {
 								if ( getAlphaByUv( image, centerUV ) < threshold ) {
 
 
 									return true;
 									return true;
@@ -2333,9 +2406,9 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 						};
 						};
 
 
 						var imageData = t.image.data !== undefined ? t.image : createImageData( t.image );
 						var imageData = t.image.data !== undefined ? t.image : createImageData( t.image );
-						var uvs = geometry.faceVertexUvs[ 0 ].slice( m.faceOffset, m.faceOffset + m.faceNum );
+						var indices = geometry.index.array.slice( m.faceOffset * 3, m.faceOffset * 3 + m.faceNum * 3 );
 
 
-						if ( detectTextureTransparency( imageData, uvs ) ) m.transparent = true;
+						if ( detectTextureTransparency( imageData, geometry.attributes.uv.array, indices ) ) m.transparent = true;
 
 
 						delete m.faceOffset;
 						delete m.faceOffset;
 						delete m.faceNum;
 						delete m.faceNum;
@@ -2410,7 +2483,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 					alpha: p2.edgeColor[ 3 ]
 					alpha: p2.edgeColor[ 3 ]
 				};
 				};
 
 
-				if ( m.outlineParameters.thickness === 0.0 ) m.outlineParameters.visible = false;
+				if ( ( p2.flag & 0x10 ) === 0 || m.outlineParameters.thickness === 0.0 ) m.outlineParameters.visible = false;
 
 
 				var toonFileName, isDefaultToon;
 				var toonFileName, isDefaultToon;
 
 
@@ -2556,8 +2629,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 			var bodyB = rigidBodies[ p.rigidBodyIndex2 ];
 			var bodyB = rigidBodies[ p.rigidBodyIndex2 ];
 
 
 			/*
 			/*
-			 * Refer http://www20.atpages.jp/katwat/wp/?p=4135
-			 * for what this is for
+			 * Refer to http://www20.atpages.jp/katwat/wp/?p=4135
 			 */
 			 */
 			if ( bodyA.type !== 0 && bodyB.type === 2 ) {
 			if ( bodyA.type !== 0 && bodyB.type === 2 ) {
 
 
@@ -2579,6 +2651,20 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 
 
 	};
 	};
 
 
+	var initGeometry = function () {
+
+		geometry.setIndex( ( buffer.indices.length > 65535 ? THREE.Uint32Attribute : THREE.Uint16Attribute )( buffer.indices, 1 ) );
+		geometry.addAttribute( 'position', THREE.Float32Attribute( buffer.vertices, 3 ) );
+		geometry.addAttribute( 'normal', THREE.Float32Attribute( buffer.normals, 3 ) );
+		geometry.addAttribute( 'uv', THREE.Float32Attribute( buffer.uvs, 2 ) );
+		geometry.addAttribute( 'skinIndex', THREE.Float32Attribute( buffer.skinIndices, 4 ) );
+		geometry.addAttribute( 'skinWeight', THREE.Float32Attribute( buffer.skinWeights, 4 ) );
+
+		geometry.computeBoundingSphere();
+		geometry.mmdFormat = model.metadata.format;
+
+	};
+
 	this.leftToRightModel( model );
 	this.leftToRightModel( model );
 
 
 	initVartices();
 	initVartices();
@@ -2589,12 +2675,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
 	initMorphs();
 	initMorphs();
 	initMaterials();
 	initMaterials();
 	initPhysics();
 	initPhysics();
-
-	geometry.computeFaceNormals();
-	geometry.verticesNeedUpdate = true;
-	geometry.normalsNeedUpdate = true;
-	geometry.uvsNeedUpdate = true;
-	geometry.mmdFormat = model.metadata.format;
+	initGeometry();
 
 
 	var mesh = new THREE.SkinnedMesh( geometry, material );
 	var mesh = new THREE.SkinnedMesh( geometry, material );
 
 
@@ -2781,21 +2862,14 @@ THREE.MMDLoader.prototype.leftToRightModel = function ( model ) {
 
 
 		var m = model.morphs[ i ];
 		var m = model.morphs[ i ];
 
 
-		if ( model.metadata.format === 'pmx' ) {
-
-			if ( m.type === 1 ) {
-
-				m = m.elements;
-
-			} else {
-
-				continue;
+		if ( model.metadata.format === 'pmx' && m.type !== 1 ) {
 
 
-			}
+			// TODO: implement
+			continue;
 
 
 		}
 		}
 
 
-		for ( var j = 0; j < m.elementCount; j++ ) {
+		for ( var j = 0; j < m.elements.length; j++ ) {
 
 
 			helper.leftToRightVector3( m.elements[ j ].position );
 			helper.leftToRightVector3( m.elements[ j ].position );
 
 
@@ -3732,10 +3806,12 @@ THREE.MMDHelper.prototype = {
 
 
 		}
 		}
 
 
-		mesh.mixer = null;
-		mesh.ikSolver = null;
-		mesh.grantSolver = null;
-		mesh.physics = null;
+		if ( mesh.mixer === undefined ) mesh.mixer = null;
+		if ( mesh.ikSolver === undefined ) mesh.ikSolver = null;
+		if ( mesh.grantSolver === undefined ) mesh.grantSolver = null;
+		if ( mesh.physics === undefined ) mesh.physics = null;
+		if ( mesh.looped === undefined ) mesh.looped = false;
+
 		this.meshes.push( mesh );
 		this.meshes.push( mesh );
 
 
 		// workaround until I make IK and Physics Animation plugin
 		// workaround until I make IK and Physics Animation plugin
@@ -3785,8 +3861,76 @@ THREE.MMDHelper.prototype = {
 
 
 	setPhysics: function ( mesh, params ) {
 	setPhysics: function ( mesh, params ) {
 
 
-		mesh.physics = new THREE.MMDPhysics( mesh, params );
-		mesh.physics.warmup( 10 );
+		if ( params === undefined ) params = {};
+
+		var warmup = params.warmup !== undefined ? params.warmup : 60;
+
+		var physics = new THREE.MMDPhysics( mesh, params );
+
+		if ( mesh.mixer !== null && mesh.mixer !== undefined && this.doAnimation === true && params.preventAnimationWarmup !== false ) {
+
+			this.animateOneMesh( 0, mesh );
+			physics.reset();
+
+		}
+
+		physics.warmup( warmup );
+
+		this.updateIKParametersDependingOnPhysicsEnabled( mesh, true );
+
+		mesh.physics = physics;
+
+	},
+
+	enablePhysics: function ( enabled ) {
+
+		if ( enabled === true ) {
+
+			this.doPhysics = true;
+
+		} else {
+
+			this.doPhysics = false;
+
+		}
+
+		for ( var i = 0, il = this.meshes.length; i < il; i ++ ) {
+
+			this.updateIKParametersDependingOnPhysicsEnabled( this.meshes[ i ], enabled );
+
+		}
+
+	},
+
+	updateIKParametersDependingOnPhysicsEnabled: function ( mesh, physicsEnabled ) {
+
+		var iks = mesh.geometry.iks;
+		var bones = mesh.geometry.bones;
+
+		for ( var j = 0, jl = iks.length; j < jl; j ++ ) {
+
+			var ik = iks[ j ];
+			var links = ik.links;
+
+			for ( var k = 0, kl = links.length; k < kl; k ++ ) {
+
+				var link = links[ k ];
+
+				if ( physicsEnabled === true ) {
+
+					// disable IK of the bone the corresponding rigidBody type of which is 1 or 2
+					// because its rotation will be overriden by physics
+					link.enabled = bones[ link.index ].rigidBodyType > 0 ? false : true;
+
+				} else {
+
+					link.enabled = true;
+
+				}
+
+			}
+
+		}
 
 
 	},
 	},
 
 
@@ -3806,6 +3950,17 @@ THREE.MMDHelper.prototype = {
 
 
 			mesh.mixer = new THREE.AnimationMixer( mesh );
 			mesh.mixer = new THREE.AnimationMixer( mesh );
 
 
+			// TODO: find a workaround not to access (seems like) private properties
+			//       the name of them begins with "_".
+			mesh.mixer.addEventListener( 'loop', function ( e ) {
+
+				if ( e.action._clip.tracks[ 0 ].name.indexOf( '.bones' ) !== 0 ) return;
+
+				var mesh = e.target._root;
+				mesh.looped = true;
+
+			} );
+
 			var foundAnimation = false;
 			var foundAnimation = false;
 			var foundMorphAnimation = false;
 			var foundMorphAnimation = false;
 
 
@@ -4024,6 +4179,14 @@ THREE.MMDHelper.prototype = {
 
 
 		}
 		}
 
 
+		if ( mesh.looped === true ) {
+
+			if ( physics !== null ) physics.reset();
+
+			mesh.looped = false;
+
+		}
+
 		if ( physics !== null && this.doPhysics === true ) {
 		if ( physics !== null && this.doPhysics === true ) {
 
 
 			physics.update( delta );
 			physics.update( delta );

+ 1 - 1
examples/js/loaders/MTLLoader.js

@@ -29,7 +29,7 @@ Object.assign( THREE.MTLLoader.prototype, THREE.EventDispatcher.prototype, {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( this.manager );
+		var loader = new THREE.FileLoader( this.manager );
 		loader.setPath( this.path );
 		loader.setPath( this.path );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 

+ 1 - 1
examples/js/loaders/NRRDLoader.js

@@ -11,7 +11,7 @@ Object.assign( THREE.NRRDLoader.prototype, THREE.EventDispatcher.prototype, {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 		loader.load( url, function( data ) {
 		loader.load( url, function( data ) {
 
 

+ 1 - 1
examples/js/loaders/OBJLoader.js

@@ -43,7 +43,7 @@ THREE.OBJLoader.prototype = {
 
 
 		var scope = this;
 		var scope = this;
 
 
-		var loader = new THREE.XHRLoader( scope.manager );
+		var loader = new THREE.FileLoader( scope.manager );
 		loader.setPath( this.path );
 		loader.setPath( this.path );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 

Some files were not shown because too many files changed in this diff