Browse Source

Merge remote-tracking branch 'mrdoob/dev' into dev

Daniel 9 years ago
parent
commit
29ddd164a7
75 changed files with 132 additions and 353 deletions
  1. 2 2
      build/three.js
  2. 1 2
      build/three.min.js
  3. 1 7
      docs/api/lights/DirectionalLight.html
  4. 0 6
      docs/api/lights/SpotLight.html
  5. 1 1
      examples/canvas_geometry_panorama_fisheye.html
  6. 6 1
      examples/js/ShaderSkin.js
  7. 2 2
      examples/js/controls/EditorControls.js
  8. 2 2
      examples/js/controls/OrbitControls.js
  9. 2 2
      examples/js/controls/OrthographicTrackballControls.js
  10. 2 2
      examples/js/controls/TrackballControls.js
  11. 7 7
      examples/js/loaders/AMFLoader.js
  12. 0 1
      examples/models/animated/horse.js
  13. 0 1
      examples/models/animated/monster/monster.js
  14. 0 2
      examples/models/animated/sittingBox.js
  15. 0 1
      examples/models/animated/stork.js
  16. 0 8
      examples/models/ctm/camaro/camaro.js
  17. 0 1
      examples/models/json/blend-animation.json
  18. 0 1
      examples/models/skinned/UCS/umich_ucs.js
  19. 0 1
      examples/models/skinned/knight.js
  20. 0 1
      examples/models/skinned/marine/m4.js
  21. 0 1
      examples/models/skinned/marine/marine.js
  22. 0 1
      examples/models/skinned/marine/marine_anims.js
  23. 0 1
      examples/models/skinned/marine/marine_ikrig.js
  24. 0 1
      examples/models/skinned/simple/simple.js
  25. 0 1
      examples/obj/blenderscene/scene.Cube.js
  26. 0 1
      examples/obj/blenderscene/scene.Monkey.js
  27. 0 1
      examples/obj/blenderscene/scene.Plane.js
  28. 0 9
      examples/obj/camaro/CamaroNoUv_bin.js
  29. 0 1
      examples/obj/cubecolors/cube_fvc.js
  30. 0 1
      examples/obj/cubecolors/cubecolors.js
  31. 0 25
      examples/obj/f50/F50NoUv_bin.js
  32. 0 6
      examples/obj/female02/Female02_bin.js
  33. 0 6
      examples/obj/female02/Female02_slim.js
  34. 0 7
      examples/obj/gallardo/GallardoNoUv_bin.js
  35. 0 7
      examples/obj/gallardo/parts/gallardo_body_bin.js
  36. 0 2
      examples/obj/gallardo/parts/gallardo_wheel_bin.js
  37. 0 1
      examples/obj/leeperrysmith/LeePerrySmith.js
  38. 0 5
      examples/obj/male02/Male02_bin.js
  39. 0 5
      examples/obj/male02/Male02_dds.js
  40. 0 5
      examples/obj/male02/Male02_slim.js
  41. 0 8
      examples/obj/veyron/VeyronNoUv_bin.js
  42. 0 8
      examples/obj/veyron/parts/veyron_body_bin.js
  43. 0 2
      examples/obj/veyron/parts/veyron_wheel_bin.js
  44. 0 1
      examples/obj/walt/WaltHead_bin.js
  45. 0 1
      examples/obj/walt/WaltHead_slim.js
  46. 0 1
      examples/scenes/test_scene.js
  47. 0 1
      examples/webgl_animation_cloth.html
  48. 6 14
      examples/webgl_animation_skinning_morph.html
  49. 1 1
      examples/webgl_camera_logarithmicdepthbuffer.html
  50. 3 4
      examples/webgl_geometry_spline_editor.html
  51. 0 1
      examples/webgl_interactive_draggablecubes.html
  52. 0 1
      examples/webgl_lights_hemisphere.html
  53. 0 1
      examples/webgl_loader_gltf.html
  54. 0 1
      examples/webgl_loader_ply.html
  55. 2 4
      examples/webgl_loader_stl.html
  56. 11 49
      examples/webgl_materials_bumpmap.html
  57. 4 9
      examples/webgl_materials_bumpmap_skin.html
  58. 0 1
      examples/webgl_materials_cubemap_dynamic.html
  59. 1 1
      examples/webgl_materials_cubemap_dynamic2.html
  60. 30 40
      examples/webgl_morphnormals.html
  61. 1 1
      examples/webgl_panorama_equirectangular.html
  62. 1 8
      examples/webgl_shading_physical.html
  63. 0 1
      examples/webgl_shadowmap.html
  64. 0 1
      examples/webgl_shadowmap_performance.html
  65. 2 1
      examples/webgl_shadowmap_pointlight.html
  66. 0 2
      examples/webgl_shadowmap_viewer.html
  67. 1 1
      examples/webgl_video_panorama_equirectangular.html
  68. 1 1
      src/lights/LightShadow.js
  69. 1 1
      src/objects/SkinnedMesh.js
  70. 0 2
      src/renderers/shaders/ShaderChunk/lights_lambert_pars_vertex.glsl
  71. 0 8
      src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl
  72. 0 10
      src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl
  73. 9 13
      src/renderers/shaders/ShaderChunk/shadowmap_fragment.glsl
  74. 28 15
      src/renderers/shaders/ShaderLib.js
  75. 4 1
      utils/build/build.py

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


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


+ 1 - 7
docs/api/lights/DirectionalLight.html

@@ -1,7 +1,7 @@
 <!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>
@@ -123,12 +123,6 @@ scene.add( directionalLight );</code>
 			Default — *0*.
 		</div>
 
-		<h3>[property:Float shadowDarkness]</h3>
-		<div>
-			Darkness of shadow casted by this light (from *0* to *1*).<br />
-			Default — *0.5*.
-		</div>
-
 		<h3>[property:Integer shadowMapWidth]</h3>
 		<div>
 			Shadow map texture width in pixels.<br />

+ 0 - 6
docs/api/lights/SpotLight.html

@@ -146,12 +146,6 @@
 			Default — *0*.
 		</div>
 
-		<h3>[property:Float shadowDarkness]</h3>
-		<div>
-			Darkness of shadow casted by this light (from *0* to *1*).<br />
-			Default — *0.5*.
-		</div>
-
 		<h3>[property:Integer shadowMapWidth]</h3>
 		<div>
 			Shadow map texture width in pixels.<br />

+ 1 - 1
examples/canvas_geometry_panorama_fisheye.html

@@ -103,7 +103,7 @@
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'mouseup', onDocumentMouseUp, false );
 				document.addEventListener( 'mousewheel', onDocumentMouseWheel, false );
-				document.addEventListener( 'DOMMouseScroll', onDocumentMouseWheel, false);
+				document.addEventListener( 'MozMousePixelScroll', onDocumentMouseWheel, false);
 
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );

+ 6 - 1
examples/js/ShaderSkin.js

@@ -160,6 +160,7 @@ THREE.ShaderSkin = {
 
 				"vec3 outgoingLight = vec3( 0.0 );",	// outgoing light does not have an alpha, the surface does
 				"vec4 diffuseColor = vec4( diffuse, opacity );",
+				"vec3 shadowMask = vec3( 1.0 );",
 
 				"vec4 colDiffuse = texture2D( tDiffuse, vUv );",
 				"colDiffuse.rgb *= colDiffuse.rgb;",
@@ -268,9 +269,13 @@ THREE.ShaderSkin = {
 
 				"#endif",
 
+				THREE.ShaderChunk[ "shadowmap_fragment" ],
+
+				"totalDiffuseLight *= shadowMask;",
+				"totalSpecularLight *= shadowMask;",
+
 				"outgoingLight += diffuseColor.xyz * ( totalDiffuseLight + ambientLightColor * diffuse ) + totalSpecularLight;",
 
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 				THREE.ShaderChunk[ "fog_fragment" ],
 

+ 2 - 2
examples/js/controls/EditorControls.js

@@ -214,7 +214,7 @@ THREE.EditorControls = function ( object, domElement ) {
 		domElement.removeEventListener( 'contextmenu', contextmenu, false );
 		domElement.removeEventListener( 'mousedown', onMouseDown, false );
 		domElement.removeEventListener( 'mousewheel', onMouseWheel, false );
-		domElement.removeEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox
+		domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
 
 		domElement.removeEventListener( 'mousemove', onMouseMove, false );
 		domElement.removeEventListener( 'mouseup', onMouseUp, false );
@@ -229,7 +229,7 @@ THREE.EditorControls = function ( object, domElement ) {
 	domElement.addEventListener( 'contextmenu', contextmenu, false );
 	domElement.addEventListener( 'mousedown', onMouseDown, false );
 	domElement.addEventListener( 'mousewheel', onMouseWheel, false );
-	domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox
+	domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
 
 	// touch
 

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

@@ -778,7 +778,7 @@
 			this.domElement.removeEventListener( 'contextmenu', contextmenu, false );
 			this.domElement.removeEventListener( 'mousedown', onMouseDown, false );
 			this.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );
-			this.domElement.removeEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox
+			this.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
 
 			this.domElement.removeEventListener( 'touchstart', touchstart, false );
 			this.domElement.removeEventListener( 'touchend', touchend, false );
@@ -795,7 +795,7 @@
 
 		this.domElement.addEventListener( 'mousedown', onMouseDown, false );
 		this.domElement.addEventListener( 'mousewheel', onMouseWheel, false );
-		this.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox
+		this.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox
 
 		this.domElement.addEventListener( 'touchstart', touchstart, false );
 		this.domElement.addEventListener( 'touchend', touchend, false );

+ 2 - 2
examples/js/controls/OrthographicTrackballControls.js

@@ -617,7 +617,7 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) {
 		this.domElement.removeEventListener( 'contextmenu', contextmenu, false );
 		this.domElement.removeEventListener( 'mousedown', mousedown, false );
 		this.domElement.removeEventListener( 'mousewheel', mousewheel, false );
-		this.domElement.removeEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox
+		this.domElement.removeEventListener( 'MozMousePixelScroll', mousewheel, false ); // firefox
 
 		this.domElement.removeEventListener( 'touchstart', touchstart, false );
 		this.domElement.removeEventListener( 'touchend', touchend, false );
@@ -635,7 +635,7 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) {
 	this.domElement.addEventListener( 'contextmenu', contextmenu, false );
 	this.domElement.addEventListener( 'mousedown', mousedown, false );
 	this.domElement.addEventListener( 'mousewheel', mousewheel, false );
-	this.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox
+	this.domElement.addEventListener( 'MozMousePixelScroll', mousewheel, false ); // firefox
 
 	this.domElement.addEventListener( 'touchstart', touchstart, false );
 	this.domElement.addEventListener( 'touchend', touchend, false );

+ 2 - 2
examples/js/controls/TrackballControls.js

@@ -597,7 +597,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 		this.domElement.removeEventListener( 'contextmenu', contextmenu, false );
 		this.domElement.removeEventListener( 'mousedown', mousedown, false );
 		this.domElement.removeEventListener( 'mousewheel', mousewheel, false );
-		this.domElement.removeEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox
+		this.domElement.removeEventListener( 'MozMousePixelScroll', mousewheel, false ); // firefox
 
 		this.domElement.removeEventListener( 'touchstart', touchstart, false );
 		this.domElement.removeEventListener( 'touchend', touchend, false );
@@ -614,7 +614,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 	this.domElement.addEventListener( 'contextmenu', contextmenu, false );
 	this.domElement.addEventListener( 'mousedown', mousedown, false );
 	this.domElement.addEventListener( 'mousewheel', mousewheel, false );
-	this.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox
+	this.domElement.addEventListener( 'MozMousePixelScroll', mousewheel, false ); // firefox
 
 	this.domElement.addEventListener( 'touchstart', touchstart, false );
 	this.domElement.addEventListener( 'touchend', touchend, false );

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

@@ -143,7 +143,7 @@ THREE.AMFLoader.prototype = {
 
 			var matName = "AMF Material";
 			var matId = node.attributes[ 'id' ].textContent;
-			var color;
+			var color = { r: 1.0, g: 1.0, b: 1.0, a: 1.0 };
 
 			var loadedMaterial = null;
 
@@ -173,10 +173,10 @@ THREE.AMFLoader.prototype = {
 				name: matName
 			} );
 
-			if ( color.opacity !== 1.0 ) {
+			if ( color.a !== 1.0 ) {
 
 				loadedMaterial.transparent = true;
-				loadedMaterial.opacity = color.opacity;
+				loadedMaterial.opacity = color.a;
 
 			}
 
@@ -186,7 +186,7 @@ THREE.AMFLoader.prototype = {
 
 		function loadColor( node ) {
 
-			var color = { 'r': 1.0, 'g': 1.0, 'b': 1.0, 'a': 1.0, opacity: 1.0 };
+			var color = { 'r': 1.0, 'g': 1.0, 'b': 1.0, 'a': 1.0 };
 
 			for ( var i = 0; i < node.children.length; i ++ ) {
 
@@ -206,7 +206,7 @@ THREE.AMFLoader.prototype = {
 
 				} else if ( matColor.nodeName === 'a' ) {
 
-					color.opacity = matColor.textContent;
+					color.a = matColor.textContent;
 
 				}
 
@@ -478,9 +478,9 @@ THREE.AMFLoader.prototype = {
 
 					}
 
-					if ( amfMaterials[ volume.materialid ] !== undefined ) {
+					if ( amfMaterials[ volume.materialId ] !== undefined ) {
 
-						material = amfMaterials[ volume.materialid ];
+						material = amfMaterials[ volume.materialId ];
 
 					}
 

+ 0 - 1
examples/models/animated/horse.js

@@ -11,7 +11,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "comp_horse_rig:blinn9SG",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.41999999999999998, 0.56999999999999995, 0.45000000000000001],
 	"colorSpecular" : [1.0, 0.42999999999999999, 0.35999999999999999],
 	"illumination" : 4,

+ 0 - 1
examples/models/animated/monster/monster.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "monster",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
 	"colorSpecular" : [0.37434511778136503, 0.37434511778136503, 0.37434511778136503],
 	"mapDiffuse" : "monster.jpg",

+ 0 - 2
examples/models/animated/sittingBox.js

@@ -26,7 +26,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "Material",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.434594637671033, 0.434594637671033, 0.434594637671033],
 	"colorSpecular" : [0.10135135054588318, 0.10135135054588318, 0.10135135054588318],
 	"shading" : "Lambert",
@@ -39,7 +38,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "Material",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.434594637671033, 0.434594637671033, 0.434594637671033],
 	"colorSpecular" : [0.10135135054588318, 0.10135135054588318, 0.10135135054588318],
 	"shading" : "Lambert",

+ 0 - 1
examples/models/animated/stork.js

@@ -11,7 +11,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "initialShadingGroup",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5, 0.5, 0.5],
 	"illumination" : 4,
 	"opticalDensity" : 1.0

+ 0 - 8
examples/models/ctm/camaro/camaro.js

@@ -9,7 +9,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "Body_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.1816, 0.3264, 0.3704],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -23,7 +22,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "tire_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.2168, 0.2168, 0.2104],
 	"colorSpecular" : [0.1, 0.1, 0.1],
 	"illumination" : 2,
@@ -37,7 +35,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "black2_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.0, 0.0, 0.0],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"illumination" : 2,
@@ -51,7 +48,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "tireling_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.4, 0.4, 0.4],
 	"colorSpecular" : [0.2, 0.2, 0.2],
 	"illumination" : 2,
@@ -65,7 +61,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "glass_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.16, 0.248, 0.2448],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -79,7 +74,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "black_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.0816, 0.0816, 0.0816],
 	"colorSpecular" : [0.2, 0.2, 0.2],
 	"illumination" : 2,
@@ -93,7 +87,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "mirror_car-ao",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.24, 0.24, 0.24],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -108,7 +101,6 @@
 	"DbgColor" : 3744854,
 	"DbgIndex" : 8,
 	"DbgName" : "Material.001_plane-ao-256",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.798635, 0.776149, 0.8],
 	"colorSpecular" : [0.5, 0.5, 0.5],
 	"illumination" : 2,

+ 0 - 1
examples/models/json/blend-animation.json

@@ -60,7 +60,6 @@
         },
         "materials": [{
             "opacity": 1,
-            "colorAmbient": [0.8,0.8,0.8],
             "doubleSided": true,
             "depthWrite": true,
             "depthTest": true,

+ 0 - 1
examples/models/skinned/UCS/umich_ucs.js

@@ -18,7 +18,6 @@
 "DbgIndex" : 0,
 "DbgName"  : "Material #0",
 "colorDiffuse"  : [0.5880, 0.5880, 0.5880],
-"colorAmbient"  : [0.5880, 0.5880, 0.5880],
 "colorSpecular"  : [0.9000, 0.9000, 0.9000],
 "opacity"  : 1.0,
 "specularCoef"  : 10.0,

+ 0 - 1
examples/models/skinned/knight.js

@@ -21,7 +21,6 @@
 	"DbgIndex" : 0,
 	"DbgName" : "WHITE",
 	"blending" : "NormalBlending",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],
 	"colorSpecular" : [0.1, 0.1, 0.1],
 	"depthTest" : true,

+ 0 - 1
examples/models/skinned/marine/m4.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "M4",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.5351081581544648, 0.5351081581544648, 0.5351081581544648],
 		"colorDiffuse" : [0.5351081581544648, 0.5351081581544648, 0.5351081581544648],
 		"colorSpecular" : [1.0, 1.0, 1.0],
 		"depthTest" : true,

+ 0 - 1
examples/models/skinned/marine/marine.js

@@ -21,7 +21,6 @@
     "DbgIndex" : 0,
     "DbgName" : "MaleMarineC",
     "blending" : "NormalBlending",
-    "colorAmbient" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
     "colorDiffuse" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
     "colorSpecular" : [0.19372500479221344, 0.19372500479221344, 0.19372500479221344],
     "depthTest" : true,

+ 0 - 1
examples/models/skinned/marine/marine_anims.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "MaleMarineC",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
 		"colorDiffuse" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
 		"colorSpecular" : [0.19372500479221344, 0.19372500479221344, 0.19372500479221344],
 		"depthTest" : true,

+ 0 - 1
examples/models/skinned/marine/marine_ikrig.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "MaleMarineC",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
 		"colorDiffuse" : [0.5364704212020399, 0.5364704212020399, 0.5364704212020399],
 		"colorSpecular" : [0.19372500479221344, 0.19372500479221344, 0.19372500479221344],
 		"depthTest" : true,

+ 0 - 1
examples/models/skinned/simple/simple.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "Material",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.1569801711586143, 0.17312412519937936, 0.6400000190734865],
 		"colorDiffuse" : [0.1569801711586143, 0.17312412519937936, 0.6400000190734865],
 		"colorEmissive" : [0.0, 0.0, 0.0],
 		"colorSpecular" : [0.2535329759120941, 0.0, 0.007157782092690468],

+ 0 - 1
examples/obj/blenderscene/scene.Cube.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "Material",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.6400000190734865, 0.10179081114814892, 0.126246120426746],
 		"colorDiffuse" : [0.6400000190734865, 0.10179081114814892, 0.126246120426746],
 		"colorSpecular" : [0.5, 0.5, 0.5],
 		"depthTest" : true,

+ 0 - 1
examples/obj/blenderscene/scene.Monkey.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "Material.002",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.6400000190734865, 0.44102483452893537, 0.14499310471107218],
 		"colorDiffuse" : [0.6400000190734865, 0.44102483452893537, 0.14499310471107218],
 		"colorSpecular" : [0.5, 0.5, 0.5],
 		"depthTest" : true,

+ 0 - 1
examples/obj/blenderscene/scene.Plane.js

@@ -21,7 +21,6 @@
 		"DbgIndex" : 0,
 		"DbgName" : "Material.001",
 		"blending" : "NormalBlending",
-		"colorAmbient" : [0.14462547517754842, 0.6400000190734865, 0.24541190036254967],
 		"colorDiffuse" : [0.14462547517754842, 0.6400000190734865, 0.24541190036254967],
 		"colorSpecular" : [0.5, 0.5, 0.5],
 		"depthTest" : true,

+ 0 - 9
examples/obj/camaro/CamaroNoUv_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "Body",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.227, 0.408, 0.463],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -29,7 +28,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "mirror",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.3, 0.3, 0.3],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -42,7 +40,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "black",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.102, 0.102, 0.102],
 	"colorSpecular" : [0.2, 0.2, 0.2],
 	"illumination" : 2,
@@ -55,7 +52,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "mizo",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.0, 0.0, 0.0],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"illumination" : 1,
@@ -68,7 +64,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "glass",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.2, 0.31, 0.306],
 	"colorSpecular" : [2.0, 2.0, 2.0],
 	"illumination" : 2,
@@ -81,7 +76,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "Interieur",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.102, 0.102, 0.102],
 	"colorSpecular" : [0.44, 0.44, 0.44],
 	"illumination" : 2,
@@ -94,7 +88,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "tire",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.271, 0.271, 0.263],
 	"colorSpecular" : [0.1, 0.1, 0.1],
 	"illumination" : 2,
@@ -107,7 +100,6 @@
 	"DbgColor" : 3744854,
 	"DbgIndex" : 7,
 	"DbgName" : "tireling",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5, 0.5, 0.5],
 	"colorSpecular" : [0.2, 0.2, 0.2],
 	"illumination" : 2,
@@ -120,7 +112,6 @@
 	"DbgColor" : 4614226,
 	"DbgIndex" : 8,
 	"DbgName" : "black2",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.0, 0.0, 0.0],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"illumination" : 1,

+ 0 - 1
examples/obj/cubecolors/cube_fvc.js

@@ -20,7 +20,6 @@
 	"DbgIndex" : 0,
 	"DbgName" : "Material",
 	"blending" : "NormalBlending",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
 	"colorSpecular" : [0.5, 0.5, 0.5],
 	"depthTest" : true,

+ 0 - 1
examples/obj/cubecolors/cubecolors.js

@@ -20,7 +20,6 @@
 	"DbgIndex" : 0,
 	"DbgName" : "Material",
 	"blending" : "NormalBlending",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [1.0, 1.0, 1.0],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"depthTest" : true,

+ 0 - 25
examples/obj/f50/F50NoUv_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "F50NEGRO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "F50CROMO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.1004, 0.10352, 0.06272],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -40,7 +38,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "F50CRIST",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.0408, 0.15688, 0.00312],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -53,7 +50,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "F50ROJO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -65,7 +61,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "F50NEGRO1",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -77,7 +72,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "F50ALFO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -89,7 +83,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "F50REJIL",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -101,7 +94,6 @@
 	"DbgColor" : 13579988,
 	"DbgIndex" : 7,
 	"DbgName" : "F50RIGHT",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -113,7 +105,6 @@
 	"DbgColor" : 5708456,
 	"DbgIndex" : 8,
 	"DbgName" : "F50CAPO1",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -125,7 +116,6 @@
 	"DbgColor" : 16326172,
 	"DbgIndex" : 9,
 	"DbgName" : "F50CAPO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -137,7 +127,6 @@
 	"DbgColor" : 5647119,
 	"DbgIndex" : 10,
 	"DbgName" : "F50LEFT",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -149,7 +138,6 @@
 	"DbgColor" : 1556016,
 	"DbgIndex" : 11,
 	"DbgName" : "F50MOTOR",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.1004, 0.10352, 0.06272],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -161,7 +149,6 @@
 	"DbgColor" : 2608512,
 	"DbgIndex" : 12,
 	"DbgName" : "F50GOOD",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -173,7 +160,6 @@
 	"DbgColor" : 13541364,
 	"DbgIndex" : 13,
 	"DbgName" : "F50RUEDA",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -185,7 +171,6 @@
 	"DbgColor" : 16059369,
 	"DbgIndex" : 14,
 	"DbgName" : "F50SUELO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -197,7 +182,6 @@
 	"DbgColor" : 109031,
 	"DbgIndex" : 15,
 	"DbgName" : "F50DISCO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.41096, 0.3608, 0.25728],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -209,7 +193,6 @@
 	"DbgColor" : 10128841,
 	"DbgIndex" : 16,
 	"DbgName" : "F50FARYE",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.79056, 0.41096, 0.00624],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -222,7 +205,6 @@
 	"DbgColor" : 6350752,
 	"DbgIndex" : 17,
 	"DbgName" : "F5OLOGO",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.41096, 0.3608, 0.25728],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -234,7 +216,6 @@
 	"DbgColor" : 9261704,
 	"DbgIndex" : 18,
 	"DbgName" : "F50FARED",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.63056, 0.07528, 0.05016],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -247,7 +228,6 @@
 	"DbgColor" : 1622631,
 	"DbgIndex" : 19,
 	"DbgName" : "F50FARWD",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.40472, 0.40472, 0.40472],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -260,7 +240,6 @@
 	"DbgColor" : 12242867,
 	"DbgIndex" : 20,
 	"DbgName" : "F50ASIEN",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -272,7 +251,6 @@
 	"DbgColor" : 13519402,
 	"DbgIndex" : 21,
 	"DbgName" : "F50MATR",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5992, 0.58984, 0.56472],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -284,7 +262,6 @@
 	"DbgColor" : 8996413,
 	"DbgIndex" : 22,
 	"DbgName" : "F50AIRE",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.15376, 0.10984, 0.03768],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -296,7 +273,6 @@
 	"DbgColor" : 11712834,
 	"DbgIndex" : 23,
 	"DbgName" : "F50TOPAL",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,
@@ -308,7 +284,6 @@
 	"DbgColor" : 14218595,
 	"DbgIndex" : 24,
 	"DbgName" : "F50TOPAL1",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.5616, 0.04392, 0.06904],
 	"colorSpecular" : [0.025, 0.025, 0.025],
 	"illumination" : 2,

+ 0 - 6
examples/obj/female02/Female02_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "_03_-_Default1noCulli__03_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -30,7 +29,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "_02_-_Default1noCulli__02_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -44,7 +42,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "FrontColorNoCullingID__02_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -58,7 +55,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "FrontColorNoCullingID__03_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -72,7 +68,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "_01_-_Default1noCulli__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -86,7 +81,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "FrontColorNoCullingID__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,

+ 0 - 6
examples/obj/female02/Female02_slim.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "_03_-_Default1noCulli__03_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -33,7 +32,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "_02_-_Default1noCulli__02_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -47,7 +45,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "FrontColorNoCullingID__02_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -61,7 +58,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "FrontColorNoCullingID__03_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -75,7 +71,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "_01_-_Default1noCulli__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -89,7 +84,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "FrontColorNoCullingID__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,

+ 0 - 7
examples/obj/gallardo/GallardoNoUv_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "wire_255255255",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "wire_115115115",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.3608, 0.3608, 0.3608],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -40,7 +38,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "03___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.13176, 0.13176, 0.13176],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"illumination" : 2,
@@ -52,7 +49,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "02___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.0, 0.0],
 	"colorSpecular" : [0.6525, 0.6525, 0.6525],
 	"illumination" : 2,
@@ -64,7 +60,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "wire_255000000",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.0, 0.0],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -76,7 +71,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "wire_252252000",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.79056, 0.79056, 0.0],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -88,7 +82,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "wire_132132132",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.41408, 0.41408, 0.41408],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,

+ 0 - 7
examples/obj/gallardo/parts/gallardo_body_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "02___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.0, 0.0],
 	"colorSpecular" : [0.6525, 0.6525, 0.6525],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "wire_115115115",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.28864, 0.28864, 0.28864],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -40,7 +38,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "wire_132132132",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.331264, 0.331264, 0.331264],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -52,7 +49,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "wire_255255255",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -64,7 +60,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "03___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.105408, 0.105408, 0.105408],
 	"colorSpecular" : [0.0, 0.0, 0.0],
 	"illumination" : 2,
@@ -76,7 +71,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "wire_252252000",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.632448, 0.632448, 0.0],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -88,7 +82,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "wire_255000000",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.0, 0.0],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,

+ 0 - 2
examples/obj/gallardo/parts/gallardo_wheel_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "wire_255255255",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "wire_115115115",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.28864, 0.28864, 0.28864],
 	"colorSpecular" : [0.175, 0.175, 0.175],
 	"illumination" : 2,

+ 0 - 1
examples/obj/leeperrysmith/LeePerrySmith.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "defaultMat",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.5, 0.5, 0.5],
 	"illumination" : 2,

+ 0 - 5
examples/obj/male02/Male02_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "male-02-1noCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -30,7 +29,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "orig_02_-_Defaul1noCu_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -44,7 +42,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "FrontColorNoCullingID_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -58,7 +55,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "_01_-_Default1noCulli__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -72,7 +68,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "FrontColorNoCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,

+ 0 - 5
examples/obj/male02/Male02_dds.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "male-02-1noCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -33,7 +32,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "orig_02_-_Defaul1noCu_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -47,7 +45,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "FrontColorNoCullingID_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -61,7 +58,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "_01_-_Default1noCulli__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -75,7 +71,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "FrontColorNoCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,

+ 0 - 5
examples/obj/male02/Male02_slim.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "male-02-1noCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -33,7 +32,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "orig_02_-_Defaul1noCu_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -47,7 +45,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "FrontColorNoCullingID_orig_02_-_Defaul1noCu",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -61,7 +58,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "_01_-_Default1noCulli__01_-_Default1noCulli",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,
@@ -75,7 +71,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "FrontColorNoCullingID_male-02-1noCulling.JP",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.8, 0.8],
 	"colorSpecular" : [0.165, 0.165, 0.165],
 	"illumination" : 2,

+ 0 - 8
examples/obj/veyron/VeyronNoUv_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "08___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.18824, 0.18824, 0.18824],
 	"colorSpecular" : [0.14825, 0.14825, 0.14825],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "03___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.52704, 0.52704, 0.52704],
 	"colorSpecular" : [0.6, 0.6, 0.6],
 	"illumination" : 2,
@@ -40,7 +38,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "ColorBlack",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.21648, 0.21648, 0.21648],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -52,7 +49,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "04___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.54272, 0.57408, 0.58984],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -65,7 +61,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "02___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.48312, 0.0, 0.0],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -77,7 +72,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "Aluminium",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.47056, 0.47056, 0.47056],
 	"colorSpecular" : [0.4, 0.4, 0.4],
 	"illumination" : 2,
@@ -89,7 +83,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "glassRed",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.57408, 0.0, 0.0],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -102,7 +95,6 @@
 	"DbgColor" : 419610,
 	"DbgIndex" : 7,
 	"DbgName" : "glassOranje",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.8, 0.49568, 0.1004],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,

+ 0 - 8
examples/obj/veyron/parts/veyron_body_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "ColorBlack",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.173184, 0.173184, 0.173184],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "02___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.386496, 0.0, 0.0],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -40,7 +38,6 @@
 	"DbgColor" : 60928,
 	"DbgIndex" : 2,
 	"DbgName" : "Aluminium",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.376448, 0.376448, 0.376448],
 	"colorSpecular" : [0.4, 0.4, 0.4],
 	"illumination" : 2,
@@ -52,7 +49,6 @@
 	"DbgColor" : 238,
 	"DbgIndex" : 3,
 	"DbgName" : "03___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.421632, 0.421632, 0.421632],
 	"colorSpecular" : [0.6, 0.6, 0.6],
 	"illumination" : 2,
@@ -64,7 +60,6 @@
 	"DbgColor" : 15658496,
 	"DbgIndex" : 4,
 	"DbgName" : "glassRed",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.459264, 0.0, 0.0],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -77,7 +72,6 @@
 	"DbgColor" : 61166,
 	"DbgIndex" : 5,
 	"DbgName" : "glassOranje",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.396544, 0.08032],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,
@@ -90,7 +84,6 @@
 	"DbgColor" : 15597806,
 	"DbgIndex" : 6,
 	"DbgName" : "08___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.150592, 0.150592, 0.150592],
 	"colorSpecular" : [0.14825, 0.14825, 0.14825],
 	"illumination" : 2,
@@ -102,7 +95,6 @@
 	"DbgColor" : 419610,
 	"DbgIndex" : 7,
 	"DbgName" : "04___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.434176, 0.459264, 0.471872],
 	"colorSpecular" : [0.75, 0.75, 0.75],
 	"illumination" : 2,

+ 0 - 2
examples/obj/veyron/parts/veyron_wheel_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "03___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.421632, 0.421632, 0.421632],
 	"colorSpecular" : [0.6, 0.6, 0.6],
 	"illumination" : 2,
@@ -28,7 +27,6 @@
 	"DbgColor" : 15597568,
 	"DbgIndex" : 1,
 	"DbgName" : "08___Default",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.150592, 0.150592, 0.150592],
 	"colorSpecular" : [0.14825, 0.14825, 0.14825],
 	"illumination" : 2,

+ 0 - 1
examples/obj/walt/WaltHead_bin.js

@@ -16,7 +16,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "lambert2SG.001",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.25, 0.25, 0.25],
 	"illumination" : 2,

+ 0 - 1
examples/obj/walt/WaltHead_slim.js

@@ -19,7 +19,6 @@
 	"DbgColor" : 15658734,
 	"DbgIndex" : 0,
 	"DbgName" : "lambert2SG.001",
-	"colorAmbient" : [0.0, 0.0, 0.0],
 	"colorDiffuse" : [0.64, 0.64, 0.64],
 	"colorSpecular" : [0.25, 0.25, 0.25],
 	"illumination" : 2,

+ 0 - 1
examples/scenes/test_scene.js

@@ -514,7 +514,6 @@
 				"DbgColor" : 15658734,
 				"DbgIndex" : 0,
 				"DbgName" : "Material",
-				"colorAmbient" : [0.0, 0.0, 0.0],
 				"colorDiffuse" : [0.8, 0.8, 0.8],
 				"colorSpecular" : [0.5, 0.5, 0.5],
 				"specularCoef" : 50,

+ 0 - 1
examples/webgl_animation_cloth.html

@@ -175,7 +175,6 @@
 				light.shadowCameraBottom = -d;
 
 				light.shadowCameraFar = 1000;
-				light.shadowDarkness = 0.5;
 
 				scene.add( light );
 

+ 6 - 14
examples/webgl_animation_skinning_morph.html

@@ -62,7 +62,7 @@
 			var mesh, helper;
 
 			var mixer;
-		
+
 			var mouseX = 0, mouseY = 0;
 
 			var windowHalfX = window.innerWidth / 2;
@@ -91,7 +91,7 @@
 				// GROUND
 
 				var geometry = new THREE.PlaneBufferGeometry( 16000, 16000 );
-				var material = new THREE.MeshPhongMaterial( { emissive: 0xbbbbbb } );
+				var material = new THREE.MeshPhongMaterial( { emissive: 0x888888 } );
 
 				var ground = new THREE.Mesh( geometry, material );
 				ground.position.set( 0, FLOOR, 0 );
@@ -103,18 +103,16 @@
 
 				// LIGHTS
 
-				var ambient = new THREE.AmbientLight( 0x222222 );
-				scene.add( ambient );
-
+				scene.add( new THREE.HemisphereLight( 0x111111, 0x444444 ) );
 
-				var light = new THREE.DirectionalLight( 0xebf3ff, 1.6 );
+				var light = new THREE.DirectionalLight( 0xebf3ff, 1.5 );
 				light.position.set( 0, 140, 500 ).multiplyScalar( 1.1 );
 				scene.add( light );
 
 				light.castShadow = true;
 
 				light.shadowMapWidth = 1024;
-				light.shadowMapHeight = 2048;
+				light.shadowMapHeight = 1024;
 
 				var d = 390;
 
@@ -126,12 +124,6 @@
 				light.shadowCameraFar = 3500;
 				//light.shadowCameraVisible = true;
 
-				//
-
-				var light = new THREE.DirectionalLight( 0x493f13, 1 );
-				light.position.set( 0, -1, 0 );
-				scene.add( light );
-
 				// RENDERER
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
@@ -232,7 +224,7 @@
 				helper.visible = false;
 				scene.add( helper );
 
-	
+
 				var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', mesh.geometry.morphTargets, 3 );
 				var clipBones = geometry.animations[0];
 

+ 1 - 1
examples/webgl_camera_logarithmicdepthbuffer.html

@@ -152,7 +152,7 @@
 
 				window.addEventListener( 'resize', onWindowResize, false );
 				window.addEventListener( 'mousewheel', onMouseWheel, false );
-				window.addEventListener( 'DOMMouseScroll', onMouseWheel, false );
+				window.addEventListener( 'MozMousePixelScroll', onMouseWheel, false );
 				window.addEventListener( 'mousemove', onMouseMove, false );
 
 				render();

+ 3 - 4
examples/webgl_geometry_spline_editor.html

@@ -66,7 +66,7 @@
 				camera.position.z = 1000;
 				scene.add( camera );
 
-				scene.add( new THREE.AmbientLight( 0xf0f0f0 ) );
+				scene.add( new THREE.AmbientLight( 0xcccccc ) );
 				var light = new THREE.SpotLight( 0xffffff, 1.5 );
 				light.position.set( 0, 1500, 200 );
 				light.castShadow = true;
@@ -74,15 +74,14 @@
 				light.shadowCameraFar = camera.far;
 				light.shadowCameraFov = 70;
 				light.shadowBias = -0.000222;
-				light.shadowDarkness = 0.25;
 				light.shadowMapWidth = 1024;
 				light.shadowMapHeight = 1024;
 				scene.add( light );
 				spotlight = light;
 
-				var planeGeometry = new THREE.PlaneGeometry( 2000, 2000, 20, 20 );
+				var planeGeometry = new THREE.PlaneGeometry( 2000, 2000 );
 				planeGeometry.rotateX( - Math.PI / 2 );
-				var planeMaterial = new THREE.MeshBasicMaterial( { color: 0xeeeeee } );
+				var planeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff } );
 
 				var plane = new THREE.Mesh( planeGeometry, planeMaterial );
 				plane.position.y = -200;

+ 0 - 1
examples/webgl_interactive_draggablecubes.html

@@ -65,7 +65,6 @@
 				light.shadowCameraFov = 50;
 
 				light.shadowBias = -0.00022;
-				light.shadowDarkness = 0.5;
 
 				light.shadowMapWidth = 2048;
 				light.shadowMapHeight = 2048;

+ 0 - 1
examples/webgl_lights_hemisphere.html

@@ -159,7 +159,6 @@
 
 				dirLight.shadowCameraFar = 3500;
 				dirLight.shadowBias = -0.0001;
-				dirLight.shadowDarkness = 0.35;
 				//dirLight.shadowCameraVisible = true;
 
 				// GROUND

+ 0 - 1
examples/webgl_loader_gltf.html

@@ -174,7 +174,6 @@
 					spot1.shadowCameraNear		= 1;
 					spot1.shadowCameraFar		= 1024;
 					spot1.castShadow			= true;
-					spot1.shadowDarkness		= 0.3;
 					spot1.shadowBias = 0.0001;
 					spot1.shadowMapWidth = 2048;
 					spot1.shadowMapHeight = 2048;

+ 0 - 1
examples/webgl_loader_ply.html

@@ -163,7 +163,6 @@
 				directionalLight.shadowMapHeight = 1024;
 
 				directionalLight.shadowBias = -0.005;
-				directionalLight.shadowDarkness = 0.15;
 
 			}
 

+ 2 - 4
examples/webgl_loader_stl.html

@@ -165,10 +165,9 @@
 
 				// Lights
 
-				scene.add( new THREE.AmbientLight( 0x777777 ) );
+				scene.add( new THREE.HemisphereLight( 0x443333, 0x111122 ) );
 
-				addShadowedLight( 1, 1, 1, 0xffffff, 1.35 );
-				addShadowedLight( 0.5, 1, -1, 0xffaa00, 1 );
+				addShadowedLight( 0.5, 1, -1, 0xffff99, 1 );
 
 				// renderer
 
@@ -220,7 +219,6 @@
 				directionalLight.shadowMapHeight = 1024;
 
 				directionalLight.shadowBias = -0.005;
-				directionalLight.shadowDarkness = 0.15;
 
 			}
 

+ 11 - 49
examples/webgl_materials_bumpmap.html

@@ -65,7 +65,7 @@
 
 			var mesh;
 
-			var directionalLight, directionalLight2, pointLight, ambientLight, spotLight;
+			var spotLight;
 
 			var mouseX = 0;
 			var mouseY = 0;
@@ -93,22 +93,10 @@
 
 				// LIGHTS
 
-				ambientLight = new THREE.AmbientLight( 0x444444 );
-				scene.add( ambientLight );
+				scene.add( new THREE.HemisphereLight( 0x443333, 0x111122 ) );
 
-				//
-
-				pointLight = new THREE.PointLight( 0xffffff, 1.5, 1000 );
-				pointLight.color.setHSL( 0.05, 1, 0.95 );
-				pointLight.position.set( 0, 0, 600 );
-
-				scene.add( pointLight );
-
-				// shadow for PointLight
-
-				spotLight = new THREE.SpotLight( 0xffffff, 1.5 );
-				spotLight.position.set( 0.05, 0.05, 1 );
-				spotLight.color.setHSL( 0.6, 1, 0.95 );
+				spotLight = new THREE.SpotLight( 0xffffbb, 2 );
+				spotLight.position.set( 0.5, 0, 1 );
 				scene.add( spotLight );
 
 				spotLight.position.multiplyScalar( 700 );
@@ -126,41 +114,9 @@
 				spotLight.shadowCameraFov = 40;
 
 				spotLight.shadowBias = -0.005;
-				spotLight.shadowDarkness = 0.35;
 
 				//
 
-				directionalLight = new THREE.DirectionalLight( 0xffffff, 1.5 );
-				directionalLight.position.set( 1, -0.5, 1 );
-				directionalLight.color.setHSL( 0.6, 1, 0.95 );
-				scene.add( directionalLight );
-
-				directionalLight.position.multiplyScalar( 500 );
-
-				directionalLight.castShadow = true;
-				// directionalLight.shadowCameraVisible = true;
-
-				directionalLight.shadowMapWidth = 2048;
-				directionalLight.shadowMapHeight = 2048;
-
-				directionalLight.shadowCameraNear = 200;
-				directionalLight.shadowCameraFar = 1500;
-
-				directionalLight.shadowCameraLeft = -500;
-				directionalLight.shadowCameraRight = 500;
-				directionalLight.shadowCameraTop = 500;
-				directionalLight.shadowCameraBottom = -500;
-
-				directionalLight.shadowBias = -0.005;
-				directionalLight.shadowDarkness = 0.35;
-
-				//
-
-				directionalLight2 = new THREE.DirectionalLight( 0xffffff, 1.2 );
-				directionalLight2.position.set( 1, -0.5, -1 );
-				directionalLight2.color.setHSL( 0.08, 1, 0.825 );
-				scene.add( directionalLight2 );
-
 				var mapHeight = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Infinite-Level_02_Disp_NoSmoothUV-4096.jpg" );
 
 				mapHeight.anisotropy = 4;
@@ -169,7 +125,13 @@
 				mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping;
 				mapHeight.format = THREE.RGBFormat;
 
-				var material = new THREE.MeshPhongMaterial( { color: 0x552811, specular: 0x333333, shininess: 25, bumpMap: mapHeight, bumpScale: 19, metal: false } );
+				var material = new THREE.MeshPhongMaterial( {
+					color: 0x552811,
+					specular: 0x222222,
+					shininess: 25,
+					bumpMap: mapHeight,
+					bumpScale: 12
+				} );
 
 				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function( geometry ) { createScene( geometry, 100, material ) } );

+ 4 - 9
examples/webgl_materials_bumpmap_skin.html

@@ -71,7 +71,7 @@
 
 			var mesh, mesh2;
 
-			var directionalLight, directionalLight2;
+			var directionalLight;
 
 			var mouseX = 0;
 			var mouseY = 0;
@@ -105,7 +105,9 @@
 
 				// LIGHTS
 
-				directionalLight = new THREE.DirectionalLight( 0xffffff, 2.25 );
+				scene.add( new THREE.AmbientLight( 0x333344 ) );
+
+				directionalLight = new THREE.DirectionalLight( 0xffffff, 1 );
 				directionalLight.position.set( 500, - 250, 500 );
 
 				directionalLight.castShadow = true;
@@ -123,18 +125,11 @@
 				directionalLight.shadowCameraBottom = -500;
 
 				directionalLight.shadowBias = -0.005;
-				directionalLight.shadowDarkness = 0.2;
 
 				scene.add( directionalLight );
 
 				//
 
-				directionalLight2 = new THREE.DirectionalLight( 0x8888ff, 0.75 );
-				directionalLight2.position.set( - 500, 250, - 500 );
-				scene.add( directionalLight2 );
-
-				//
-
 				loader = new THREE.JSONLoader();
 				loader.load( "obj/leeperrysmith/LeePerrySmith.js", function ( geometry ) {
 

+ 0 - 1
examples/webgl_materials_cubemap_dynamic.html

@@ -173,7 +173,6 @@
 				spotLight.shadowCameraFov = 50;
 
 				spotLight.shadowBias = -0.00125;
-				spotLight.shadowDarkness = 0.5;
 				spotLight.shadowMapWidth = SHADOW_MAP_WIDTH;
 				spotLight.shadowMapHeight = SHADOW_MAP_HEIGHT;
 

+ 1 - 1
examples/webgl_materials_cubemap_dynamic2.html

@@ -89,7 +89,7 @@
 
 				document.addEventListener( 'mousedown', onDocumentMouseDown, false );
 				document.addEventListener( 'mousewheel', onDocumentMouseWheel, false );
-				document.addEventListener( 'DOMMouseScroll', onDocumentMouseWheel, false);
+				document.addEventListener( 'MozMousePixelScroll', onDocumentMouseWheel, false);
 				window.addEventListener( 'resize', onWindowResized, false );
 
 				onWindowResized( null );

+ 30 - 40
examples/webgl_morphnormals.html

@@ -35,7 +35,7 @@
 			var SCREEN_HEIGHT = window.innerHeight;
 
 			var container, stats;
-			var camera, scene1, scene2, renderer;
+			var camera, scene, renderer;
 			var mixers = [];
 
 			var clock = new THREE.Clock();
@@ -58,32 +58,19 @@
 
 				//
 
-				camera = new THREE.PerspectiveCamera( 40, 0.5 * SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
+				camera = new THREE.PerspectiveCamera( 40, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 10000 );
 				camera.position.y = 300;
 				camera.target = new THREE.Vector3( 0, 150, 0 );
 
-				scene1 = new THREE.Scene();
-				scene2 = new THREE.Scene();
+				scene = new THREE.Scene();
 
 				//
 
-				var light = new THREE.DirectionalLight( 0xffffff, 1.3 );
-				light.position.set( 1, 1, 1 );
-				scene1.add( light );
-
-				var light = new THREE.DirectionalLight( 0xffffff, 0.1 );
-				light.position.set( 0.25, -1, 0 );
-				scene1.add( light );
-
-				//
+				scene.add( new THREE.HemisphereLight( 0x443333, 0x222233 ) );
 
-				var light = new THREE.DirectionalLight( 0xffffff, 1.3 );
+				var light = new THREE.DirectionalLight( 0xffffff, 1 );
 				light.position.set( 1, 1, 1 );
-				scene2.add( light );
-
-				var light = new THREE.DirectionalLight( 0xffffff, 0.1 );
-				light.position.set( 0.25, -1, 0 );
-				scene2.add( light );
+				scene.add( light );
 
 				//
 
@@ -91,16 +78,22 @@
 				var loader = new THREE.JSONLoader();
 				loader.load( "models/animated/flamingo.js", function( geometry ) {
 
-					var material = new THREE.MeshPhongMaterial( { color: 0xffffff, morphTargets: true, vertexColors: THREE.FaceColors, shading: THREE.FlatShading } );
+					var material = new THREE.MeshPhongMaterial( {
+						color: 0xffffff,
+						morphTargets: true,
+						vertexColors: THREE.FaceColors,
+						shading: THREE.FlatShading
+					} );
 					var mesh = new THREE.Mesh( geometry, material );
 
-					mesh.scale.set( 1.5, 1.5, 1.5 );
+					mesh.position.x = - 150;
 					mesh.position.y = 150;
+					mesh.scale.set( 1.5, 1.5, 1.5 );
 
-					scene1.add( mesh );
+					scene.add( mesh );
 
 					var mixer = new THREE.AnimationMixer( mesh );
-					mixer.addAction( new THREE.AnimationAction( geometry.animations[ 0 ] ).warpToDuration( 5 ) );
+					mixer.addAction( new THREE.AnimationAction( geometry.animations[ 0 ] ).warpToDuration( 1 ) );
 
 					mixers.push( mixer );
 
@@ -111,16 +104,23 @@
 					geometry.computeVertexNormals();
 					geometry.computeMorphNormals();
 
-					var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 20, morphTargets: true, morphNormals: true, vertexColors: THREE.FaceColors, shading: THREE.SmoothShading } );
+					var material = new THREE.MeshPhongMaterial( {
+						color: 0xffffff,
+						morphTargets: true,
+						morphNormals: true,
+						vertexColors: THREE.FaceColors,
+						shading: THREE.SmoothShading
+					} );
 					var mesh = new THREE.Mesh( geometry, material );
 
-					mesh.scale.set( 1.5, 1.5, 1.5 );
+					mesh.position.x = 150;
 					mesh.position.y = 150;
+					mesh.scale.set( 1.5, 1.5, 1.5 );
 
-					scene2.add( mesh );
+					scene.add( mesh );
 
 					var mixer = new THREE.AnimationMixer( mesh );
-					mixer.addAction( new THREE.AnimationAction( geometry.animations[ 0 ] ).warpToDuration( 5 ) );
+					mixer.addAction( new THREE.AnimationAction( geometry.animations[ 0 ] ).warpToDuration( 1 ) );
 
 					mixers.push( mixer );
 
@@ -129,12 +129,6 @@
 				//
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
-				renderer.sortObjects = false;
-				renderer.autoClear = false;
-
-				renderer.gammaInput = true;
-				renderer.gammaOutput = true;
-
 				renderer.setPixelRatio( window.devicePixelRatio );
 				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
 
@@ -190,18 +184,14 @@
 
 				var delta = clock.getDelta();
 
-   				for ( var i = 0; i < mixers.length; i ++ ) {
+				for ( var i = 0; i < mixers.length; i ++ ) {
+
 					mixers[ i ].update( delta );
 
 				}
 
 				renderer.clear();
-
-				renderer.setViewport( 0, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT );
-				renderer.render( scene1, camera );
-
-				renderer.setViewport( SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT );
-				renderer.render( scene2, camera );
+				renderer.render( scene, camera );
 
 			}
 

+ 1 - 1
examples/webgl_panorama_equirectangular.html

@@ -81,7 +81,7 @@
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'mouseup', onDocumentMouseUp, false );
 				document.addEventListener( 'mousewheel', onDocumentMouseWheel, false );
-				document.addEventListener( 'DOMMouseScroll', onDocumentMouseWheel, false);
+				document.addEventListener( 'MozMousePixelScroll', onDocumentMouseWheel, false);
 
 				//
 

+ 1 - 8
examples/webgl_shading_physical.html

@@ -86,8 +86,7 @@
 				shadowCameraNear: 750,
 				shadowCameraFar: 4000,
 				shadowCameraFov: 30,
-				shadowBias: -0.0002,
-				shadowDarkness: 0.3
+				shadowBias: -0.0002
 
 			}, gamma = {
 				gammaFactor: 2.0,
@@ -317,7 +316,6 @@
 
 				sunLight.castShadow = true;
 
-				sunLight.shadowDarkness = 0.3 * sunIntensity;
 				sunLight.shadowBias = -0.0002;
 
 				sunLight.shadowCameraNear = 750;
@@ -427,9 +425,6 @@
 
 				});
 
-				shadowGUI.add( shadowConfig, 'shadowDarkness', 0, 1 ).onChange( function() {
-
-				});
 				shadowGUI.open();
 
 				gammaGUI = gui.addFolder( "Gamma" );
@@ -540,8 +535,6 @@
 
 				pointLight.color.setHSL( 0.1, 0.75, parameters.control * 0.5 + 0.5 );
 
-				sunLight.shadowDarkness = shadowConfig.shadowDarkness * sunLight.intensity;
-
 				// render cube map
 
 				mesh.visible = false;

+ 0 - 1
examples/webgl_shadowmap.html

@@ -120,7 +120,6 @@
 				//light.shadowCameraVisible = true;
 
 				light.shadowBias = 0.0001;
-				light.shadowDarkness = 0.5;
 
 				light.shadowMapWidth = SHADOW_MAP_WIDTH;
 				light.shadowMapHeight = SHADOW_MAP_HEIGHT;

+ 0 - 1
examples/webgl_shadowmap_performance.html

@@ -113,7 +113,6 @@
 				//light.shadowCameraVisible = true;
 
 				light.shadowBias = 0.0001;
-				light.shadowDarkness = 0.5;
 
 				light.shadowMapWidth = SHADOW_MAP_WIDTH;
 				light.shadowMapHeight = SHADOW_MAP_HEIGHT;

+ 2 - 1
examples/webgl_shadowmap_pointlight.html

@@ -61,6 +61,7 @@
 				camera.position.set( 0, 10, 40 );
 
 				scene = new THREE.Scene();
+				scene.add( new THREE.AmbientLight( 0x222233 ) );
 
 				// Lights
 
@@ -70,11 +71,11 @@
 					pointLight.castShadow = true;
 					pointLight.shadowCameraNear = 1;
 					pointLight.shadowCameraFar = 30;
-					pointLight.shadowDarkness = 0.5;
 					// pointLight.shadowCameraVisible = true;
 					pointLight.shadowMapWidth = 2048;
 					pointLight.shadowMapHeight = 1024;
 					pointLight.shadowBias = 0.01;
+					pointLight.shadowDarkness = 0.5;
 
 					var geometry = new THREE.SphereGeometry( 0.3, 32, 32 );
 					var material = new THREE.MeshBasicMaterial( { color: color } );

+ 0 - 2
examples/webgl_shadowmap_viewer.html

@@ -80,7 +80,6 @@
 				spotLight.castShadow = true;
 				spotLight.shadowCameraNear = 8;
 				spotLight.shadowCameraFar = 30;
-				spotLight.shadowDarkness = 0.5;
 				spotLight.shadowMapWidth = 1024;
 				spotLight.shadowMapHeight = 1024;
 				scene.add( spotLight );
@@ -97,7 +96,6 @@
 				dirLight.shadowCameraLeft = -15;
 				dirLight.shadowCameraTop	= 15;
 				dirLight.shadowCameraBottom = -15;
-				dirLight.shadowDarkness = 0.5;
 				dirLight.shadowMapWidth = 1024;
 				dirLight.shadowMapHeight = 1024;
 				scene.add( dirLight );

+ 1 - 1
examples/webgl_video_panorama_equirectangular.html

@@ -86,7 +86,7 @@
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'mouseup', onDocumentMouseUp, false );
 				document.addEventListener( 'mousewheel', onDocumentMouseWheel, false );
-				document.addEventListener( 'DOMMouseScroll', onDocumentMouseWheel, false);
+				document.addEventListener( 'MozMousePixelScroll', onDocumentMouseWheel, false);
 
 				//
 

+ 1 - 1
src/lights/LightShadow.js

@@ -7,7 +7,7 @@ THREE.LightShadow = function ( camera ) {
 	this.camera = camera;
 
 	this.bias = 0;
-	this.darkness = 0.5;
+	this.darkness = 1;
 
 	this.mapSize = new THREE.Vector2( 512, 512 );
 

+ 1 - 1
src/objects/SkinnedMesh.js

@@ -43,7 +43,7 @@ THREE.SkinnedMesh = function ( geometry, material, useVertexTexture ) {
 
 			gbone = this.geometry.bones[ b ];
 
-			if ( gbone.parent !== - 1 ) {
+			if ( gbone.parent !== - 1 && gbone.parent !== null) {
 
 				bones[ gbone.parent ].add( bones[ b ] );
 

+ 0 - 2
src/renderers/shaders/ShaderChunk/lights_lambert_pars_vertex.glsl

@@ -1,5 +1,3 @@
-uniform vec3 ambientLightColor;
-
 #if MAX_DIR_LIGHTS > 0
 
 	uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];

+ 0 - 8
src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl

@@ -126,11 +126,3 @@ vec3 normal = normalize( transformedNormal );
 	}
 
 #endif
-
-vLightFront += ambientLightColor;
-
-#ifdef DOUBLE_SIDED
-
-	vLightBack += ambientLightColor;
-
-#endif

+ 0 - 10
src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl

@@ -97,13 +97,3 @@ vec3 totalSpecularLight = vec3( 0.0 );
 	}
 
 #endif
-
-#ifdef METAL
-
-	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) * specular + totalSpecularLight + totalEmissiveLight;
-
-#else
-
-	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) + totalSpecularLight + totalEmissiveLight;
-
-#endif

+ 9 - 13
src/renderers/shaders/ShaderChunk/shadowmap_fragment.glsl

@@ -1,18 +1,16 @@
 #ifdef USE_SHADOWMAP
 
-	vec3 shadowMask = vec3( 1.0 );
-
 	for ( int i = 0; i < MAX_SHADOWS; i ++ ) {
-		
+
 		float texelSizeY =  1.0 / shadowMapSize[ i ].y;
 
-		float shadow = 0.0;	
+		float shadow = 0.0;
 
 #if defined( POINT_LIGHT_SHADOWS )
 
 		// to save on uniform space, we use the sign of @shadowDarkness[ i ] to determine
 		// whether or not this light is a point light ( shadowDarkness[ i ] < 0 == point light)
-		bool isPointLight = shadowDarkness[ i ] < 0.0;	
+		bool isPointLight = shadowDarkness[ i ] < 0.0;
 
 		if ( isPointLight ) {
 
@@ -102,11 +100,11 @@
 			if ( frustumTest ) {
 
 	#if defined( SHADOWMAP_TYPE_PCF )
-		
+
 				// Percentage-close filtering
 				// (9 pixel kernel)
 				// http://fabiensanglard.net/shadowmappingPCF/
-				
+
 				/*
 						// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL
 						// must enroll loop manually
@@ -163,7 +161,7 @@
 
 				shadow *= shadowDarkness[ i ];
 
-	#elif defined( SHADOWMAP_TYPE_PCF_SOFT )				
+	#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
 
 				// Percentage-close filtering
 				// (9 pixel kernel)
@@ -216,14 +214,14 @@
 				shadow = dot( shadowValues, vec4( 1.0 ) ) * shadowDarkness[ i ];
 
 	#else // no percentage-closer filtering:
-				
+
 				shadowCoord.z += shadowBias[ i ];
 
 				vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );
 				float fDepth = unpackDepth( rgbaDepth );
 
 				if ( fDepth < shadowCoord.z )
-					shadow = shadowDarkness[ i ];				
+					shadow = shadowDarkness[ i ];
 
 	#endif
 
@@ -257,10 +255,8 @@
 
 #endif
 
-		shadowMask = shadowMask * vec3( 1.0 - shadow );	
+		shadowMask = shadowMask * vec3( 1.0 - shadow );
 
 	}
 
-	outgoingLight = outgoingLight * shadowMask;
-
 #endif

+ 28 - 15
src/renderers/shaders/ShaderLib.js

@@ -15,8 +15,7 @@ THREE.ShaderLib = {
 
 			THREE.UniformsLib[ "common" ],
 			THREE.UniformsLib[ "aomap" ],
-			THREE.UniformsLib[ "fog" ],
-			THREE.UniformsLib[ "shadowmap" ]
+			THREE.UniformsLib[ "fog" ]
 
 		] ),
 
@@ -29,7 +28,6 @@ THREE.ShaderLib = {
 			THREE.ShaderChunk[ "color_pars_vertex" ],
 			THREE.ShaderChunk[ "morphtarget_pars_vertex" ],
 			THREE.ShaderChunk[ "skinning_pars_vertex" ],
-			THREE.ShaderChunk[ "shadowmap_pars_vertex" ],
 			THREE.ShaderChunk[ "logdepthbuf_pars_vertex" ],
 
 			"void main() {",
@@ -56,7 +54,6 @@ THREE.ShaderLib = {
 
 				THREE.ShaderChunk[ "worldpos_vertex" ],
 				THREE.ShaderChunk[ "envmap_vertex" ],
-				THREE.ShaderChunk[ "shadowmap_vertex" ],
 
 			"}"
 
@@ -76,7 +73,6 @@ THREE.ShaderLib = {
 			THREE.ShaderChunk[ "aomap_pars_fragment" ],
 			THREE.ShaderChunk[ "envmap_pars_fragment" ],
 			THREE.ShaderChunk[ "fog_pars_fragment" ],
-			THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
 			THREE.ShaderChunk[ "specularmap_pars_fragment" ],
 			THREE.ShaderChunk[ "logdepthbuf_pars_fragment" ],
 
@@ -94,10 +90,9 @@ THREE.ShaderLib = {
 				THREE.ShaderChunk[ "specularmap_fragment" ],
 				THREE.ShaderChunk[ "aomap_fragment" ],
 
-			"	outgoingLight = diffuseColor.rgb * totalAmbientLight;", // simple shader
+			"	outgoingLight = diffuseColor.rgb * totalAmbientLight;",
 
 				THREE.ShaderChunk[ "envmap_fragment" ],
-				THREE.ShaderChunk[ "shadowmap_fragment" ],		// TODO: Shadows on an otherwise unlit surface doesn't make sense.
 
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 
@@ -182,6 +177,8 @@ THREE.ShaderLib = {
 			"uniform vec3 emissive;",
 			"uniform float opacity;",
 
+			"uniform vec3 ambientLightColor;",
+
 			"varying vec3 vLightFront;",
 
 			"#ifdef DOUBLE_SIDED",
@@ -206,6 +203,8 @@ THREE.ShaderLib = {
 
 			"	vec3 outgoingLight = vec3( 0.0 );",	// outgoing light does not have an alpha, the surface does
 			"	vec4 diffuseColor = vec4( diffuse, opacity );",
+			"	vec3 totalAmbientLight = ambientLightColor;",
+			"	vec3 shadowMask = vec3( 1.0 );",
 
 				THREE.ShaderChunk[ "logdepthbuf_fragment" ],
 				THREE.ShaderChunk[ "map_fragment" ],
@@ -213,22 +212,22 @@ THREE.ShaderLib = {
 				THREE.ShaderChunk[ "alphamap_fragment" ],
 				THREE.ShaderChunk[ "alphatest_fragment" ],
 				THREE.ShaderChunk[ "specularmap_fragment" ],
+				THREE.ShaderChunk[ "shadowmap_fragment" ],
 
 			"	#ifdef DOUBLE_SIDED",
 
 			"		if ( gl_FrontFacing )",
-			"			outgoingLight += diffuseColor.rgb * vLightFront + emissive;",
+			"			outgoingLight += diffuseColor.rgb * ( vLightFront * shadowMask + totalAmbientLight ) + emissive;",
 			"		else",
-			"			outgoingLight += diffuseColor.rgb * vLightBack + emissive;",
+			"			outgoingLight += diffuseColor.rgb * ( vLightBack * shadowMask + totalAmbientLight ) + emissive;",
 
 			"	#else",
 
-			"		outgoingLight += diffuseColor.rgb * vLightFront + emissive;",
+			"		outgoingLight += diffuseColor.rgb * ( vLightFront * shadowMask + totalAmbientLight ) + emissive;",
 
 			"	#endif",
 
 				THREE.ShaderChunk[ "envmap_fragment" ],
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
 
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 
@@ -359,6 +358,7 @@ THREE.ShaderLib = {
 			"	vec4 diffuseColor = vec4( diffuse, opacity );",
 			"	vec3 totalAmbientLight = ambientLightColor;",
 			"	vec3 totalEmissiveLight = emissive;",
+			"	vec3 shadowMask = vec3( 1.0 );",
 
 				THREE.ShaderChunk[ "logdepthbuf_fragment" ],
 				THREE.ShaderChunk[ "map_fragment" ],
@@ -373,9 +373,22 @@ THREE.ShaderLib = {
 				THREE.ShaderChunk[ "emissivemap_fragment" ],
 
 				THREE.ShaderChunk[ "lights_phong_fragment" ],
+				THREE.ShaderChunk[ "shadowmap_fragment" ],
+
+				"totalDiffuseLight *= shadowMask;",
+				"totalSpecularLight *= shadowMask;",
+
+				"#ifdef METAL",
+
+				"	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) * specular + totalSpecularLight + totalEmissiveLight;",
+
+				"#else",
+
+				"	outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) + totalSpecularLight + totalEmissiveLight;",
+
+				"#endif",
 
 				THREE.ShaderChunk[ "envmap_fragment" ],
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
 
 				THREE.ShaderChunk[ "linear_to_gamma_fragment" ],
 
@@ -446,15 +459,16 @@ THREE.ShaderLib = {
 
 			"	vec3 outgoingLight = vec3( 0.0 );",
 			"	vec4 diffuseColor = vec4( psColor, opacity );",
+			"	vec3 shadowMask = vec3( 1.0 );",
 
 				THREE.ShaderChunk[ "logdepthbuf_fragment" ],
 				THREE.ShaderChunk[ "map_particle_fragment" ],
 				THREE.ShaderChunk[ "color_fragment" ],
 				THREE.ShaderChunk[ "alphatest_fragment" ],
+				THREE.ShaderChunk[ "shadowmap_fragment" ],
 
-			"	outgoingLight = diffuseColor.rgb;", // simple shader
+			"	outgoingLight = diffuseColor.rgb * shadowMask;",
 
-				THREE.ShaderChunk[ "shadowmap_fragment" ],
 				THREE.ShaderChunk[ "fog_fragment" ],
 
 			"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );",
@@ -905,4 +919,3 @@ THREE.ShaderLib = {
 	}
 
 };
-

+ 4 - 1
utils/build/build.py

@@ -61,7 +61,10 @@ def main(argv=None):
 			with open(filename, 'r', encoding='utf-8') as f:
 				if filename.endswith(".glsl"):
 					tmp.write(u'THREE.ShaderChunk[ \'' + os.path.splitext(os.path.basename(filename))[0] + u'\'] = "')
-					tmp.write(re.sub(r"\t*//.*\n", "", f.read()).replace('\n','\\n'))
+					text = f.read()
+					text = re.sub(r"\t*//.*\n", "", text) # strip comments
+					text = text.replace('\n','\\n') # line breaks to \n
+					tmp.write(text)
 					tmp.write(u'";\n\n')
 				else:
 					tmp.write(f.read())

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