|
@@ -27152,23 +27152,23 @@
|
|
|
|
|
|
},
|
|
|
|
|
|
- getTexture: function ( name ) {
|
|
|
+ parse: function ( json ) {
|
|
|
|
|
|
var textures = this.textures;
|
|
|
|
|
|
- if ( textures[ name ] === undefined ) {
|
|
|
+ function getTexture( name ) {
|
|
|
|
|
|
- console.warn( 'THREE.MaterialLoader: Undefined texture', name );
|
|
|
+ if ( textures[ name ] === undefined ) {
|
|
|
|
|
|
- }
|
|
|
+ console.warn( 'THREE.MaterialLoader: Undefined texture', name );
|
|
|
|
|
|
- return textures[ name ];
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
+ return textures[ name ];
|
|
|
|
|
|
- parse: function ( json ) {
|
|
|
+ }
|
|
|
|
|
|
- var material = new THREE[ json.type ];
|
|
|
+ var material = new THREE[ json.type ]();
|
|
|
|
|
|
if ( json.uuid !== undefined ) material.uuid = json.uuid;
|
|
|
if ( json.name !== undefined ) material.name = json.name;
|
|
@@ -27197,7 +27197,7 @@
|
|
|
if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;
|
|
|
if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;
|
|
|
if ( json.skinning !== undefined ) material.skinning = json.skinning;
|
|
|
- if ( json.morphTargets !== undefined ) material.wireframe = json.morphTargets;
|
|
|
+ if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
|
|
|
|
|
|
// for PointsMaterial
|
|
|
|
|
@@ -27206,19 +27206,19 @@
|
|
|
|
|
|
// maps
|
|
|
|
|
|
- if ( json.map !== undefined ) material.map = this.getTexture( json.map );
|
|
|
+ if ( json.map !== undefined ) material.map = getTexture( json.map );
|
|
|
|
|
|
if ( json.alphaMap !== undefined ) {
|
|
|
|
|
|
- material.alphaMap = this.getTexture( json.alphaMap );
|
|
|
+ material.alphaMap = getTexture( json.alphaMap );
|
|
|
material.transparent = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( json.bumpMap !== undefined ) material.bumpMap = this.getTexture( json.bumpMap );
|
|
|
+ if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );
|
|
|
if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;
|
|
|
|
|
|
- if ( json.normalMap !== undefined ) material.normalMap = this.getTexture( json.normalMap );
|
|
|
+ if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );
|
|
|
if ( json.normalScale !== undefined ) {
|
|
|
|
|
|
var normalScale = json.normalScale;
|
|
@@ -27235,31 +27235,26 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( json.displacementMap !== undefined ) material.displacementMap = this.getTexture( json.displacementMap );
|
|
|
+ if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );
|
|
|
if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;
|
|
|
if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;
|
|
|
|
|
|
- if ( json.roughnessMap !== undefined ) material.roughnessMap = this.getTexture( json.roughnessMap );
|
|
|
- if ( json.metalnessMap !== undefined ) material.metalnessMap = this.getTexture( json.metalnessMap );
|
|
|
+ if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );
|
|
|
+ if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );
|
|
|
|
|
|
- if ( json.emissiveMap !== undefined ) material.emissiveMap = this.getTexture( json.emissiveMap );
|
|
|
+ if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );
|
|
|
if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;
|
|
|
|
|
|
- if ( json.specularMap !== undefined ) material.specularMap = this.getTexture( json.specularMap );
|
|
|
-
|
|
|
- if ( json.envMap !== undefined ) {
|
|
|
+ if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );
|
|
|
|
|
|
- material.envMap = this.getTexture( json.envMap );
|
|
|
- material.combine = MultiplyOperation;
|
|
|
-
|
|
|
- }
|
|
|
+ if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );
|
|
|
|
|
|
if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;
|
|
|
|
|
|
- if ( json.lightMap !== undefined ) material.lightMap = this.getTexture( json.lightMap );
|
|
|
+ if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );
|
|
|
if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;
|
|
|
|
|
|
- if ( json.aoMap !== undefined ) material.aoMap = this.getTexture( json.aoMap );
|
|
|
+ if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );
|
|
|
if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;
|
|
|
|
|
|
// MultiMaterial
|