David Catuhe 7 лет назад
Родитель
Сommit
0647e7d46d

Разница между файлами не показана из-за своего большого размера
+ 5325 - 5325
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 5 - 5
dist/preview release/babylon.js


+ 32 - 13
dist/preview release/babylon.max.js

@@ -17335,6 +17335,9 @@ var BABYLON;
              * this is easier to set here than in all the materials.
              */
             set: function (value) {
+                if (this._environmentTexture === value) {
+                    return;
+                }
                 this._environmentTexture = value;
                 this.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
             },
@@ -32762,8 +32765,8 @@ var BABYLON;
             _this.MORPHTARGETS_NORMAL = false;
             _this.MORPHTARGETS_TANGENT = false;
             _this.NUM_MORPH_INFLUENCERS = 0;
-            _this.NONUNIFORMSCALING = false;
-            _this.PREMULTIPLYALPHA = false;
+            _this.NONUNIFORMSCALING = false; // https://playground.babylonjs.com#V6DWIH
+            _this.PREMULTIPLYALPHA = false; // https://playground.babylonjs.com#LNVJJ7
             _this.IMAGEPROCESSING = false;
             _this.VIGNETTE = false;
             _this.VIGNETTEBLENDMODEMULTIPLY = false;
@@ -34734,25 +34737,31 @@ var BABYLON;
                         }
                         defines.ENVIRONMENTBRDF = true;
                     }
+                    else {
+                        defines.ENVIRONMENTBRDF = false;
+                    }
                     if (this._shouldUseAlphaFromAlbedoTexture()) {
                         defines.ALPHAFROMALBEDO = true;
                     }
+                    else {
+                        defines.ALPHAFROMALBEDO = false;
+                    }
                 }
-                if (this._useSpecularOverAlpha) {
-                    defines.SPECULAROVERALPHA = true;
-                }
-                if (this._usePhysicalLightFalloff) {
-                    defines.USEPHYSICALLIGHTFALLOFF = true;
-                }
-                if (this._useRadianceOverAlpha) {
-                    defines.RADIANCEOVERALPHA = true;
-                }
+                defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
+                defines.USEPHYSICALLIGHTFALLOFF = this._usePhysicalLightFalloff;
+                defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
                 if ((this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
                     defines.METALLICWORKFLOW = true;
                 }
+                else {
+                    defines.METALLICWORKFLOW = false;
+                }
                 if (!this.backFaceCulling && this._twoSidedLighting) {
                     defines.TWOSIDEDLIGHTING = true;
                 }
+                else {
+                    defines.TWOSIDEDLIGHTING = false;
+                }
                 defines.ALPHATESTVALUE = this._alphaCutOff;
                 defines.PREMULTIPLYALPHA = (this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF);
                 defines.ALPHABLEND = this.needAlphaBlending();
@@ -45690,6 +45699,7 @@ var BABYLON;
          * Returns the Mesh.
          */
         InstancedMesh.prototype.setIndices = function (indices, totalVertices) {
+            if (totalVertices === void 0) { totalVertices = null; }
             if (this.sourceMesh) {
                 this.sourceMesh.setIndices(indices, totalVertices);
             }
@@ -45720,7 +45730,9 @@ var BABYLON;
          */
         InstancedMesh.prototype.refreshBoundingInfo = function () {
             var meshBB = this._sourceMesh.getBoundingInfo();
-            this._boundingInfo = new BABYLON.BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            if (meshBB) {
+                this._boundingInfo = new BABYLON.BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            }
             this._updateBoundingInfo();
             return this;
         };
@@ -45740,7 +45752,14 @@ var BABYLON;
          * Returns the current associated LOD AbstractMesh.
          */
         InstancedMesh.prototype.getLOD = function (camera) {
-            this._currentLOD = this.sourceMesh.getLOD(this.getScene().activeCamera, this.getBoundingInfo().boundingSphere);
+            if (!camera) {
+                return this;
+            }
+            var boundingInfo = this.getBoundingInfo();
+            if (!boundingInfo) {
+                return this;
+            }
+            this._currentLOD = this.sourceMesh.getLOD(camera, boundingInfo.boundingSphere);
             if (this._currentLOD === this.sourceMesh) {
                 return this;
             }

Разница между файлами не показана из-за своего большого размера
+ 5325 - 5325
dist/preview release/babylon.module.d.ts


Разница между файлами не показана из-за своего большого размера
+ 5 - 5
dist/preview release/babylon.worker.js


Разница между файлами не показана из-за своего большого размера
+ 3555 - 3555
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 5 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 31 - 12
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -17335,6 +17335,9 @@ var BABYLON;
              * this is easier to set here than in all the materials.
              */
             set: function (value) {
+                if (this._environmentTexture === value) {
+                    return;
+                }
                 this._environmentTexture = value;
                 this.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag);
             },
@@ -32763,7 +32766,7 @@ var BABYLON;
             _this.MORPHTARGETS_TANGENT = false;
             _this.NUM_MORPH_INFLUENCERS = 0;
             _this.NONUNIFORMSCALING = false; // https://playground.babylonjs.com#V6DWIH
-            _this.PREMULTIPLYALPHA = false;
+            _this.PREMULTIPLYALPHA = false; // https://playground.babylonjs.com#LNVJJ7
             _this.IMAGEPROCESSING = false;
             _this.VIGNETTE = false;
             _this.VIGNETTEBLENDMODEMULTIPLY = false;
@@ -34734,25 +34737,31 @@ var BABYLON;
                         }
                         defines.ENVIRONMENTBRDF = true;
                     }
+                    else {
+                        defines.ENVIRONMENTBRDF = false;
+                    }
                     if (this._shouldUseAlphaFromAlbedoTexture()) {
                         defines.ALPHAFROMALBEDO = true;
                     }
+                    else {
+                        defines.ALPHAFROMALBEDO = false;
+                    }
                 }
-                if (this._useSpecularOverAlpha) {
-                    defines.SPECULAROVERALPHA = true;
-                }
-                if (this._usePhysicalLightFalloff) {
-                    defines.USEPHYSICALLIGHTFALLOFF = true;
-                }
-                if (this._useRadianceOverAlpha) {
-                    defines.RADIANCEOVERALPHA = true;
-                }
+                defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
+                defines.USEPHYSICALLIGHTFALLOFF = this._usePhysicalLightFalloff;
+                defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
                 if ((this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
                     defines.METALLICWORKFLOW = true;
                 }
+                else {
+                    defines.METALLICWORKFLOW = false;
+                }
                 if (!this.backFaceCulling && this._twoSidedLighting) {
                     defines.TWOSIDEDLIGHTING = true;
                 }
+                else {
+                    defines.TWOSIDEDLIGHTING = false;
+                }
                 defines.ALPHATESTVALUE = this._alphaCutOff;
                 defines.PREMULTIPLYALPHA = (this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED || this.alphaMode === BABYLON.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF);
                 defines.ALPHABLEND = this.needAlphaBlending();
@@ -45690,6 +45699,7 @@ var BABYLON;
          * Returns the Mesh.
          */
         InstancedMesh.prototype.setIndices = function (indices, totalVertices) {
+            if (totalVertices === void 0) { totalVertices = null; }
             if (this.sourceMesh) {
                 this.sourceMesh.setIndices(indices, totalVertices);
             }
@@ -45720,7 +45730,9 @@ var BABYLON;
          */
         InstancedMesh.prototype.refreshBoundingInfo = function () {
             var meshBB = this._sourceMesh.getBoundingInfo();
-            this._boundingInfo = new BABYLON.BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            if (meshBB) {
+                this._boundingInfo = new BABYLON.BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            }
             this._updateBoundingInfo();
             return this;
         };
@@ -45740,7 +45752,14 @@ var BABYLON;
          * Returns the current associated LOD AbstractMesh.
          */
         InstancedMesh.prototype.getLOD = function (camera) {
-            this._currentLOD = this.sourceMesh.getLOD(this.getScene().activeCamera, this.getBoundingInfo().boundingSphere);
+            if (!camera) {
+                return this;
+            }
+            var boundingInfo = this.getBoundingInfo();
+            if (!boundingInfo) {
+                return this;
+            }
+            this._currentLOD = this.sourceMesh.getLOD(camera, boundingInfo.boundingSphere);
             if (this._currentLOD === this.sourceMesh) {
                 return this;
             }

Разница между файлами не показана из-за своего большого размера
+ 3555 - 3555
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 12 - 9
src/Materials/PBR/babylon.pbrBaseMaterial.ts

@@ -761,31 +761,34 @@
                             return false;
                         }
                         defines.ENVIRONMENTBRDF = true;
+                    } else {
+                        defines.ENVIRONMENTBRDF = false;
                     }
 
                     if (this._shouldUseAlphaFromAlbedoTexture()) {
                         defines.ALPHAFROMALBEDO = true;
+                    } else {
+                        defines.ALPHAFROMALBEDO = false;
                     }
-                }
 
-                if (this._useSpecularOverAlpha) {
-                    defines.SPECULAROVERALPHA = true;
                 }
 
-                if (this._usePhysicalLightFalloff) {
-                    defines.USEPHYSICALLIGHTFALLOFF = true;
-                }
+                defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
 
-                if (this._useRadianceOverAlpha) {
-                    defines.RADIANCEOVERALPHA = true;
-                }
+                defines.USEPHYSICALLIGHTFALLOFF = this._usePhysicalLightFalloff;
+
+                defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
 
                 if ((this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
                     defines.METALLICWORKFLOW = true;
+                } else {
+                    defines.METALLICWORKFLOW = false;
                 }
 
                 if (!this.backFaceCulling && this._twoSidedLighting) {
                     defines.TWOSIDEDLIGHTING = true;
+                } else {
+                    defines.TWOSIDEDLIGHTING = false;
                 }
 
                 defines.ALPHATESTVALUE = this._alphaCutOff;

+ 16 - 4
src/Mesh/babylon.instancedMesh.ts

@@ -50,7 +50,7 @@
             return this._sourceMesh.visibility;
         }
 
-        public get skeleton(): Skeleton {
+        public get skeleton(): Nullable<Skeleton> {
             return this._sourceMesh.skeleton;
         }
 
@@ -146,7 +146,7 @@
          * This method creates a new index buffer each call.  
          * Returns the Mesh.  
          */
-        public setIndices(indices: IndicesArray, totalVertices?: number): Mesh {
+        public setIndices(indices: IndicesArray, totalVertices: Nullable<number> = null): Mesh {
             if (this.sourceMesh) {
                this.sourceMesh.setIndices(indices, totalVertices);
             }
@@ -178,7 +178,9 @@
         public refreshBoundingInfo(): InstancedMesh {
             var meshBB = this._sourceMesh.getBoundingInfo();
 
-            this._boundingInfo = new BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            if (meshBB) {
+                this._boundingInfo = new BoundingInfo(meshBB.minimum.clone(), meshBB.maximum.clone());
+            }
 
             this._updateBoundingInfo();
             return this;
@@ -202,7 +204,17 @@
          * Returns the current associated LOD AbstractMesh.  
          */
         public getLOD(camera: Camera): AbstractMesh {
-            this._currentLOD = <Mesh>this.sourceMesh.getLOD(this.getScene().activeCamera, this.getBoundingInfo().boundingSphere);
+            if (!camera) {
+                return this;
+            }
+
+            let boundingInfo = this.getBoundingInfo();
+
+            if (!boundingInfo) {
+                return this;
+            }
+
+            this._currentLOD = <Mesh>this.sourceMesh.getLOD(camera, boundingInfo.boundingSphere);
 
             if (this._currentLOD === this.sourceMesh) {
                 return this;

+ 4 - 0
src/babylon.scene.ts

@@ -144,6 +144,10 @@
          * this is easier to set here than in all the materials.
          */
         public set environmentTexture(value: BaseTexture) {
+            if (this._environmentTexture === value) {
+                return;
+            }
+            
             this._environmentTexture = value;
             this.markAllMaterialsAsDirty(Material.TextureDirtyFlag);
         }