Browse Source

Update Material.toJSON

Add missing support for: polygonOffset, polygonOffsetFactor and polygonOffsetUnits .
bGute 7 years ago
parent
commit
b03e9c850b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/materials/Material.js

+ 4 - 0
src/materials/Material.js

@@ -231,6 +231,10 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 		// rotation (SpriteMaterial)
 		if ( 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.dashSize !== undefined ) data.dashSize = this.dashSize;