Browse Source

update Material.json and add `stencilMask` to THREE.legacy

Garrett Johnson 6 years ago
parent
commit
59e227d251
2 changed files with 17 additions and 19 deletions
  1. 15 0
      src/Three.Legacy.js
  2. 2 19
      src/materials/Material.js

+ 15 - 0
src/Three.Legacy.js

@@ -1311,6 +1311,21 @@ Object.defineProperties( Material.prototype, {
 			console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
 			console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
 			this.flatShading = ( value === FlatShading );
 			this.flatShading = ( value === FlatShading );
 
 
+		}
+	},
+
+	stencilMask: {
+		get: function () {
+
+			console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
+			return this.stencilFuncMask;
+
+		},
+		set: function ( value ) {
+
+			console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' );
+			this.stencilFuncMask = value;
+
 		}
 		}
 	}
 	}
 
 

+ 2 - 19
src/materials/Material.js

@@ -50,24 +50,6 @@ function Material() {
 	this.stencilZPass = KeepStencilOp;
 	this.stencilZPass = KeepStencilOp;
 	this.stencilWrite = false;
 	this.stencilWrite = false;
 
 
-	Object.defineProperty( this, 'stencilMask', {
-
-		set: function ( value ) {
-
-			console.warn( 'Material.stencilMask has been removed. Use Material.stencilFuncMask instead.' );
-			this.stencilFuncMask = value;
-
-		},
-
-		get: function () {
-
-			console.warn( 'Material.stencilMask has been removed. Use Material.stencilFuncMask instead.' );
-			return this.stencilFuncMask;
-
-		}
-
-	} );
-
 	this.clippingPlanes = null;
 	this.clippingPlanes = null;
 	this.clipIntersection = false;
 	this.clipIntersection = false;
 	this.clipShadows = false;
 	this.clipShadows = false;
@@ -277,9 +259,10 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		data.depthWrite = this.depthWrite;
 		data.depthWrite = this.depthWrite;
 
 
 		data.stencilWrite = this.stencilWrite;
 		data.stencilWrite = this.stencilWrite;
+		data.stencilWriteMask = this.stencilWriteMask;
 		data.stencilFunc = this.stencilFunc;
 		data.stencilFunc = this.stencilFunc;
 		data.stencilRef = this.stencilRef;
 		data.stencilRef = this.stencilRef;
-		data.stencilMask = this.stencilMask;
+		data.stencilFuncMask = this.stencilFuncMask;
 		data.stencilFail = this.stencilFail;
 		data.stencilFail = this.stencilFail;
 		data.stencilZFail = this.stencilZFail;
 		data.stencilZFail = this.stencilZFail;
 		data.stencilZPass = this.stencilZPass;
 		data.stencilZPass = this.stencilZPass;