Browse Source

Materials code clean up.

Mr.doob 13 years ago
parent
commit
886a913020

+ 9 - 10
build/Three.js

@@ -190,19 +190,18 @@ x.parameters.map;a.enableDiffuse.value=true}if(x.parameters.lightMap){a.tAO.text
 uniforms:a,lights:true,fog:true})}else M=new THREE[x.type](x.parameters);N.materials[m]=M}e(N.scene,B.objects);i.callbackSync(N);h()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
 THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){var a=new THREE.Texture(c);a.needsUpdate=true;b.dispatchEvent({type:"load",content:a})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};
 THREE.Material=function(){this.id=THREE.MaterialCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=false;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=true;this.polygonOffset=false;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=false;this.needsUpdate=this.visible=true};
-THREE.Material.prototype.setParameters=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
-THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setParameters(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
+THREE.Material.prototype.setValues=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
+THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
+THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
 THREE.MeshBasicMaterial.prototype.clone=function(){return new THREE.MeshBasicMaterial(this)};
 THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";
-this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
+this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){return new THREE.MeshLambertMaterial(this)};
 THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.perPixel=this.metal=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;
-this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
-THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};
-THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setParameters(a)};
-THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setParameters(a)};THREE.ParticleCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleCanvasMaterial.prototype.clone=function(){return new THREE.ParticleCanvasMaterial(this)};
-THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype.clone=function(){return new THREE.ParticleDOMMaterial(this.domElement)};
-THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.attributes=null;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.lights=this.fog=false;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.clone=function(){return new THREE.ShaderMaterial(this)};
+this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){return new THREE.MeshPhongMaterial(this)};THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};
+THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};
+THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};
+THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setValues(a)};THREE.ParticleCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleCanvasMaterial.prototype.clone=function(){return new THREE.ParticleCanvasMaterial(this)};THREE.ParticleDOMMaterial=function(a){this.domElement=a};THREE.ParticleDOMMaterial.prototype.clone=function(){return new THREE.ParticleDOMMaterial(this.domElement)};
+THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.attributes=null;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.lights=this.fog=false;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.clone=function(){return new THREE.ShaderMaterial(this)};
 THREE.Texture=function(a,b,c,d,e,f,g,h,i){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=f!==void 0?f:THREE.LinearMipMapLinearFilter;this.anisotropy=i!==void 0?i:1;this.format=g!==void 0?g:THREE.RGBAFormat;this.type=h!==void 0?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=
 new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.needsUpdate=false;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type,this.anisotropy);a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;return a}};
 THREE.TextureCount=0;THREE.DataTexture=function(a,b,c,d,e,f,g,h,i,j){THREE.Texture.call(this,null,f,g,h,i,j,d,e);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};

+ 8 - 8
build/custom/ThreeCanvas.js

@@ -183,17 +183,17 @@ u.parameters.map;a.enableDiffuse.value=true}if(u.parameters.lightMap){a.tAO.text
 uniforms:a,lights:true,fog:true})}else K=new THREE[u.type](u.parameters);z.materials[n]=K}f(z.scene,t.objects);m.callbackSync(z);j()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
 THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){var a=new THREE.Texture(c);a.needsUpdate=true;b.dispatchEvent({type:"load",content:a})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};
 THREE.Material=function(){this.id=THREE.MaterialCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=false;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=true;this.polygonOffset=false;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=false;this.needsUpdate=this.visible=true};
-THREE.Material.prototype.setParameters=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
-THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setParameters(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
+THREE.Material.prototype.setValues=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
+THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
+THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
 THREE.MeshBasicMaterial.prototype.clone=function(){return new THREE.MeshBasicMaterial(this)};
 THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";
-this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
+this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){return new THREE.MeshLambertMaterial(this)};
 THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.perPixel=this.metal=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;
-this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
-THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};
-THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setParameters(a)};
-THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setParameters(a)};THREE.ParticleCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleCanvasMaterial.prototype.clone=function(){return new THREE.ParticleCanvasMaterial(this)};
+this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){return new THREE.MeshPhongMaterial(this)};THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};
+THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};
+THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};
+THREE.ParticleCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setValues(a)};THREE.ParticleCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleCanvasMaterial.prototype.clone=function(){return new THREE.ParticleCanvasMaterial(this)};
 THREE.Texture=function(a,b,c,d,f,e,g,j,m){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=e!==void 0?e:THREE.LinearMipMapLinearFilter;this.anisotropy=m!==void 0?m:1;this.format=g!==void 0?g:THREE.RGBAFormat;this.type=j!==void 0?j:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=
 new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.needsUpdate=false;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type,this.anisotropy);a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;return a}};
 THREE.TextureCount=0;THREE.DataTexture=function(a,b,c,d,f,e,g,j,m,k){THREE.Texture.call(this,null,e,g,j,m,k,d,f);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};

+ 8 - 9
build/custom/ThreeWebGL.js

@@ -189,18 +189,17 @@ if(x.parameters.map){a.tDiffuse.texture=x.parameters.map;a.enableDiffuse.value=t
 vertexShader:r.vertexShader,uniforms:a,lights:true,fog:true})}else U=new THREE[x.type](x.parameters);N.materials[m]=U}e(N.scene,z.objects);l.callbackSync(N);j()};THREE.TextureLoader=function(){THREE.EventTarget.call(this);this.crossOrigin=null};
 THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a){var b=this,c=new Image;c.addEventListener("load",function(){var a=new THREE.Texture(c);a.needsUpdate=true;b.dispatchEvent({type:"load",content:a})},false);c.addEventListener("error",function(){b.dispatchEvent({type:"error",message:"Couldn't load URL ["+a+"]"})},false);if(b.crossOrigin)c.crossOrigin=b.crossOrigin;c.src=a}};
 THREE.Material=function(){this.id=THREE.MaterialCount++;this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=false;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=true;this.polygonOffset=false;this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.overdraw=false;this.needsUpdate=this.visible=true};
-THREE.Material.prototype.setParameters=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
-THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setParameters(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
-THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
+THREE.Material.prototype.setValues=function(a){a===void 0&&(a={});for(var b in a){var c=a[b];if(this[b]!==void 0)switch(b){case "color":case "ambient":case "emissive":case "specular":c instanceof THREE.Color?this[b].copy(c):this[b].setHex(c);break;case "wrapRGB":this[b].copy(c);break;default:this[b]=c}}};THREE.Material.prototype.clone=function(){return new THREE.Material(this)};THREE.MaterialCount=0;
+THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.clone=function(){return new THREE.LineBasicMaterial(this)};
+THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);
 THREE.MeshBasicMaterial.prototype.clone=function(){return new THREE.MeshBasicMaterial(this)};
 THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";
-this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
+this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.clone=function(){return new THREE.MeshLambertMaterial(this)};
 THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.perPixel=this.metal=false;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=true;this.shading=THREE.SmoothShading;this.wireframe=false;
-this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial(this);a.wrapRGB=this.wrapRGB.clone();return a};
-THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setParameters(a)};
-THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setParameters(a)};
-THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};
-THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.attributes=null;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.lights=this.fog=false;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setParameters(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.clone=function(){return new THREE.ShaderMaterial(this)};
+this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.clone=function(){return new THREE.MeshPhongMaterial(this)};THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};
+THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){return new THREE.MeshDepthMaterial(this)};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){return new THREE.MeshNormalMaterial(this)};
+THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype.clone=function(){return new THREE.MeshFaceMaterial};THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=true;this.vertexColors=false;this.fog=true;this.setValues(a)};THREE.ParticleBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ParticleBasicMaterial.prototype.clone=function(){return new THREE.ParticleBasicMaterial(this)};
+THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.attributes=null;this.shading=THREE.SmoothShading;this.wireframe=false;this.wireframeLinewidth=1;this.lights=this.fog=false;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=false;this.setValues(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.clone=function(){return new THREE.ShaderMaterial(this)};
 THREE.Texture=function(a,b,c,d,e,f,h,j,l){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=e!==void 0?e:THREE.LinearFilter;this.minFilter=f!==void 0?f:THREE.LinearMipMapLinearFilter;this.anisotropy=l!==void 0?l:1;this.format=h!==void 0?h:THREE.RGBAFormat;this.type=j!==void 0?j:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=
 new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.needsUpdate=false;this.onUpdate=null};THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter,this.format,this.type,this.anisotropy);a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;return a}};
 THREE.TextureCount=0;THREE.DataTexture=function(a,b,c,d,e,f,h,j,l,k){THREE.Texture.call(this,null,f,h,j,l,k,d,e);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.image.data,this.image.width,this.image.height,this.format,this.type,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};

+ 1 - 1
src/materials/LineBasicMaterial.js

@@ -33,7 +33,7 @@ THREE.LineBasicMaterial = function ( parameters ) {
 
 	this.fog = true;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 5 - 5
src/materials/Material.js

@@ -3,7 +3,7 @@
  * @author alteredq / http://alteredqualia.com/
  */
 
-THREE.Material = function ( parameters ) {
+THREE.Material = function () {
 
 	this.id = THREE.MaterialCount ++;
 
@@ -37,13 +37,13 @@ THREE.Material = function ( parameters ) {
 
 };
 
-THREE.Material.prototype.setParameters = function ( parameters ) {
+THREE.Material.prototype.setValues = function ( values ) {
 
-	if ( parameters === undefined ) parameters = {};
+	if ( values === undefined ) values = {};
 
-	for ( var key in parameters ) {
+	for ( var key in values ) {
 
-		var value = parameters[ key ];
+		var value = values[ key ];
 
 		if ( this[ key ] !== undefined ) {
 

+ 1 - 1
src/materials/MeshBasicMaterial.js

@@ -59,7 +59,7 @@ THREE.MeshBasicMaterial = function ( parameters ) {
 	this.skinning = false;
 	this.morphTargets = false;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 1 - 1
src/materials/MeshDepthMaterial.js

@@ -22,7 +22,7 @@ THREE.MeshDepthMaterial = function ( parameters ) {
 	this.wireframe = false;
 	this.wireframeLinewidth = 1;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 2 - 4
src/materials/MeshLambertMaterial.js

@@ -69,7 +69,7 @@ THREE.MeshLambertMaterial = function ( parameters ) {
 	this.morphTargets = false;
 	this.morphNormals = false;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 
@@ -77,8 +77,6 @@ THREE.MeshLambertMaterial.prototype = Object.create( THREE.Material.prototype );
 
 THREE.MeshLambertMaterial.prototype.clone = function () {
 
-	var material = new THREE.MeshLambertMaterial( this );
-	material.wrapRGB = this.wrapRGB.clone();
-	return material;
+	return new THREE.MeshLambertMaterial( this );
 
 };

+ 1 - 1
src/materials/MeshNormalMaterial.js

@@ -22,7 +22,7 @@ THREE.MeshNormalMaterial = function ( parameters ) {
 	this.wireframe = false;
 	this.wireframeLinewidth = 1;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 2 - 4
src/materials/MeshPhongMaterial.js

@@ -76,7 +76,7 @@ THREE.MeshPhongMaterial = function ( parameters ) {
 	this.morphTargets = false;
 	this.morphNormals = false;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 
@@ -84,8 +84,6 @@ THREE.MeshPhongMaterial.prototype = Object.create( THREE.Material.prototype );
 
 THREE.MeshPhongMaterial.prototype.clone = function () {
 
-	var material = new THREE.MeshPhongMaterial( this );
-	material.wrapRGB = this.wrapRGB.clone();
-	return material;
+	return new THREE.MeshPhongMaterial( this );
 
 };

+ 1 - 1
src/materials/ParticleBasicMaterial.js

@@ -33,7 +33,7 @@ THREE.ParticleBasicMaterial = function ( parameters ) {
 
 	this.fog = true;
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 1 - 1
src/materials/ParticleCanvasMaterial.js

@@ -16,7 +16,7 @@ THREE.ParticleCanvasMaterial = function ( parameters ) {
 	this.color = new THREE.Color( 0xffffff );
 	this.program = function ( context, color ) {};
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };
 

+ 1 - 1
src/materials/ShaderMaterial.js

@@ -51,7 +51,7 @@ THREE.ShaderMaterial = function ( parameters ) {
 	this.morphTargets = false; // set to use morph targets
 	this.morphNormals = false; // set to use morph normals
 
-	this.setParameters( parameters );
+	this.setValues( parameters );
 
 };