|
@@ -61,10 +61,10 @@ function Material() {
|
|
|
|
|
|
this.visible = true;
|
|
|
|
|
|
- this.needsUpdate = true;
|
|
|
-
|
|
|
this.userData = {};
|
|
|
|
|
|
+ this.needsUpdate = true;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
Object.assign( Material.prototype, EventDispatcher.prototype, {
|
|
@@ -155,7 +155,6 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
|
|
|
data.type = this.type;
|
|
|
|
|
|
if ( this.name !== '' ) data.name = this.name;
|
|
|
- if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
|
|
|
|
|
|
if ( this.color && this.color.isColor ) data.color = this.color.getHex();
|
|
|
|
|
@@ -224,17 +223,21 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
|
|
|
data.depthTest = this.depthTest;
|
|
|
data.depthWrite = this.depthWrite;
|
|
|
|
|
|
+ if ( this.dithering === true ) data.dithering = true;
|
|
|
+
|
|
|
if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
|
|
|
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
|
|
|
+
|
|
|
if ( this.wireframe === true ) data.wireframe = this.wireframe;
|
|
|
if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;
|
|
|
if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;
|
|
|
if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;
|
|
|
|
|
|
- data.skinning = this.skinning;
|
|
|
- data.morphTargets = this.morphTargets;
|
|
|
+ if ( this.morphTargets === true ) data.morphTargets = true;
|
|
|
+ if ( this.skinning === true ) data.skinning = true;
|
|
|
|
|
|
- data.dithering = this.dithering;
|
|
|
+ if ( this.visible === false ) data.visible = false;
|
|
|
+ if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
|
|
|
|
|
|
// TODO: Copied from Object3D.toJSON
|
|
|
|
|
@@ -311,12 +314,13 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
|
|
|
this.dithering = source.dithering;
|
|
|
|
|
|
this.alphaTest = source.alphaTest;
|
|
|
-
|
|
|
this.premultipliedAlpha = source.premultipliedAlpha;
|
|
|
|
|
|
this.overdraw = source.overdraw;
|
|
|
|
|
|
this.visible = source.visible;
|
|
|
+ this.userData = JSON.parse( JSON.stringify( source.userData ) );
|
|
|
+
|
|
|
this.clipShadows = source.clipShadows;
|
|
|
this.clipIntersection = source.clipIntersection;
|
|
|
|
|
@@ -334,7 +338,6 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
|
|
|
}
|
|
|
|
|
|
this.clippingPlanes = dstPlanes;
|
|
|
- this.userData = JSON.parse( JSON.stringify( source.userData ) );
|
|
|
|
|
|
return this;
|
|
|
|