Ver código fonte

Material: Remove deprecated FlatShading & SmoothShading constants. (#24424)

* Remove FlatShading & SmoothShading constants

* Remove FlatShading & SmoothShading constants

Co-authored-by: decuyper <[email protected]>
gero3 3 anos atrás
pai
commit
1564abb850

+ 0 - 2
src/constants.js

@@ -12,8 +12,6 @@ export const VSMShadowMap = 3;
 export const FrontSide = 0;
 export const BackSide = 1;
 export const DoubleSide = 2;
-export const FlatShading = 1;
-export const SmoothShading = 2;
 export const NoBlending = 0;
 export const NormalBlending = 1;
 export const AdditiveBlending = 2;

+ 0 - 4
src/loaders/MaterialLoader.js

@@ -237,10 +237,6 @@ class MaterialLoader extends Loader {
 
 		}
 
-		// Deprecated
-
-		if ( json.shading !== undefined ) material.flatShading = json.shading === 1; // THREE.FlatShading
-
 		// for PointsMaterial
 
 		if ( json.size !== undefined ) material.size = json.size;

+ 1 - 10
src/materials/Material.js

@@ -1,5 +1,5 @@
 import { EventDispatcher } from '../core/EventDispatcher.js';
-import { FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, AlwaysStencilFunc, KeepStencilOp } from '../constants.js';
+import { FrontSide, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, AlwaysStencilFunc, KeepStencilOp } from '../constants.js';
 import * as MathUtils from '../math/MathUtils.js';
 
 let materialId = 0;
@@ -122,15 +122,6 @@ class Material extends EventDispatcher {
 
 			}
 
-			// for backward compatibility if shading is set in the constructor
-			if ( key === 'shading' ) {
-
-				console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' );
-				this.flatShading = ( newValue === FlatShading ) ? true : false;
-				continue;
-
-			}
-
 			const currentValue = this[ key ];
 
 			if ( currentValue === undefined ) {

+ 0 - 2
test/unit/src/constants.tests.js

@@ -18,8 +18,6 @@ export default QUnit.module( 'Constants', () => {
 		assert.equal( Constants.FrontSide, 0, 'FrontSide is equal to 0' );
 		assert.equal( Constants.BackSide, 1, 'BackSide is equal to 1' );
 		assert.equal( Constants.DoubleSide, 2, 'DoubleSide is equal to 2' );
-		assert.equal( Constants.FlatShading, 1, 'FlatShading is equal to 1' );
-		assert.equal( Constants.SmoothShading, 2, 'SmoothShading is equal to 2' );
 		assert.equal( Constants.NoBlending, 0, 'NoBlending is equal to 0' );
 		assert.equal( Constants.NormalBlending, 1, 'NormalBlending is equal to 1' );
 		assert.equal( Constants.AdditiveBlending, 2, 'AdditiveBlending is equal to 2' );