Forráskód Böngészése

More tests in validation suite + nightly

David Catuhe 8 éve
szülő
commit
b109acf984

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 578 - 578
dist/preview release/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 578 - 578
dist/preview release/babylon.module.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1252 - 1252
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/customConfigurations/minimalViewer/babylon.js


+ 2 - 6
dist/preview release/customConfigurations/minimalViewer/babylon.max.js

@@ -7429,13 +7429,9 @@ var BABYLON;
                 this.initWebVR();
             }
             //Detect if we are running on a faulty buggy OS.
-            var regexpBadOs = /AppleWebKit.*10.[\d] Mobile/;
-            //ua sniffing is the tool of the devil.
-            this._badOS = regexpBadOs.test(navigator.userAgent);
+            this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent);
             //Detect if we are running on a faulty buggy desktop OS.
-            var regexpBadDesktopOS = /AppleWebKit.*10.[\d]/;
-            //ua sniffing is the tool of the devil.
-            this._badDesktopOS = regexpBadDesktopOS.test(navigator.userAgent);
+            this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
             BABYLON.Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched");
         }
         Object.defineProperty(Engine, "LastCreatedEngine", {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1252 - 1252
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


+ 3 - 0
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -280,7 +280,9 @@ declare module BABYLON.GLTF2 {
         private _defaultMaterial;
         private _onSuccess;
         private _onError;
+        private _succeeded;
         private _renderReady;
+        private _renderReadyObservable;
         private _renderPendingCount;
         private _loaderPendingCount;
         static Extensions: {
@@ -289,6 +291,7 @@ declare module BABYLON.GLTF2 {
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         readonly gltf: IGLTF;
         readonly babylonScene: Scene;
+        executeWhenRenderReady(func: (succeeded: boolean) => void): void;
         constructor(parent: GLTFFileLoader);
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;

+ 26 - 7
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -286,6 +286,8 @@ var BABYLON;
     (function (GLTF2) {
         var GLTFLoader = (function () {
             function GLTFLoader(parent) {
+                // Observable with boolean indicating success or error.
+                this._renderReadyObservable = new BABYLON.Observable();
                 this._parent = parent;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -311,6 +313,14 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            GLTFLoader.prototype.executeWhenRenderReady = function (func) {
+                if (this._renderReady) {
+                    func(this._succeeded);
+                }
+                else {
+                    this._renderReadyObservable.add(func);
+                }
+            };
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onError) {
                 var _this = this;
                 this._loadAsync(meshesNames, scene, data, rootUrl, function () {
@@ -352,9 +362,10 @@ var BABYLON;
                 this.removePendingData(this);
             };
             GLTFLoader.prototype._onRenderReady = function () {
-                this._showMeshes();
-                this._startAnimations();
-                if (this._errors.length === 0) {
+                this._succeeded = (this._errors.length === 0);
+                if (this._succeeded) {
+                    this._showMeshes();
+                    this._startAnimations();
                     this._onSuccess();
                 }
                 else {
@@ -362,6 +373,7 @@ var BABYLON;
                     this._errors = [];
                     this._onError();
                 }
+                this._renderReadyObservable.notifyObservers(this._succeeded);
             };
             GLTFLoader.prototype._onLoaderComplete = function () {
                 this._errors.forEach(function (error) { return BABYLON.Tools.Error(error); });
@@ -428,7 +440,9 @@ var BABYLON;
                 this._defaultMaterial = undefined;
                 this._onSuccess = undefined;
                 this._onError = undefined;
+                this._succeeded = false;
                 this._renderReady = false;
+                this._renderReadyObservable.clear();
                 this._renderPendingCount = 0;
                 this._loaderPendingCount = 0;
             };
@@ -1346,16 +1360,21 @@ var BABYLON;
                 MSFTLOD.prototype.loadMaterialLOD = function (loader, material, materialLODs, lod, assign) {
                     var _this = this;
                     loader.loadMaterial(materialLODs[lod], function (babylonMaterial) {
-                        babylonMaterial.name += ".LOD" + lod;
                         assign(babylonMaterial);
                         // Loading is complete if this is the highest quality LOD.
                         if (lod === 0) {
                             loader.removeLoaderPendingData(material);
                             return;
                         }
-                        // Load the next LOD when all of the textures are loaded.
-                        BABYLON.BaseTexture.WhenAllReady(babylonMaterial.getActiveTextures(), function () {
-                            _this.loadMaterialLOD(loader, material, materialLODs, lod - 1, assign);
+                        // Load the next LOD once the loader has succeeded.
+                        loader.executeWhenRenderReady(function (succeeded) {
+                            if (!succeeded) {
+                                return;
+                            }
+                            // Load the next LOD when all of the textures are loaded.
+                            BABYLON.BaseTexture.WhenAllReady(babylonMaterial.getActiveTextures(), function () {
+                                _this.loadMaterialLOD(loader, material, materialLODs, lod - 1, assign);
+                            });
                         });
                     });
                 };

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 3 - 0
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -775,7 +775,9 @@ declare module BABYLON.GLTF2 {
         private _defaultMaterial;
         private _onSuccess;
         private _onError;
+        private _succeeded;
         private _renderReady;
+        private _renderReadyObservable;
         private _renderPendingCount;
         private _loaderPendingCount;
         static Extensions: {
@@ -784,6 +786,7 @@ declare module BABYLON.GLTF2 {
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         readonly gltf: IGLTF;
         readonly babylonScene: Scene;
+        executeWhenRenderReady(func: (succeeded: boolean) => void): void;
         constructor(parent: GLTFFileLoader);
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;

+ 26 - 7
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -2439,6 +2439,8 @@ var BABYLON;
     (function (GLTF2) {
         var GLTFLoader = (function () {
             function GLTFLoader(parent) {
+                // Observable with boolean indicating success or error.
+                this._renderReadyObservable = new BABYLON.Observable();
                 this._parent = parent;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -2464,6 +2466,14 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            GLTFLoader.prototype.executeWhenRenderReady = function (func) {
+                if (this._renderReady) {
+                    func(this._succeeded);
+                }
+                else {
+                    this._renderReadyObservable.add(func);
+                }
+            };
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onError) {
                 var _this = this;
                 this._loadAsync(meshesNames, scene, data, rootUrl, function () {
@@ -2505,9 +2515,10 @@ var BABYLON;
                 this.removePendingData(this);
             };
             GLTFLoader.prototype._onRenderReady = function () {
-                this._showMeshes();
-                this._startAnimations();
-                if (this._errors.length === 0) {
+                this._succeeded = (this._errors.length === 0);
+                if (this._succeeded) {
+                    this._showMeshes();
+                    this._startAnimations();
                     this._onSuccess();
                 }
                 else {
@@ -2515,6 +2526,7 @@ var BABYLON;
                     this._errors = [];
                     this._onError();
                 }
+                this._renderReadyObservable.notifyObservers(this._succeeded);
             };
             GLTFLoader.prototype._onLoaderComplete = function () {
                 this._errors.forEach(function (error) { return BABYLON.Tools.Error(error); });
@@ -2581,7 +2593,9 @@ var BABYLON;
                 this._defaultMaterial = undefined;
                 this._onSuccess = undefined;
                 this._onError = undefined;
+                this._succeeded = false;
                 this._renderReady = false;
+                this._renderReadyObservable.clear();
                 this._renderPendingCount = 0;
                 this._loaderPendingCount = 0;
             };
@@ -3499,16 +3513,21 @@ var BABYLON;
                 MSFTLOD.prototype.loadMaterialLOD = function (loader, material, materialLODs, lod, assign) {
                     var _this = this;
                     loader.loadMaterial(materialLODs[lod], function (babylonMaterial) {
-                        babylonMaterial.name += ".LOD" + lod;
                         assign(babylonMaterial);
                         // Loading is complete if this is the highest quality LOD.
                         if (lod === 0) {
                             loader.removeLoaderPendingData(material);
                             return;
                         }
-                        // Load the next LOD when all of the textures are loaded.
-                        BABYLON.BaseTexture.WhenAllReady(babylonMaterial.getActiveTextures(), function () {
-                            _this.loadMaterialLOD(loader, material, materialLODs, lod - 1, assign);
+                        // Load the next LOD once the loader has succeeded.
+                        loader.executeWhenRenderReady(function (succeeded) {
+                            if (!succeeded) {
+                                return;
+                            }
+                            // Load the next LOD when all of the textures are loaded.
+                            BABYLON.BaseTexture.WhenAllReady(babylonMaterial.getActiveTextures(), function () {
+                                _this.loadMaterialLOD(loader, material, materialLODs, lod - 1, assign);
+                            });
                         });
                     });
                 };

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


BIN
tests/validation/ReferenceImages/MultiSample render targets.png


BIN
tests/validation/ReferenceImages/PBRMetallicRoughnessMaterial.png


BIN
tests/validation/ReferenceImages/PBRSpecularGlossinessMaterial.png


+ 22 - 1
tests/validation/config.json

@@ -190,7 +190,28 @@
       "scriptToRun": "/Demos/RefProbe/reflectionProbe.js",
       "functionToCall": "CreateReflectionProbeTestScene ",
       "referenceImage": "refprobe.png"
-    },    
+    },
+    {
+      "title": "PBRMetallicRoughnessMaterial",
+      "playgroundId": "#2FDQT5#13",
+      "referenceImage": "PBRMetallicRoughnessMaterial.png"
+    },   
+    {
+      "title": "PBRSpecularGlossinessMaterial",
+      "playgroundId": "#Z1VL3V#4",
+      "referenceImage": "PBRSpecularGlossinessMaterial.png"
+    },   
+    {
+      "title": "PBRSpecularGlossinessMaterial",
+      "playgroundId": "#Z1VL3V#4",
+      "referenceImage": "PBRSpecularGlossinessMaterial.png"
+    },   
+    {
+      "title": "MultiSample render targets",
+      "renderCount": 10,
+      "playgroundId": "#12MKMN",
+      "referenceImage": "MultiSample render targets.png"
+    },            
     {
       "title": "Water material (only visual check)",
       "renderCount": 10,

+ 40 - 3
tests/validation/validation.js

@@ -4,6 +4,7 @@ var engine;
 var canvas;
 var currentScene;
 var config;
+var justOnce;
 
 var threshold = 25;
 var errorRatio = 5;
@@ -94,7 +95,9 @@ function evaluate(test, resultCanvas, result, renderImage, index, waitRing) {
 
     currentScene.dispose();
 
-    runTest(index + 1);
+    if (!justOnce) {
+        runTest(index + 1);
+    }
 }
 
 function processCurrentScene(test, resultCanvas, result, renderImage, index, waitRing) {
@@ -114,7 +117,10 @@ function processCurrentScene(test, resultCanvas, result, renderImage, index, wai
     });
 }
 
-function runTest(index) {
+function 
+
+
+runTest(index) {
     if (index >= config.tests.length) {
         return;
     }
@@ -171,6 +177,27 @@ function runTest(index) {
             currentScene = newScene;
             processCurrentScene(test, resultCanvas, result, renderImage, index, waitRing);
         });
+    }
+    else if (test.playgroundId) {
+        var snippetUrl = "https://babylonjs-api2.azurewebsites.net/snippets";
+        var pgRoot = "/playground"
+        var xmlHttp = new XMLHttpRequest();
+        xmlHttp.onreadystatechange = function () {
+            if (xmlHttp.readyState === 4) {
+                if (xmlHttp.status === 200) {
+                    var snippet = JSON.parse(xmlHttp.responseText)[0];
+                    var code = JSON.parse(snippet.jsonPayload).code.toString();
+                    code = code.replace(/\/textures\//g, pgRoot + "/textures/");
+                    code = code.replace(/"textures\//g, "\"" + pgRoot + "/textures/");
+
+                    currentScene = eval(code + "\r\ncreateScene(engine)");
+                    processCurrentScene(test, resultCanvas, result, renderImage, index, waitRing);
+                }
+            }
+        }
+
+        xmlHttp.open("GET", snippetUrl + "/" + test.playgroundId.replace("#", "/"));
+        xmlHttp.send();
     } else {
         // Fix references
         if (test.specificRoot) {
@@ -238,7 +265,17 @@ xhr.addEventListener("load",function() {
         config = JSON.parse(xhr.responseText);
 
         // Run tests
-        runTest(0, engine);
+        var index = 0;
+        if (window.location.search) {
+            justOnce = true;
+            var title = window.location.search.replace("?", "").replace(/%20/g, " ");
+            for (var index = 0; index < config.tests.length; index++) {
+                if (config.tests[index].title === title) {
+                    break;
+                }
+            }
+        }
+        runTest(index);
 
     }
 }, false);