Browse Source

LightShadow: Added normalOffset to toJSON()

Mr.doob 5 years ago
parent
commit
181e5500bf
2 changed files with 2 additions and 0 deletions
  1. 1 0
      src/lights/LightShadow.js
  2. 1 0
      src/loaders/ObjectLoader.js

+ 1 - 0
src/lights/LightShadow.js

@@ -121,6 +121,7 @@ Object.assign( LightShadow.prototype, {
 		const object = {};
 		const object = {};
 
 
 		if ( this.bias !== 0 ) object.bias = this.bias;
 		if ( this.bias !== 0 ) object.bias = this.bias;
+		if ( this.normalOffset !== 0 ) object.normalOffset = this.normalOffset;
 		if ( this.radius !== 1 ) object.radius = this.radius;
 		if ( this.radius !== 1 ) object.radius = this.radius;
 		if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();
 		if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();
 
 

+ 1 - 0
src/loaders/ObjectLoader.js

@@ -928,6 +928,7 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		if ( data.shadow ) {
 		if ( data.shadow ) {
 
 
 			if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;
 			if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;
+			if ( data.shadow.normalOffset !== undefined ) object.shadow.normalOffset = data.shadow.normalOffset;
 			if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;
 			if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;
 			if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );
 			if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );
 			if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );
 			if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );