瀏覽代碼

Fixed ref probe validation test
added ADT.rootContainer getter

David Catuhe 8 年之前
父節點
當前提交
a1c994aa3e

文件差異過大導致無法顯示
+ 6392 - 6392
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 30 - 30
dist/preview release/babylon.js


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

@@ -19996,12 +19996,20 @@ var BABYLON;
         };
         Texture.prototype.getReflectionTextureMatrix = function () {
             var _this = this;
+            var scene = this.getScene();
             if (this.uOffset === this._cachedUOffset &&
                 this.vOffset === this._cachedVOffset &&
                 this.uScale === this._cachedUScale &&
                 this.vScale === this._cachedVScale &&
                 this.coordinatesMode === this._cachedCoordinatesMode) {
-                return this._cachedTextureMatrix;
+                if (this.coordinatesMode === Texture.PROJECTION_MODE) {
+                    if (this._cachedProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
+                        return this._cachedTextureMatrix;
+                    }
+                }
+                else {
+                    return this._cachedTextureMatrix;
+                }
             }
             if (!this._cachedTextureMatrix) {
                 this._cachedTextureMatrix = BABYLON.Matrix.Zero();
@@ -20029,13 +20037,15 @@ var BABYLON;
                     this._projectionModeMatrix.m[13] = 0.5;
                     this._projectionModeMatrix.m[14] = 1.0;
                     this._projectionModeMatrix.m[15] = 1.0;
-                    this.getScene().getProjectionMatrix().multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);
+                    var projectionMatrix = scene.getProjectionMatrix();
+                    this._cachedProjectionMatrixId = projectionMatrix.updateFlag;
+                    projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);
                     break;
                 default:
                     BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix);
                     break;
             }
-            this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) {
+            scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) {
                 return (mat.getActiveTextures().indexOf(_this) !== -1);
             });
             return this._cachedTextureMatrix;

文件差異過大導致無法顯示
+ 6392 - 6392
dist/preview release/babylon.module.d.ts


文件差異過大導致無法顯示
+ 30 - 30
dist/preview release/babylon.worker.js


文件差異過大導致無法顯示
+ 3157 - 3156
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


文件差異過大導致無法顯示
+ 16 - 16
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 13 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -19996,12 +19996,20 @@ var BABYLON;
         };
         Texture.prototype.getReflectionTextureMatrix = function () {
             var _this = this;
+            var scene = this.getScene();
             if (this.uOffset === this._cachedUOffset &&
                 this.vOffset === this._cachedVOffset &&
                 this.uScale === this._cachedUScale &&
                 this.vScale === this._cachedVScale &&
                 this.coordinatesMode === this._cachedCoordinatesMode) {
-                return this._cachedTextureMatrix;
+                if (this.coordinatesMode === Texture.PROJECTION_MODE) {
+                    if (this._cachedProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
+                        return this._cachedTextureMatrix;
+                    }
+                }
+                else {
+                    return this._cachedTextureMatrix;
+                }
             }
             if (!this._cachedTextureMatrix) {
                 this._cachedTextureMatrix = BABYLON.Matrix.Zero();
@@ -20029,13 +20037,15 @@ var BABYLON;
                     this._projectionModeMatrix.m[13] = 0.5;
                     this._projectionModeMatrix.m[14] = 1.0;
                     this._projectionModeMatrix.m[15] = 1.0;
-                    this.getScene().getProjectionMatrix().multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);
+                    var projectionMatrix = scene.getProjectionMatrix();
+                    this._cachedProjectionMatrixId = projectionMatrix.updateFlag;
+                    projectionMatrix.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);
                     break;
                 default:
                     BABYLON.Matrix.IdentityToRef(this._cachedTextureMatrix);
                     break;
             }
-            this.getScene().markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) {
+            scene.markAllMaterialsAsDirty(BABYLON.Material.TextureDirtyFlag, function (mat) {
                 return (mat.getActiveTextures().indexOf(_this) !== -1);
             });
             return this._cachedTextureMatrix;

文件差異過大導致無法顯示
+ 3157 - 3156
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 1 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -25,6 +25,7 @@ declare module BABYLON.GUI {
         idealHeight: number;
         renderAtIdealSize: boolean;
         readonly layer: Layer;
+        readonly rootContainer: Container;
         constructor(name: string, width: number, height: number, scene: Scene, generateMipMaps?: boolean, samplingMode?: number);
         executeOnAllControls(func: (control: Control) => void, container?: Container): void;
         markAsDirty(): void;

+ 7 - 0
dist/preview release/gui/babylon.gui.js

@@ -104,6 +104,13 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            Object.defineProperty(AdvancedDynamicTexture.prototype, "rootContainer", {
+                get: function () {
+                    return this._rootContainer;
+                },
+                enumerable: true,
+                configurable: true
+            });
             AdvancedDynamicTexture.prototype.executeOnAllControls = function (func, container) {
                 if (!container) {
                     container = this._rootContainer;

文件差異過大導致無法顯示
+ 3 - 3
dist/preview release/gui/babylon.gui.min.js


+ 1 - 0
dist/preview release/gui/babylon.gui.module.d.ts

@@ -25,6 +25,7 @@ declare module BABYLON.GUI {
         idealHeight: number;
         renderAtIdealSize: boolean;
         readonly layer: Layer;
+        readonly rootContainer: Container;
         constructor(name: string, width: number, height: number, scene: Scene, generateMipMaps?: boolean, samplingMode?: number);
         executeOnAllControls(func: (control: Control) => void, container?: Container): void;
         markAsDirty(): void;

+ 4 - 0
gui/src/advancedDynamicTexture.ts

@@ -79,6 +79,10 @@ module BABYLON.GUI {
         public get layer(): Layer {
             return this._layerToDispose;
         }   
+
+        public get rootContainer(): Container {
+            return this._rootContainer;
+        }
        
         constructor(name: string, width = 0, height = 0, scene: Scene, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE) {
             super(name, {width: width, height: height}, scene, generateMipMaps, samplingMode, Engine.TEXTUREFORMAT_RGBA);

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


+ 2 - 1
tests/validation/config.json

@@ -189,10 +189,11 @@
     },
     {
       "title": "Reflection probes",
+      "renderCount": 10,
       "scriptToRun": "/Demos/RefProbe/reflectionProbe.js",
       "functionToCall": "CreateReflectionProbeTestScene ",
       "referenceImage": "refprobe.png"
-    },
+    },   
     {
       "title": "PBRMetallicRoughnessMaterial",
       "playgroundId": "#2FDQT5#13",