فهرست منبع

Merge pull request #3538 from BabylonJS/isReadyFix

Fix scene.isReady
sebavan 7 سال پیش
والد
کامیت
0a328c8c12
44فایلهای تغییر یافته به همراه26196 افزوده شده و 25765 حذف شده
  1. 7 5
      .vscode/launch.json
  2. 7678 7648
      Playground/babylon.d.txt
  3. 10440 10410
      dist/preview release/babylon.d.ts
  4. 37 37
      dist/preview release/babylon.js
  5. 149 22
      dist/preview release/babylon.max.js
  6. 37 37
      dist/preview release/babylon.worker.js
  7. 7427 7397
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  8. 37 37
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  9. 149 22
      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 29
      dist/preview release/typedocValidationBaseline.json
  13. 38 38
      dist/preview release/viewer/babylon.viewer.js
  14. 1 0
      dist/preview release/what's new.md
  15. 39 2
      src/Layer/babylon.highlightlayer.ts
  16. 21 11
      src/Lights/Shadows/babylon.shadowGenerator.ts
  17. 1 1
      src/Lights/babylon.light.ts
  18. 13 5
      src/Mesh/babylon.instancedMesh.ts
  19. 68 6
      src/Mesh/babylon.mesh.ts
  20. 8 0
      src/PostProcess/babylon.postProcess.ts
  21. 2 2
      src/PostProcess/babylon.volumetricLightScatteringPostProcess.ts
  22. 30 18
      src/babylon.scene.ts
  23. BIN
      tests/validation/ReferenceImages/Billboard.png
  24. BIN
      tests/validation/ReferenceImages/DefaultRenderingPipeline.png
  25. BIN
      tests/validation/ReferenceImages/Flat2009.png
  26. BIN
      tests/validation/ReferenceImages/GUI.png
  27. BIN
      tests/validation/ReferenceImages/Hillvalley.png
  28. BIN
      tests/validation/ReferenceImages/SpaceDeK.png
  29. BIN
      tests/validation/ReferenceImages/TheCar.png
  30. BIN
      tests/validation/ReferenceImages/advancedShadows.png
  31. BIN
      tests/validation/ReferenceImages/charting.png
  32. BIN
      tests/validation/ReferenceImages/customRTT.png
  33. BIN
      tests/validation/ReferenceImages/instancedBones.png
  34. BIN
      tests/validation/ReferenceImages/lod.png
  35. BIN
      tests/validation/ReferenceImages/mansion.png
  36. BIN
      tests/validation/ReferenceImages/normals.png
  37. BIN
      tests/validation/ReferenceImages/pbrrough.png
  38. BIN
      tests/validation/ReferenceImages/pointLightShadows.png
  39. BIN
      tests/validation/ReferenceImages/procedural.png
  40. BIN
      tests/validation/ReferenceImages/refprobe.png
  41. BIN
      tests/validation/ReferenceImages/selfShadowing.png
  42. BIN
      tests/validation/ReferenceImages/softShadows.png
  43. 5 31
      tests/validation/config.json
  44. 3 3
      tests/validation/karma.conf.js

+ 7 - 5
.vscode/launch.json

@@ -130,17 +130,19 @@
             "request": "launch",
             "reAttach": true,
             "url": "http://localhost:1338/localDev/index.html",
-            "pathMappings": [{
-                "url": "http://localhost:1338",
-                "path": "${workspaceFolder}"
-            }],
+            "pathMappings": [
+                {
+                    "url": "http://localhost:1338",
+                    "path": "${workspaceFolder}"
+                }
+            ],
             "preLaunchTask": "run"
         },
         {
             "name": "Launch Build Validation (Chrome)",
             "type": "chrome",
             "request": "launch",
-            "url": "http://localhost:1338/tests/validation/index.html",
+            "url": "http://localhost:1338/tests/validation/index.html?LOD",
             "webRoot": "${workspaceRoot}/",
             "sourceMaps": true,
             "preLaunchTask": "run",

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 7678 - 7648
Playground/babylon.d.txt


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 10440 - 10410
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 37 - 37
dist/preview release/babylon.js


+ 149 - 22
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,18 @@ var BABYLON;
                 if (!mesh.isReady()) {
                     return false;
                 }
-                var mat = mesh.material;
-                if (mat) {
-                    if (!mat.isReady(mesh)) {
-                        return false;
+                // Highlight layers
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                for (var _i = 0, _a = this.highlightLayers; _i < _a.length; _i++) {
+                    var layer = _a[_i];
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+                    for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) {
+                        var subMesh = _c[_b];
+                        if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
                     }
                 }
             }
@@ -25327,13 +25340,71 @@ var BABYLON;
             configurable: true
         });
         /**
-         * Boolean : true once the mesh is ready after all the delayed process (loading, etc) are complete.
+         * Determine if the current mesh is ready to be rendered
+         * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
+         * @returns true if all associated assets are ready (material, textures, shaders)
          */
-        Mesh.prototype.isReady = function () {
+        Mesh.prototype.isReady = function (forceInstanceSupport) {
+            if (forceInstanceSupport === void 0) { forceInstanceSupport = false; }
             if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) {
                 return false;
             }
-            return _super.prototype.isReady.call(this);
+            if (!_super.prototype.isReady.call(this)) {
+                return false;
+            }
+            if (!this.subMeshes || this.subMeshes.length === 0) {
+                return true;
+            }
+            var engine = this.getEngine();
+            var scene = this.getScene();
+            var hardwareInstancedRendering = forceInstanceSupport || engine.getCaps().instancedArrays && this.instances.length > 0;
+            this.computeWorldMatrix();
+            var mat = this.material || scene.defaultMaterial;
+            if (mat) {
+                var currentAlphaTestingState = engine.getAlphaTesting();
+                if (mat.storeEffectOnSubMeshes) {
+                    for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) {
+                        var subMesh = _a[_i];
+                        var effectiveMaterial = subMesh.getMaterial();
+                        if (effectiveMaterial) {
+                            engine.setAlphaTesting(effectiveMaterial.needAlphaTesting() && !effectiveMaterial.needAlphaBlendingForMesh(this));
+                            if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
+                                engine.setAlphaTesting(currentAlphaTestingState);
+                                return false;
+                            }
+                        }
+                    }
+                }
+                else {
+                    engine.setAlphaTesting(mat.needAlphaTesting() && !mat.needAlphaBlendingForMesh(this));
+                    if (!mat.isReady(this, hardwareInstancedRendering)) {
+                        engine.setAlphaTesting(currentAlphaTestingState);
+                        return false;
+                    }
+                }
+                engine.setAlphaTesting(currentAlphaTestingState);
+            }
+            // Shadows
+            for (var _b = 0, _c = this._lightSources; _b < _c.length; _b++) {
+                var light = _c[_b];
+                var generator = light.getShadowGenerator();
+                if (generator) {
+                    for (var _d = 0, _e = this.subMeshes; _d < _e.length; _d++) {
+                        var subMesh = _e[_d];
+                        if (!generator.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
+                    }
+                }
+            }
+            // LOD
+            for (var _f = 0, _g = this._LODLevels; _f < _g.length; _f++) {
+                var lod = _g[_f];
+                if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) {
+                    return false;
+                }
+            }
+            return true;
         };
         Object.defineProperty(Mesh.prototype, "areNormalsFrozen", {
             /**
@@ -49310,7 +49381,7 @@ var BABYLON;
             return "InstancedMesh";
         };
         Object.defineProperty(InstancedMesh.prototype, "receiveShadows", {
-            // Methods
+            // Methods      
             get: function () {
                 return this._sourceMesh.receiveShadows;
             },
@@ -49359,6 +49430,13 @@ var BABYLON;
             configurable: true
         });
         /**
+         * Is this node ready to be used/rendered
+         * @return {boolean} is it ready
+         */
+        InstancedMesh.prototype.isReady = function () {
+            return this._sourceMesh.isReady(true);
+        };
+        /**
          * Returns a float array or a Float32Array of the requested kind of data : positons, normals, uvs, etc.
          */
         InstancedMesh.prototype.getVerticesData = function (kind, copyWhenShared) {
@@ -53646,6 +53724,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 +54250,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 +54496,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 +54620,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 +62852,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 +62975,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 +77096,7 @@ var BABYLON;
             }
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function () {
+                _this._sceneDisposeObserver = null;
                 _this.dispose();
             });
         }
@@ -77837,7 +77933,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 +78003,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 +78208,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


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 7427 - 7397
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 37 - 37
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 149 - 22
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,18 @@ var BABYLON;
                 if (!mesh.isReady()) {
                     return false;
                 }
-                var mat = mesh.material;
-                if (mat) {
-                    if (!mat.isReady(mesh)) {
-                        return false;
+                // Highlight layers
+                var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
+                for (var _i = 0, _a = this.highlightLayers; _i < _a.length; _i++) {
+                    var layer = _a[_i];
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+                    for (var _b = 0, _c = mesh.subMeshes; _b < _c.length; _b++) {
+                        var subMesh = _c[_b];
+                        if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
                     }
                 }
             }
@@ -25327,13 +25340,71 @@ var BABYLON;
             configurable: true
         });
         /**
-         * Boolean : true once the mesh is ready after all the delayed process (loading, etc) are complete.
+         * Determine if the current mesh is ready to be rendered
+         * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
+         * @returns true if all associated assets are ready (material, textures, shaders)
          */
-        Mesh.prototype.isReady = function () {
+        Mesh.prototype.isReady = function (forceInstanceSupport) {
+            if (forceInstanceSupport === void 0) { forceInstanceSupport = false; }
             if (this.delayLoadState === BABYLON.Engine.DELAYLOADSTATE_LOADING) {
                 return false;
             }
-            return _super.prototype.isReady.call(this);
+            if (!_super.prototype.isReady.call(this)) {
+                return false;
+            }
+            if (!this.subMeshes || this.subMeshes.length === 0) {
+                return true;
+            }
+            var engine = this.getEngine();
+            var scene = this.getScene();
+            var hardwareInstancedRendering = forceInstanceSupport || engine.getCaps().instancedArrays && this.instances.length > 0;
+            this.computeWorldMatrix();
+            var mat = this.material || scene.defaultMaterial;
+            if (mat) {
+                var currentAlphaTestingState = engine.getAlphaTesting();
+                if (mat.storeEffectOnSubMeshes) {
+                    for (var _i = 0, _a = this.subMeshes; _i < _a.length; _i++) {
+                        var subMesh = _a[_i];
+                        var effectiveMaterial = subMesh.getMaterial();
+                        if (effectiveMaterial) {
+                            engine.setAlphaTesting(effectiveMaterial.needAlphaTesting() && !effectiveMaterial.needAlphaBlendingForMesh(this));
+                            if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
+                                engine.setAlphaTesting(currentAlphaTestingState);
+                                return false;
+                            }
+                        }
+                    }
+                }
+                else {
+                    engine.setAlphaTesting(mat.needAlphaTesting() && !mat.needAlphaBlendingForMesh(this));
+                    if (!mat.isReady(this, hardwareInstancedRendering)) {
+                        engine.setAlphaTesting(currentAlphaTestingState);
+                        return false;
+                    }
+                }
+                engine.setAlphaTesting(currentAlphaTestingState);
+            }
+            // Shadows
+            for (var _b = 0, _c = this._lightSources; _b < _c.length; _b++) {
+                var light = _c[_b];
+                var generator = light.getShadowGenerator();
+                if (generator) {
+                    for (var _d = 0, _e = this.subMeshes; _d < _e.length; _d++) {
+                        var subMesh = _e[_d];
+                        if (!generator.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
+                    }
+                }
+            }
+            // LOD
+            for (var _f = 0, _g = this._LODLevels; _f < _g.length; _f++) {
+                var lod = _g[_f];
+                if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) {
+                    return false;
+                }
+            }
+            return true;
         };
         Object.defineProperty(Mesh.prototype, "areNormalsFrozen", {
             /**
@@ -49156,7 +49227,7 @@ var BABYLON;
             return "InstancedMesh";
         };
         Object.defineProperty(InstancedMesh.prototype, "receiveShadows", {
-            // Methods
+            // Methods      
             get: function () {
                 return this._sourceMesh.receiveShadows;
             },
@@ -49205,6 +49276,13 @@ var BABYLON;
             configurable: true
         });
         /**
+         * Is this node ready to be used/rendered
+         * @return {boolean} is it ready
+         */
+        InstancedMesh.prototype.isReady = function () {
+            return this._sourceMesh.isReady(true);
+        };
+        /**
          * Returns a float array or a Float32Array of the requested kind of data : positons, normals, uvs, etc.
          */
         InstancedMesh.prototype.getVerticesData = function (kind, copyWhenShared) {
@@ -53492,6 +53570,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 +54096,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 +54342,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 +54466,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 +62698,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 +62821,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 +76942,7 @@ var BABYLON;
             }
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function () {
+                _this._sceneDisposeObserver = null;
                 _this.dispose();
             });
         }
@@ -77683,7 +77779,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 +77849,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 +78054,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 - 29
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 11187,
+  "errors": 11182,
   "babylon.typedoc.json": {
-    "errors": 11187,
+    "errors": 11182,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {
@@ -27637,11 +27637,6 @@
             }
           }
         },
-        "isReady": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
         "isVertexBufferUpdatable": {
           "Comments": {
             "MissingReturn": true
@@ -43197,11 +43192,6 @@
             "MissingText": true
           }
         },
-        "isReady": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
         "markAllMaterialsAsDirty": {
           "Parameter": {
             "flag": {
@@ -58064,23 +58054,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


+ 1 - 0
dist/preview release/what's new.md

@@ -5,6 +5,7 @@
 - New [AnimationGroup class](http://doc.babylonjs.com/how_to/group) to control simultaneously multiple animations with different targets ([deltakosh](https://github.com/deltakosh))
 
 ## Updates
+- Improved [SceneOptimizer](http://doc.babylonjs.com/how_to/how_to_use_sceneoptimizer) to provide better adapatability ([deltakosh](https://github.com/deltakosh))
 - New watcher configuration for VSCode. Now the task only compiles changed files ([sebavan](https://github.com/sebavan))
 - Added new draw modes to engine (points, lines, linesloop, linestrip, trianglestrip, trianglefan) ([benaadams](https://github.com/benaadams))
 - Added GUI Textblock.lineSpacing setter and getter to configure vertical space between lines in pixels or percentage values when working with text wrapping ([carloslanderas](https://github.com/carloslanderas))

+ 39 - 2
src/Layer/babylon.highlightlayer.ts

@@ -456,7 +456,7 @@
                     emissiveTexture = (<any>material).emissiveTexture;
                 }
 
-                if (this.isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
+                if (this._isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
                     engine.enableEffect(this._glowMapGenerationEffect);
                     mesh._bind(subMesh, this._glowMapGenerationEffect, Material.TriangleFillMode);
 
@@ -549,7 +549,31 @@
          * @param emissiveTexture the associated emissive texture used to generate the glow
          * @return true if ready otherwise, false
          */
-        private isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<Texture>): boolean {
+        public isReady(subMesh: SubMesh, useInstances: boolean): boolean {
+            let material = subMesh.getMaterial();
+            let mesh = subMesh.getRenderingMesh();
+
+            if (!material || !mesh || !this._meshes) {
+                return false;
+            }
+
+            let emissiveTexture: Nullable<Texture> = null;
+            let highlightLayerMesh = this._meshes[mesh.uniqueId];
+
+            if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
+                emissiveTexture = (<any>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
+         */
+        private _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<Texture>): boolean {
             let material = subMesh.getMaterial();
 
             if (!material) {
@@ -770,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

+ 21 - 11
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -345,7 +345,6 @@
         private _cachedDirection: Vector3;
         private _cachedDefines: string;
         private _currentRenderID: number;
-        private _downSamplePostprocess: Nullable<PassPostProcess>;
         private _boxBlurPostprocess: Nullable<PostProcess>;
         private _kernelBlurXPostprocess: Nullable<PostProcess>;
         private _kernelBlurYPostprocess: Nullable<PostProcess>;
@@ -428,10 +427,6 @@
                 if (!this.useBlurExponentialShadowMap && !this.useBlurCloseExponentialShadowMap) {
                     return;
                 }
-
-                if (!this._blurPostProcesses || !this._blurPostProcesses.length) {
-                    this._initializeBlurRTTAndPostProcesses();
-                }
                 let shadowMap = this.getShadowMapForRendering();
 
                 if (shadowMap) {
@@ -727,7 +722,27 @@
                     ["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;
         }
 
         /**
@@ -861,11 +876,6 @@
                 this._shadowMap2 = null;
             }
 
-            if (this._downSamplePostprocess) {
-                this._downSamplePostprocess.dispose();
-                this._downSamplePostprocess = null;
-            }
-
             if (this._boxBlurPostprocess) {
                 this._boxBlurPostprocess.dispose();
                 this._boxBlurPostprocess = null;

+ 1 - 1
src/Lights/babylon.light.ts

@@ -18,7 +18,7 @@
 
         /**
          * 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
          */
         public static get LIGHTMAP_SPECULAR(): number {

+ 13 - 5
src/Mesh/babylon.instancedMesh.ts

@@ -35,9 +35,9 @@
          */
         public getClassName(): string {
             return "InstancedMesh";
-        }          
+        }
 
-        // Methods
+        // Methods      
         public get receiveShadows(): boolean {
             return this._sourceMesh.receiveShadows;
         }
@@ -70,6 +70,14 @@
         }
 
         /**
+         * Is this node ready to be used/rendered
+         * @return {boolean} is it ready
+         */
+        public isReady(): boolean {
+            return this._sourceMesh.isReady(true);
+        }
+
+        /**
          * Returns a float array or a Float32Array of the requested kind of data : positons, normals, uvs, etc.  
          */
         public getVerticesData(kind: string, copyWhenShared?: boolean): Nullable<FloatArray> {
@@ -103,7 +111,7 @@
          */
         public setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): Mesh {
             if (this.sourceMesh) {
-               this.sourceMesh.setVerticesData(kind, data, updatable, stride);
+                this.sourceMesh.setVerticesData(kind, data, updatable, stride);
             }
             return this.sourceMesh;
         }
@@ -134,7 +142,7 @@
          */
         public updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): Mesh {
             if (this.sourceMesh) {
-               this.sourceMesh.updateVerticesData(kind, data, updateExtends, makeItUnique);
+                this.sourceMesh.updateVerticesData(kind, data, updateExtends, makeItUnique);
             }
             return this.sourceMesh;
         }
@@ -148,7 +156,7 @@
          */
         public setIndices(indices: IndicesArray, totalVertices: Nullable<number> = null): Mesh {
             if (this.sourceMesh) {
-               this.sourceMesh.setIndices(indices, totalVertices);
+                this.sourceMesh.setIndices(indices, totalVertices);
             }
             return this.sourceMesh;
         }

+ 68 - 6
src/Mesh/babylon.mesh.ts

@@ -191,10 +191,10 @@
                 // Metadata
                 if (source.metadata && source.metadata.clone) {
                     this.metadata = source.metadata.clone();
-                 } else {
+                } else {
                     this.metadata = source.metadata;
-                 }                
-                
+                }
+
                 // Tags
                 if (Tags && Tags.HasTags(source)) {
                     Tags.AddTagsTo(this, Tags.GetTags(source, true));
@@ -598,14 +598,76 @@
         }
 
         /**
-         * Boolean : true once the mesh is ready after all the delayed process (loading, etc) are complete.
+         * Determine if the current mesh is ready to be rendered
+         * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
+         * @returns true if all associated assets are ready (material, textures, shaders)
          */
-        public isReady(): boolean {
+        public isReady(forceInstanceSupport = false): boolean {
             if (this.delayLoadState === Engine.DELAYLOADSTATE_LOADING) {
                 return false;
             }
 
-            return super.isReady();
+            if (!super.isReady()) {
+                return false;
+            }
+
+            if (!this.subMeshes || this.subMeshes.length === 0) {
+                return true;
+            }
+
+            let engine = this.getEngine();
+            let scene = this.getScene();
+            let hardwareInstancedRendering = forceInstanceSupport || engine.getCaps().instancedArrays && this.instances.length > 0;
+
+            this.computeWorldMatrix();
+
+            let mat = this.material || scene.defaultMaterial;
+            if (mat) {
+                let currentAlphaTestingState = engine.getAlphaTesting();
+
+                if (mat.storeEffectOnSubMeshes) {
+                    for (var subMesh of this.subMeshes) {
+                        let effectiveMaterial = subMesh.getMaterial();
+                        if (effectiveMaterial) {
+                            engine.setAlphaTesting(effectiveMaterial.needAlphaTesting() && !effectiveMaterial.needAlphaBlendingForMesh(this));
+                            if (!effectiveMaterial.isReadyForSubMesh(this, subMesh, hardwareInstancedRendering)) {
+                                engine.setAlphaTesting(currentAlphaTestingState);
+                                return false;
+                            }
+                        }
+                    }
+                } else {
+                    engine.setAlphaTesting(mat.needAlphaTesting() && !mat.needAlphaBlendingForMesh(this));
+                    if (!mat.isReady(this, hardwareInstancedRendering)) {
+                        engine.setAlphaTesting(currentAlphaTestingState);
+                        return false;
+                    }
+                }
+
+                engine.setAlphaTesting(currentAlphaTestingState);
+            }
+
+            // Shadows
+            for (var light of this._lightSources) {
+                let generator = light.getShadowGenerator();
+
+                if (generator) {
+                    for (var subMesh of this.subMeshes) {
+                        if (!generator.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
+                    }
+                }
+            }
+
+            // LOD
+            for (var lod of this._LODLevels) {
+                if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) {
+                    return false;
+                }
+            }
+
+            return true;
         }
 
         /**

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

@@ -334,6 +334,14 @@
             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();
+        }
+
         public apply(): Nullable<Effect> {
             // Check
             if (!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) {

+ 30 - 18
src/babylon.scene.ts

@@ -1855,7 +1855,11 @@
             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
+         */
         public isReady(): boolean {
             if (this._isDisposed) {
                 return false;
@@ -1864,7 +1868,8 @@
             if (this._pendingData.length > 0) {
                 return false;
             }
-            var index: number;
+            let index: number;
+            let engine = this.getEngine();
 
             // Geometries
             for (index = 0; index < this._geometries.length; index++) {
@@ -1891,10 +1896,17 @@
                     return false;
                 }
 
-                var mat = mesh.material;
-                if (mat) {
-                    if (!mat.isReady(mesh)) {
-                        return false;
+                // Highlight layers
+                let hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && (<Mesh>mesh).instances.length > 0;
+                for (var layer of this.highlightLayers) {
+                    if (!layer.hasMesh(mesh)) {
+                        continue;
+                    }
+
+                    for (var subMesh of mesh.subMeshes) {
+                        if (!layer.isReady(subMesh, hardwareInstancedRendering)) {
+                            return false;
+                        }
                     }
                 }
             }
@@ -2343,7 +2355,7 @@
             return index;
         }
 
-        
+
         public removeParticleSystem(toRemove: ParticleSystem): number {
             var index = this.particleSystems.indexOf(toRemove);
             if (index !== -1) {
@@ -2372,14 +2384,14 @@
             }
             return index;
         };
-        public removeLensFlareSystem(toRemove:LensFlareSystem){
+        public removeLensFlareSystem(toRemove: LensFlareSystem) {
             var index = this.lensFlareSystems.indexOf(toRemove);
             if (index !== -1) {
                 this.lensFlareSystems.splice(index, 1);
             }
             return index;
         };
-        public removeActionManager(toRemove:ActionManager){
+        public removeActionManager(toRemove: ActionManager) {
             var index = this._actionManagers.indexOf(toRemove);
             if (index !== -1) {
                 this._actionManagers.splice(index, 1);
@@ -2413,39 +2425,39 @@
             this.onNewCameraAddedObservable.notifyObservers(newCamera);
         }
 
-        public addSkeleton(newSkeleton:Skeleton){
+        public addSkeleton(newSkeleton: Skeleton) {
             this.skeletons.push(newSkeleton)
         }
 
-        public addParticleSystem(newParticleSystem:ParticleSystem){
+        public addParticleSystem(newParticleSystem: ParticleSystem) {
             this.particleSystems.push(newParticleSystem)
         }
 
-        public addAnimation(newAnimation:Animation){
+        public addAnimation(newAnimation: Animation) {
             this.animations.push(newAnimation)
         }
 
-        public addMultiMaterial(newMultiMaterial:MultiMaterial){
+        public addMultiMaterial(newMultiMaterial: MultiMaterial) {
             this.multiMaterials.push(newMultiMaterial)
         }
 
-        public addMaterial(newMaterial:Material){
+        public addMaterial(newMaterial: Material) {
             this.materials.push(newMaterial)
         }
 
-        public addMorphTargetManager(newMorphTargetManager:MorphTargetManager){
+        public addMorphTargetManager(newMorphTargetManager: MorphTargetManager) {
             this.morphTargetManagers.push(newMorphTargetManager)
         }
 
-        public addGeometry(newGeometrie:Geometry){
+        public addGeometry(newGeometrie: Geometry) {
             this._geometries.push(newGeometrie)
         }
 
-        public addLensFlareSystem(newLensFlareSystem:LensFlareSystem){
+        public addLensFlareSystem(newLensFlareSystem: LensFlareSystem) {
             this.lensFlareSystems.push(newLensFlareSystem)
         }
 
-        public addActionManager(newActionManager:ActionManager){
+        public addActionManager(newActionManager: ActionManager) {
             this._actionManagers.push(newActionManager)
         }
 

BIN
tests/validation/ReferenceImages/Billboard.png


BIN
tests/validation/ReferenceImages/DefaultRenderingPipeline.png


BIN
tests/validation/ReferenceImages/Flat2009.png


BIN
tests/validation/ReferenceImages/GUI.png


BIN
tests/validation/ReferenceImages/Hillvalley.png


BIN
tests/validation/ReferenceImages/SpaceDeK.png


BIN
tests/validation/ReferenceImages/TheCar.png


BIN
tests/validation/ReferenceImages/advancedShadows.png


BIN
tests/validation/ReferenceImages/charting.png


BIN
tests/validation/ReferenceImages/customRTT.png


BIN
tests/validation/ReferenceImages/instancedBones.png


BIN
tests/validation/ReferenceImages/lod.png


BIN
tests/validation/ReferenceImages/mansion.png


BIN
tests/validation/ReferenceImages/normals.png


BIN
tests/validation/ReferenceImages/pbrrough.png


BIN
tests/validation/ReferenceImages/pointLightShadows.png


BIN
tests/validation/ReferenceImages/procedural.png


BIN
tests/validation/ReferenceImages/refprobe.png


BIN
tests/validation/ReferenceImages/selfShadowing.png


BIN
tests/validation/ReferenceImages/softShadows.png


+ 5 - 31
tests/validation/config.json

@@ -15,9 +15,8 @@
     },
     {
       "title": "Espilit",
-      "renderCount": 10,
       "sceneFolder": "/Scenes/Espilit/",
-      "sceneFilename": "Espilit.binary.babylon",
+      "sceneFilename": "espilit.babylon",
       "referenceImage": "Espilit.png"
     },
     {
@@ -65,7 +64,6 @@
     },
     {
       "title": "Flat2009",
-      "renderCount": 20,
       "sceneFolder": "/Scenes/Flat2009/",
       "sceneFilename": "Flat2009.babylon",
       "referenceImage": "Flat2009.png"
@@ -97,7 +95,6 @@
     },
     {
       "title": "Soft Shadows",
-      "renderCount": 5,
       "scriptToRun": "/Demos/SoftShadows/softShadows.js",
       "functionToCall": "CreateSoftShadowsTestScene",
       "referenceImage": "softShadows.png"
@@ -110,7 +107,6 @@
     },
     {
       "title": "Highlights",
-      "renderCount": 10,
       "scriptToRun": "/Demos/Highlights/highlights.js",
       "functionToCall": "CreateHighlightsScene",
       "referenceImage": "highlights.png",
@@ -148,14 +144,12 @@
     },
     {
       "title": "Self shadowing",
-      "renderCount": 10,
       "scriptToRun": "/Demos/SelfShadowing/shadows.js",
       "functionToCall": "CreateShadowsTestScene",
       "referenceImage": "selfShadowing.png"
     },
     {
       "title": "Advanced shadows",
-      "renderCount": 10,
       "scriptToRun": "/Demos/AdvancedShadows/advancedShadows.js",
       "functionToCall": "CreateAdvancedShadowsTestScene",
       "referenceImage": "advancedShadows.png",
@@ -163,7 +157,6 @@
     },
     {
       "title": "point light shadows",
-      "renderCount": 10,
       "scriptToRun": "/Demos/PointLightShadowMap/pointLightShadows.js",
       "functionToCall": "CreatePointLightShadowScene",
       "referenceImage": "pointLightShadows.png",
@@ -183,56 +176,49 @@
     },
     {
       "title": "Custom render target",
+      "renderCount": 20,
       "scriptToRun": "/Demos/CustomRenderTarget/customRenderTarget.js",
-      "renderCount": 10,
       "functionToCall": "CreateCustomRenderTargetTestScene",
       "referenceImage": "customRTT.png"
     },
     {
       "title": "GLTF Normals",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFNormals/index.js",
       "functionToCall": "createScene",
       "referenceImage": "gltfnormals.png"
     },
     {
       "title": "GLTF Material",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createMaterialScene",
       "referenceImage": "gltfMaterial.png"
     },
     {
       "title": "GLTF Material Alpha",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createMaterialAlphaScene",
       "referenceImage": "gltfMaterialAlpha.png"
     },
     {
       "title": "GLTF Primitive Attribute",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createPrimitiveAttributeScene",
       "referenceImage": "gltfPrimitiveAttribute.png"
     },
     {
       "title": "GLTF Metallic Roughness",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createMaterialMetallicRoughnessScene",
       "referenceImage": "gltfMaterialMetallicRoughness.png"
     },
     {
       "title": "GLTF Specular Glossiness",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createMaterialSpecularGlossinessScene",
       "referenceImage": "gltfMaterialSpecularGlossiness.png"
     },
     {
       "title": "GLTF Texture Sampler",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFTests/index.js",
       "functionToCall": "createTextureSamplerScene",
       "referenceImage": "gltfTextureSampler.png"
@@ -248,19 +234,16 @@
     {
       "title": "Asset Containers",
       "playgroundId": "#P3U079#19",
-      "renderCount": 20,
       "referenceImage": "assetContainer.png"
-    },   
+    },
     {
       "title": "GLTF Mesh Primitive Attribute Test",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GLTFMeshPrimitiveAttributeTest/index.js",
       "functionToCall": "createScene",
       "referenceImage": "gltfMeshPrimAttribTest.png"
     },
     {
       "title": "PBR glossy",
-      "renderCount": 20,
       "replace": "engine.setHardwareScalingLevel, //engine.setHardwareScalingLevel",
       "scriptToRun": "/Demos/PBRGlossy/index.js",
       "functionToCall": "CreatePBRGlossyScene",
@@ -268,14 +251,13 @@
     },
     {
       "title": "PBR rough",
-      "renderCount": 20,
       "scriptToRun": "/Demos/PBRRough/index.js",
       "functionToCall": "CreatePBRRoughScene",
       "referenceImage": "pbrrough.png"
     },
     {
       "title": "Reflection probes",
-      "renderCount": 10,
+      "renderCount": 20,
       "scriptToRun": "/Demos/RefProbe/reflectionProbe.js",
       "functionToCall": "CreateReflectionProbeTestScene ",
       "referenceImage": "refprobe.png"
@@ -297,44 +279,38 @@
     },
     {
       "title": "MultiSample render targets",
-      "renderCount": 10,
+      "renderCount": 20,
       "playgroundId": "#12MKMN#0",
       "referenceImage": "MultiSample render targets.png"
     },
     {
       "title": "Default rendering pipeline",
-      "renderCount": 20,
       "playgroundId": "#5XB8YT#2",
       "referenceImage": "DefaultRenderingPipeline.png"
     },
     {
       "title": "Billboard",
-      "renderCount": 20,
       "playgroundId": "#UJEIL#13",
       "referenceImage": "Billboard.png"
     },
     {
       "title": "setParent",
-      "renderCount": 20,
       "playgroundId": "#JD49CT#2",
       "referenceImage": "setParent.png"
     },
     {
       "title": "GUI",
-      "renderCount": 20,
       "scriptToRun": "/Demos/GUI/gui.js",
       "functionToCall": "createScene",
       "referenceImage": "GUI.png"
     },
     {
       "title": "Up Vector",
-      "renderCount": 20,
       "playgroundId": "#2FNBTG#27",
       "referenceImage": "upVector.png"
     },
     {
       "title": "Procedural textures",
-      "renderCount": 10,
       "scriptToRun": "/Demos/Procedural/proceduralTexture.js",
       "functionToCall": "CreateProceduralTextureTestScene",
       "referenceImage": "procedural.png",
@@ -343,7 +319,6 @@
     },
     {
       "title": "Instances",
-      "renderCount": 10,
       "scriptToRun": "/Demos/Instances/instances.js",
       "functionToCall": "CreateInstancesTestScene",
       "referenceImage": "instances.png",
@@ -352,7 +327,6 @@
     },
     {
       "title": "Instanced Bones",
-      "renderCount": 10,
       "scriptToRun": "/Demos/InstancedBones/bones2.js",
       "functionToCall": "CreateBones2TestScene",
       "referenceImage": "instancedBones.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,