Bläddra i källkod

Add stencil parameters to copy and toJSON functions

Garrett Johnson 6 år sedan
förälder
incheckning
0dc880eade
1 ändrade filer med 16 tillägg och 0 borttagningar
  1. 16 0
      src/materials/Material.js

+ 16 - 0
src/materials/Material.js

@@ -245,6 +245,14 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		data.depthTest = this.depthTest;
 		data.depthWrite = this.depthWrite;
 
+		data.stencilWrite = this.stencilWrite;
+		data.stencilFunc = this.stencilFunc;
+		data.stencilRef = this.stencilRef;
+		data.stencilMask = this.stencilMask;
+		data.stencilFail = this.stencilFail;
+		data.stencilZFail = this.stencilZFail;
+		data.stencilZPass = this.stencilZPass;
+
 		// rotation (SpriteMaterial)
 		if ( this.rotation !== 0 ) data.rotation = this.rotation;
 
@@ -337,6 +345,14 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		this.depthTest = source.depthTest;
 		this.depthWrite = source.depthWrite;
 
+		this.stencilWrite = source.stencilWrite;
+		this.stencilFunc = source.stencilFunc;
+		this.stencilRef = source.stencilRef;
+		this.stencilMask = source.stencilMask;
+		this.stencilFail = source.stencilFail;
+		this.stencilZFail = source.stencilZFail;
+		this.stencilZPass = source.stencilZPass;
+
 		this.colorWrite = source.colorWrite;
 
 		this.precision = source.precision;