diff --git a/src/loaders/MaterialLoader.js b/src/loaders/MaterialLoader.js index 270f13d3d92259f40b04c79a57ec65e8c60519eb..f538e9608618001efcc5aac35be6331646cb094e 100644 --- a/src/loaders/MaterialLoader.js +++ b/src/loaders/MaterialLoader.js @@ -93,6 +93,7 @@ Object.assign( MaterialLoader.prototype, { if ( json.skinning !== undefined ) material.skinning = json.skinning; if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets; + if ( json.morphNormals !== undefined ) material.morphNormals = json.morphNormals; if ( json.dithering !== undefined ) material.dithering = json.dithering; if ( json.visible !== undefined ) material.visible = json.visible; @@ -218,6 +219,7 @@ Object.assign( MaterialLoader.prototype, { if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity; if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; + if ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio; if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; diff --git a/src/materials/Material.js b/src/materials/Material.js index 53686cecd415f541d830e9eac8f1933569a0c6c2..5e03638630b6cd49c1b348964a258a8258cba844 100644 --- a/src/materials/Material.js +++ b/src/materials/Material.js @@ -160,7 +160,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), if ( this.metalness !== undefined ) data.metalness = this.metalness; if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex(); - if ( this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity; + if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity; if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex(); if ( this.shininess !== undefined ) data.shininess = this.shininess; @@ -212,6 +212,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), data.envMap = this.envMap.toJSON( meta ).uuid; data.reflectivity = this.reflectivity; // Scale behind envMap + data.refractionRatio = this.refractionRatio; if ( this.combine !== undefined ) data.combine = this.combine; if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity; @@ -240,13 +241,13 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), data.depthWrite = this.depthWrite; // rotation (SpriteMaterial) - if ( this.rotation !== 0 ) data.rotation = this.rotation; + if ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation; if ( this.polygonOffset === true ) data.polygonOffset = true; if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor; if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits; - if ( this.linewidth !== 1 ) data.linewidth = this.linewidth; + if ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth; if ( this.dashSize !== undefined ) data.dashSize = this.dashSize; if ( this.gapSize !== undefined ) data.gapSize = this.gapSize; if ( this.scale !== undefined ) data.scale = this.scale; @@ -262,6 +263,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; if ( this.morphTargets === true ) data.morphTargets = true; + if ( this.morphNormals === true ) data.morphNormals = true; if ( this.skinning === true ) data.skinning = true; if ( this.visible === false ) data.visible = false;