David Catuhe 7 年之前
父节点
当前提交
fa79685e7e
共有 29 个文件被更改,包括 10100 次插入9819 次删除
  1. 1 1
      .vscode/launch.json
  2. 3862 3839
      Playground/babylon.d.txt
  3. 4009 3986
      dist/preview release/babylon.d.ts
  4. 37 37
      dist/preview release/babylon.js
  5. 121 17
      dist/preview release/babylon.max.js
  6. 37 37
      dist/preview release/babylon.worker.js
  7. 1799 1776
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  8. 37 37
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  9. 121 17
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  10. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  11. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  12. 2 24
      dist/preview release/typedocValidationBaseline.json
  13. 38 38
      dist/preview release/viewer/babylon.viewer.js
  14. 13 0
      src/Layer/babylon.highlightlayer.ts
  15. 4 0
      src/PostProcess/babylon.postProcess.ts
  16. 2 2
      src/PostProcess/babylon.volumetricLightScatteringPostProcess.ts
  17. 7 1
      src/babylon.scene.ts
  18. 二进制
      tests/validation/ReferenceImages/Billboard.png
  19. 二进制
      tests/validation/ReferenceImages/DefaultRenderingPipeline.png
  20. 二进制
      tests/validation/ReferenceImages/GUI.png
  21. 二进制
      tests/validation/ReferenceImages/charting.png
  22. 二进制
      tests/validation/ReferenceImages/customRTT.png
  23. 二进制
      tests/validation/ReferenceImages/instancedBones.png
  24. 二进制
      tests/validation/ReferenceImages/lod.png
  25. 二进制
      tests/validation/ReferenceImages/pbrrough.png
  26. 二进制
      tests/validation/ReferenceImages/procedural.png
  27. 二进制
      tests/validation/ReferenceImages/refprobe.png
  28. 3 0
      tests/validation/config.json
  29. 3 3
      tests/validation/karma.conf.js

+ 1 - 1
.vscode/launch.json

@@ -142,7 +142,7 @@
             "name": "Launch Build Validation (Chrome)",
             "type": "chrome",
             "request": "launch",
-            "url": "http://localhost:1338/tests/validation/index.html?Highlights",
+            "url": "http://localhost:1338/tests/validation/index.html?Reflection%20probes",
             "webRoot": "${workspaceRoot}/",
             "sourceMaps": true,
             "preLaunchTask": "run",

文件差异内容过多而无法显示
+ 3862 - 3839
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 4009 - 3986
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 37 - 37
dist/preview release/babylon.js


+ 121 - 17
dist/preview release/babylon.max.js

@@ -17089,7 +17089,7 @@ var BABYLON;
         Object.defineProperty(Light, "LIGHTMAP_SPECULAR", {
             /**
              * material.lightmapTexture as only diffuse lighting from this light
-             * adds pnly specular lighting from this light
+             * adds only specular lighting from this light
              * adds dynamic shadows
              */
             get: function () {
@@ -20758,7 +20758,11 @@ var BABYLON;
             this.onPointerObservable.clear();
             this.onPrePointerObservable.clear();
         };
-        // Ready
+        /**
+         * This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
+         * Delay loaded resources are not taking in account
+         * @return true if all required resources are ready
+         */
         Scene.prototype.isReady = function () {
             if (this._isDisposed) {
                 return false;
@@ -20767,6 +20771,7 @@ var BABYLON;
                 return false;
             }
             var index;
+            var engine = this.getEngine();
             // Geometries
             for (index = 0; index < this._geometries.length; index++) {
                 var geometry = this._geometries[index];
@@ -20786,10 +20791,60 @@ var BABYLON;
                 if (!mesh.isReady()) {
                     return false;
                 }
-                var mat = mesh.material;
+                mesh.computeWorldMatrix();
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh";
+                if (mesh.getClassName() === "Mesh") {
+                    hardwareInstancedRendering = engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                }
+                var mat = mesh.material || this.defaultMaterial;
                 if (mat) {
-                    if (!mat.isReady(mesh)) {
-                        return false;
+                    var currentAlphaTestingState = engine.getAlphaTesting();
+                    if (mat.storeEffectOnSubMeshes) {
+                        for (var _i = 0, _a = mesh.subMeshes; _i < _a.length; _i++) {
+                            var subMesh = _a[_i];
+                            var effectiveMaterial = subMesh.getMaterial();
+                            if (effectiveMaterial) {
+                                engine.setAlphaTesting(effectiveMaterial.needAlphaTesting() && !effectiveMaterial.needAlphaBlendingForMesh(mesh));
+                                if (!effectiveMaterial.isReadyForSubMesh(mesh, subMesh, hardwareInstancedRendering)) {
+                                    engine.setAlphaTesting(currentAlphaTestingState);
+                                    return false;
+                                }
+                            }
+                        }
+                    }
+                    else {
+                        engine.setAlphaTesting(mat.needAlphaTesting() && !mat.needAlphaBlendingForMesh(mesh));
+                        if (!mat.isReady(mesh, hardwareInstancedRendering)) {
+                            engine.setAlphaTesting(currentAlphaTestingState);
+                            return false;
+                        }
+                    }
+                    engine.setAlphaTesting(currentAlphaTestingState);
+                }
+                // Shadows
+                for (var _b = 0, _c = mesh._lightSources; _b < _c.length; _b++) {
+                    var light = _c[_b];
+                    var generator = light.getShadowGenerator();
+                    if (generator) {
+                        for (var _d = 0, _e = mesh.subMeshes; _d < _e.length; _d++) {
+                            var subMesh = _e[_d];
+                            if (!generator.isReady(subMesh, hardwareInstancedRendering)) {
+                                return false;
+                            }
+                        }
+                    }
+                }
+                // Highlight layers
+                for (var _f = 0, _g = this.highlightLayers; _f < _g.length; _f++) {
+                    var layer = _g[_f];
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+                    for (var _h = 0, _j = mesh.subMeshes; _h < _j.length; _h++) {
+                        var subMesh = _j[_h];
+                        if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
                     }
                 }
             }
@@ -53646,6 +53701,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get a value indicating if the post-process is ready to be used
+         * @returns true if the post-process is ready (shader is compiled)
+         */
+        PostProcess.prototype.isReady = function () {
+            return this._effect && this._effect.isReady();
+        };
         PostProcess.prototype.apply = function () {
             // Check
             if (!this._effect || !this._effect.isReady())
@@ -54165,9 +54227,6 @@ var BABYLON;
                 if (!_this.useBlurExponentialShadowMap && !_this.useBlurCloseExponentialShadowMap) {
                     return;
                 }
-                if (!_this._blurPostProcesses || !_this._blurPostProcesses.length) {
-                    _this._initializeBlurRTTAndPostProcesses();
-                }
                 var shadowMap = _this.getShadowMapForRendering();
                 if (shadowMap) {
                     _this._scene.postProcessManager.directRender(_this._blurPostProcesses, shadowMap.getInternalTexture(), true);
@@ -54414,7 +54473,24 @@ var BABYLON;
                 this._cachedDefines = join;
                 this._effect = this._scene.getEngine().createEffect("shadowMap", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "lightPosition", "depthValues", "biasAndScale"], ["diffuseSampler"], join);
             }
-            return this._effect.isReady();
+            if (!this._effect.isReady()) {
+                return false;
+            }
+            if (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {
+                if (!this._blurPostProcesses || !this._blurPostProcesses.length) {
+                    this._initializeBlurRTTAndPostProcesses();
+                }
+            }
+            if (this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) {
+                return false;
+            }
+            if (this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) {
+                return false;
+            }
+            if (this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()) {
+                return false;
+            }
+            return true;
         };
         /**
          * This creates the defines related to the standard BJS materials.
@@ -54521,10 +54597,6 @@ var BABYLON;
                 this._shadowMap2.dispose();
                 this._shadowMap2 = null;
             }
-            if (this._downSamplePostprocess) {
-                this._downSamplePostprocess.dispose();
-                this._downSamplePostprocess = null;
-            }
             if (this._boxBlurPostprocess) {
                 this._boxBlurPostprocess.dispose();
                 this._boxBlurPostprocess = null;
@@ -62757,7 +62829,7 @@ var BABYLON;
         VolumetricLightScatteringPostProcess.prototype.getClassName = function () {
             return "VolumetricLightScatteringPostProcess";
         };
-        VolumetricLightScatteringPostProcess.prototype.isReady = function (subMesh, useInstances) {
+        VolumetricLightScatteringPostProcess.prototype._isReady = function (subMesh, useInstances) {
             var mesh = subMesh.getMesh();
             // Render this.mesh as default
             if (mesh === this.mesh && mesh.material) {
@@ -62880,7 +62952,7 @@ var BABYLON;
                     return;
                 }
                 var hardwareInstancedRendering = (engine.getCaps().instancedArrays) && (batch.visibleInstances[subMesh._id] !== null);
-                if (_this.isReady(subMesh, hardwareInstancedRendering)) {
+                if (_this._isReady(subMesh, hardwareInstancedRendering)) {
                     var effect = _this._volumetricLightScatteringPass;
                     if (mesh === _this.mesh) {
                         if (subMesh.effect) {
@@ -77001,6 +77073,7 @@ var BABYLON;
             }
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function () {
+                _this._sceneDisposeObserver = null;
                 _this.dispose();
             });
         }
@@ -77837,7 +77910,7 @@ var BABYLON;
                 if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
                     emissiveTexture = material.emissiveTexture;
                 }
-                if (_this.isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
+                if (_this._isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
                     engine.enableEffect(_this._glowMapGenerationEffect);
                     mesh._bind(subMesh, _this._glowMapGenerationEffect, BABYLON.Material.TriangleFillMode);
                     _this._glowMapGenerationEffect.setMatrix("viewProjection", scene.getTransformMatrix());
@@ -77907,7 +77980,27 @@ var BABYLON;
          * @param emissiveTexture the associated emissive texture used to generate the glow
          * @return true if ready otherwise, false
          */
-        HighlightLayer.prototype.isReady = function (subMesh, useInstances, emissiveTexture) {
+        HighlightLayer.prototype.isReady = function (subMesh, useInstances) {
+            var material = subMesh.getMaterial();
+            var mesh = subMesh.getRenderingMesh();
+            if (!material || !mesh || !this._meshes) {
+                return false;
+            }
+            var emissiveTexture = null;
+            var highlightLayerMesh = this._meshes[mesh.uniqueId];
+            if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
+                emissiveTexture = material.emissiveTexture;
+            }
+            return this._isReady(subMesh, useInstances, emissiveTexture);
+        };
+        /**
+         * Checks for the readiness of the element composing the layer.
+         * @param subMesh the mesh to check for
+         * @param useInstances specify wether or not to use instances to render the mesh
+         * @param emissiveTexture the associated emissive texture used to generate the glow
+         * @return true if ready otherwise, false
+         */
+        HighlightLayer.prototype._isReady = function (subMesh, useInstances, emissiveTexture) {
             var material = subMesh.getMaterial();
             if (!material) {
                 return false;
@@ -78092,6 +78185,17 @@ var BABYLON;
             this._excludedMeshes[mesh.uniqueId] = null;
         };
         /**
+         * Determine if a given mesh will be highlighted by the current HighlightLayer
+         * @param mesh mesh to test
+         * @returns true if the mesh will be highlighted by the current HighlightLayer
+         */
+        HighlightLayer.prototype.hasMesh = function (mesh) {
+            if (!this._meshes) {
+                return false;
+            }
+            return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;
+        };
+        /**
          * Add a mesh in the highlight layer in order to make it glow with the chosen color.
          * @param mesh The mesh to highlight
          * @param color The color of the highlight

文件差异内容过多而无法显示
+ 37 - 37
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 1799 - 1776
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


文件差异内容过多而无法显示
+ 37 - 37
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 121 - 17
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -17089,7 +17089,7 @@ var BABYLON;
         Object.defineProperty(Light, "LIGHTMAP_SPECULAR", {
             /**
              * material.lightmapTexture as only diffuse lighting from this light
-             * adds pnly specular lighting from this light
+             * adds only specular lighting from this light
              * adds dynamic shadows
              */
             get: function () {
@@ -20758,7 +20758,11 @@ var BABYLON;
             this.onPointerObservable.clear();
             this.onPrePointerObservable.clear();
         };
-        // Ready
+        /**
+         * This function will check if the scene can be rendered (textures are loaded, shaders are compiled)
+         * Delay loaded resources are not taking in account
+         * @return true if all required resources are ready
+         */
         Scene.prototype.isReady = function () {
             if (this._isDisposed) {
                 return false;
@@ -20767,6 +20771,7 @@ var BABYLON;
                 return false;
             }
             var index;
+            var engine = this.getEngine();
             // Geometries
             for (index = 0; index < this._geometries.length; index++) {
                 var geometry = this._geometries[index];
@@ -20786,10 +20791,60 @@ var BABYLON;
                 if (!mesh.isReady()) {
                     return false;
                 }
-                var mat = mesh.material;
+                mesh.computeWorldMatrix();
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh";
+                if (mesh.getClassName() === "Mesh") {
+                    hardwareInstancedRendering = engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                }
+                var mat = mesh.material || this.defaultMaterial;
                 if (mat) {
-                    if (!mat.isReady(mesh)) {
-                        return false;
+                    var currentAlphaTestingState = engine.getAlphaTesting();
+                    if (mat.storeEffectOnSubMeshes) {
+                        for (var _i = 0, _a = mesh.subMeshes; _i < _a.length; _i++) {
+                            var subMesh = _a[_i];
+                            var effectiveMaterial = subMesh.getMaterial();
+                            if (effectiveMaterial) {
+                                engine.setAlphaTesting(effectiveMaterial.needAlphaTesting() && !effectiveMaterial.needAlphaBlendingForMesh(mesh));
+                                if (!effectiveMaterial.isReadyForSubMesh(mesh, subMesh, hardwareInstancedRendering)) {
+                                    engine.setAlphaTesting(currentAlphaTestingState);
+                                    return false;
+                                }
+                            }
+                        }
+                    }
+                    else {
+                        engine.setAlphaTesting(mat.needAlphaTesting() && !mat.needAlphaBlendingForMesh(mesh));
+                        if (!mat.isReady(mesh, hardwareInstancedRendering)) {
+                            engine.setAlphaTesting(currentAlphaTestingState);
+                            return false;
+                        }
+                    }
+                    engine.setAlphaTesting(currentAlphaTestingState);
+                }
+                // Shadows
+                for (var _b = 0, _c = mesh._lightSources; _b < _c.length; _b++) {
+                    var light = _c[_b];
+                    var generator = light.getShadowGenerator();
+                    if (generator) {
+                        for (var _d = 0, _e = mesh.subMeshes; _d < _e.length; _d++) {
+                            var subMesh = _e[_d];
+                            if (!generator.isReady(subMesh, hardwareInstancedRendering)) {
+                                return false;
+                            }
+                        }
+                    }
+                }
+                // Highlight layers
+                for (var _f = 0, _g = this.highlightLayers; _f < _g.length; _f++) {
+                    var layer = _g[_f];
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+                    for (var _h = 0, _j = mesh.subMeshes; _h < _j.length; _h++) {
+                        var subMesh = _j[_h];
+                        if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
                     }
                 }
             }
@@ -53492,6 +53547,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get a value indicating if the post-process is ready to be used
+         * @returns true if the post-process is ready (shader is compiled)
+         */
+        PostProcess.prototype.isReady = function () {
+            return this._effect && this._effect.isReady();
+        };
         PostProcess.prototype.apply = function () {
             // Check
             if (!this._effect || !this._effect.isReady())
@@ -54011,9 +54073,6 @@ var BABYLON;
                 if (!_this.useBlurExponentialShadowMap && !_this.useBlurCloseExponentialShadowMap) {
                     return;
                 }
-                if (!_this._blurPostProcesses || !_this._blurPostProcesses.length) {
-                    _this._initializeBlurRTTAndPostProcesses();
-                }
                 var shadowMap = _this.getShadowMapForRendering();
                 if (shadowMap) {
                     _this._scene.postProcessManager.directRender(_this._blurPostProcesses, shadowMap.getInternalTexture(), true);
@@ -54260,7 +54319,24 @@ var BABYLON;
                 this._cachedDefines = join;
                 this._effect = this._scene.getEngine().createEffect("shadowMap", attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "lightPosition", "depthValues", "biasAndScale"], ["diffuseSampler"], join);
             }
-            return this._effect.isReady();
+            if (!this._effect.isReady()) {
+                return false;
+            }
+            if (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) {
+                if (!this._blurPostProcesses || !this._blurPostProcesses.length) {
+                    this._initializeBlurRTTAndPostProcesses();
+                }
+            }
+            if (this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) {
+                return false;
+            }
+            if (this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) {
+                return false;
+            }
+            if (this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady()) {
+                return false;
+            }
+            return true;
         };
         /**
          * This creates the defines related to the standard BJS materials.
@@ -54367,10 +54443,6 @@ var BABYLON;
                 this._shadowMap2.dispose();
                 this._shadowMap2 = null;
             }
-            if (this._downSamplePostprocess) {
-                this._downSamplePostprocess.dispose();
-                this._downSamplePostprocess = null;
-            }
             if (this._boxBlurPostprocess) {
                 this._boxBlurPostprocess.dispose();
                 this._boxBlurPostprocess = null;
@@ -62603,7 +62675,7 @@ var BABYLON;
         VolumetricLightScatteringPostProcess.prototype.getClassName = function () {
             return "VolumetricLightScatteringPostProcess";
         };
-        VolumetricLightScatteringPostProcess.prototype.isReady = function (subMesh, useInstances) {
+        VolumetricLightScatteringPostProcess.prototype._isReady = function (subMesh, useInstances) {
             var mesh = subMesh.getMesh();
             // Render this.mesh as default
             if (mesh === this.mesh && mesh.material) {
@@ -62726,7 +62798,7 @@ var BABYLON;
                     return;
                 }
                 var hardwareInstancedRendering = (engine.getCaps().instancedArrays) && (batch.visibleInstances[subMesh._id] !== null);
-                if (_this.isReady(subMesh, hardwareInstancedRendering)) {
+                if (_this._isReady(subMesh, hardwareInstancedRendering)) {
                     var effect = _this._volumetricLightScatteringPass;
                     if (mesh === _this.mesh) {
                         if (subMesh.effect) {
@@ -76847,6 +76919,7 @@ var BABYLON;
             }
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function () {
+                _this._sceneDisposeObserver = null;
                 _this.dispose();
             });
         }
@@ -77683,7 +77756,7 @@ var BABYLON;
                 if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
                     emissiveTexture = material.emissiveTexture;
                 }
-                if (_this.isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
+                if (_this._isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
                     engine.enableEffect(_this._glowMapGenerationEffect);
                     mesh._bind(subMesh, _this._glowMapGenerationEffect, BABYLON.Material.TriangleFillMode);
                     _this._glowMapGenerationEffect.setMatrix("viewProjection", scene.getTransformMatrix());
@@ -77753,7 +77826,27 @@ var BABYLON;
          * @param emissiveTexture the associated emissive texture used to generate the glow
          * @return true if ready otherwise, false
          */
-        HighlightLayer.prototype.isReady = function (subMesh, useInstances, emissiveTexture) {
+        HighlightLayer.prototype.isReady = function (subMesh, useInstances) {
+            var material = subMesh.getMaterial();
+            var mesh = subMesh.getRenderingMesh();
+            if (!material || !mesh || !this._meshes) {
+                return false;
+            }
+            var emissiveTexture = null;
+            var highlightLayerMesh = this._meshes[mesh.uniqueId];
+            if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
+                emissiveTexture = material.emissiveTexture;
+            }
+            return this._isReady(subMesh, useInstances, emissiveTexture);
+        };
+        /**
+         * Checks for the readiness of the element composing the layer.
+         * @param subMesh the mesh to check for
+         * @param useInstances specify wether or not to use instances to render the mesh
+         * @param emissiveTexture the associated emissive texture used to generate the glow
+         * @return true if ready otherwise, false
+         */
+        HighlightLayer.prototype._isReady = function (subMesh, useInstances, emissiveTexture) {
             var material = subMesh.getMaterial();
             if (!material) {
                 return false;
@@ -77938,6 +78031,17 @@ var BABYLON;
             this._excludedMeshes[mesh.uniqueId] = null;
         };
         /**
+         * Determine if a given mesh will be highlighted by the current HighlightLayer
+         * @param mesh mesh to test
+         * @returns true if the mesh will be highlighted by the current HighlightLayer
+         */
+        HighlightLayer.prototype.hasMesh = function (mesh) {
+            if (!this._meshes) {
+                return false;
+            }
+            return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;
+        };
+        /**
          * Add a mesh in the highlight layer in order to make it glow with the chosen color.
          * @param mesh The mesh to highlight
          * @param color The color of the highlight

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


文件差异内容过多而无法显示
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 2 - 24
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 11187,
+  "errors": 11183,
   "babylon.typedoc.json": {
-    "errors": 11187,
+    "errors": 11183,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {
@@ -43197,11 +43197,6 @@
             "MissingText": true
           }
         },
-        "isReady": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
         "markAllMaterialsAsDirty": {
           "Parameter": {
             "flag": {
@@ -58064,23 +58059,6 @@
             "MissingText": true
           }
         },
-        "isReady": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "subMesh": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "useInstances": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
         "setCustomMeshPosition": {
           "Parameter": {
             "position": {

文件差异内容过多而无法显示
+ 38 - 38
dist/preview release/viewer/babylon.viewer.js


+ 13 - 0
src/Layer/babylon.highlightlayer.ts

@@ -794,6 +794,19 @@
         }
 
         /**
+         * Determine if a given mesh will be highlighted by the current HighlightLayer
+         * @param mesh mesh to test
+         * @returns true if the mesh will be highlighted by the current HighlightLayer
+         */
+        public hasMesh(mesh: AbstractMesh): boolean {
+            if (!this._meshes) {
+                return false;
+            }
+
+            return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;
+        }
+
+        /**
          * Add a mesh in the highlight layer in order to make it glow with the chosen color.
          * @param mesh The mesh to highlight
          * @param color The color of the highlight

+ 4 - 0
src/PostProcess/babylon.postProcess.ts

@@ -334,6 +334,10 @@
             return this.width / this.height;
         }
 
+        /**
+         * Get a value indicating if the post-process is ready to be used
+         * @returns true if the post-process is ready (shader is compiled)
+         */
         public isReady(): boolean {
             return this._effect && this._effect.isReady();
         }

+ 2 - 2
src/PostProcess/babylon.volumetricLightScatteringPostProcess.ts

@@ -135,7 +135,7 @@
             return "VolumetricLightScatteringPostProcess";
         }
 
-        public isReady(subMesh: SubMesh, useInstances: boolean): boolean {
+        private _isReady(subMesh: SubMesh, useInstances: boolean): boolean {
             var mesh = subMesh.getMesh();
 
             // Render this.mesh as default
@@ -287,7 +287,7 @@
 
                 var hardwareInstancedRendering = (engine.getCaps().instancedArrays) && (batch.visibleInstances[subMesh._id] !== null);
 
-                if (this.isReady(subMesh, hardwareInstancedRendering)) {
+                if (this._isReady(subMesh, hardwareInstancedRendering)) {
                     var effect: Effect = this._volumetricLightScatteringPass;
                     if (mesh === this.mesh) {
                         if (subMesh.effect) {

+ 7 - 1
src/babylon.scene.ts

@@ -1896,7 +1896,9 @@
                     return false;
                 }
 
-                let hardwareInstancedRendering = false;
+                mesh.computeWorldMatrix();
+
+                let hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh";
                 if (mesh.getClassName() === "Mesh") {
                     hardwareInstancedRendering = engine.getCaps().instancedArrays && (<Mesh>mesh).instances.length > 0;
                 }
@@ -1942,6 +1944,10 @@
 
                 // Highlight layers
                 for (var layer of this.highlightLayers) {
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+
                     for (var subMesh of mesh.subMeshes) {
                         if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
                             return false;

二进制
tests/validation/ReferenceImages/Billboard.png


二进制
tests/validation/ReferenceImages/DefaultRenderingPipeline.png


二进制
tests/validation/ReferenceImages/GUI.png


二进制
tests/validation/ReferenceImages/charting.png


二进制
tests/validation/ReferenceImages/customRTT.png


二进制
tests/validation/ReferenceImages/instancedBones.png


二进制
tests/validation/ReferenceImages/lod.png


二进制
tests/validation/ReferenceImages/pbrrough.png


二进制
tests/validation/ReferenceImages/procedural.png


二进制
tests/validation/ReferenceImages/refprobe.png


+ 3 - 0
tests/validation/config.json

@@ -175,6 +175,7 @@
     },
     {
       "title": "Custom render target",
+      "renderCount": 20,
       "scriptToRun": "/Demos/CustomRenderTarget/customRenderTarget.js",
       "functionToCall": "CreateCustomRenderTargetTestScene",
       "referenceImage": "customRTT.png"
@@ -255,6 +256,7 @@
     },
     {
       "title": "Reflection probes",
+      "renderCount": 20,
       "scriptToRun": "/Demos/RefProbe/reflectionProbe.js",
       "functionToCall": "CreateReflectionProbeTestScene ",
       "referenceImage": "refprobe.png"
@@ -276,6 +278,7 @@
     },
     {
       "title": "MultiSample render targets",
+      "renderCount": 20,
       "playgroundId": "#12MKMN#0",
       "referenceImage": "MultiSample render targets.png"
     },

+ 3 - 3
tests/validation/karma.conf.js

@@ -24,14 +24,14 @@ module.exports = function (config) {
             { pattern: 'Playground/scenes/**/*', watched: false, included: false, served: true },
             { pattern: 'Playground/textures/**/*', watched: false, included: false, served: true },
             { pattern: 'Playground/sounds/**/*', watched: false, included: false, served: true },
-            { pattern: 'Tools/DevLoader/**/*', watched: false, included: false, served: true },            
+            { pattern: 'Tools/DevLoader/**/*', watched: false, included: false, served: true },
             { pattern: 'Tools/Gulp/config.json', watched: false, included: false, served: true },
         ],
         proxies: {
             '/': '/base/'
         },
-        
-        port: 1338,
+
+        port: 3000,
         colors: true,
         autoWatch: false,
         singleRun: false,