Просмотр исходного кода

Move envMapIntensity, envMapIntensity, refractionRatio outside of envMap conditional (#21701)

Co-authored-by: Juan Peist <[email protected]>
Juan Peist 4 лет назад
Родитель
Сommit
5a0a094367
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/materials/Material.js

+ 4 - 3
src/materials/Material.js

@@ -249,14 +249,15 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 		if ( this.envMap && this.envMap.isTexture ) {
 
 			data.envMap = this.envMap.toJSON( meta ).uuid;
-			data.reflectivity = this.reflectivity; // Scale behind envMap
-			data.refractionRatio = this.refractionRatio;
 
 			if ( this.combine !== undefined ) data.combine = this.combine;
-			if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
 
 		}
 
+		if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
+		if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;
+		if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;
+
 		if ( this.gradientMap && this.gradientMap.isTexture ) {
 
 			data.gradientMap = this.gradientMap.toJSON( meta ).uuid;