Przeglądaj źródła

Fixed cache issue

David Catuhe 8 lat temu
rodzic
commit
486ef35054

Plik diff jest za duży
+ 1130 - 1130
dist/preview release/babylon.d.ts


Plik diff jest za duży
+ 15 - 15
dist/preview release/babylon.js


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

@@ -16574,8 +16574,8 @@ var BABYLON;
         Scene.prototype.getCachedVisibility = function () {
             return this._cachedVisibility;
         };
-        Scene.prototype.isCachedMaterialValid = function (material, effect, visibility) {
-            if (visibility === void 0) { visibility = 0; }
+        Scene.prototype.isCachedMaterialInvalid = function (material, effect, visibility) {
+            if (visibility === void 0) { visibility = 1; }
             return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility;
         };
         Scene.prototype.getBoundingBoxRenderer = function () {
@@ -25026,6 +25026,7 @@ var BABYLON;
         };
         Material.prototype._afterBind = function (mesh) {
             this._scene._cachedMaterial = this;
+            this._scene._cachedVisibility = mesh.visibility;
             this.onBindObservable.notifyObservers(mesh);
             if (this.disableDepthWrite) {
                 var engine = this._scene.getEngine();
@@ -25807,7 +25808,7 @@ var BABYLON;
         };
         PushMaterial.prototype._mustRebind = function (scene, effect, visibility) {
             if (visibility === void 0) { visibility = 0; }
-            return scene.isCachedMaterialValid(this, effect, visibility);
+            return scene.isCachedMaterialInvalid(this, effect, visibility);
         };
         return PushMaterial;
     }(BABYLON.Material));

Plik diff jest za duży
+ 1130 - 1130
dist/preview release/babylon.module.d.ts


Plik diff jest za duży
+ 15 - 15
dist/preview release/babylon.worker.js


Plik diff jest za duży
+ 1064 - 1064
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Plik diff jest za duży
+ 15 - 15
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


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

@@ -16574,8 +16574,8 @@ var BABYLON;
         Scene.prototype.getCachedVisibility = function () {
             return this._cachedVisibility;
         };
-        Scene.prototype.isCachedMaterialValid = function (material, effect, visibility) {
-            if (visibility === void 0) { visibility = 0; }
+        Scene.prototype.isCachedMaterialInvalid = function (material, effect, visibility) {
+            if (visibility === void 0) { visibility = 1; }
             return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility;
         };
         Scene.prototype.getBoundingBoxRenderer = function () {
@@ -25026,6 +25026,7 @@ var BABYLON;
         };
         Material.prototype._afterBind = function (mesh) {
             this._scene._cachedMaterial = this;
+            this._scene._cachedVisibility = mesh.visibility;
             this.onBindObservable.notifyObservers(mesh);
             if (this.disableDepthWrite) {
                 var engine = this._scene.getEngine();
@@ -25807,7 +25808,7 @@ var BABYLON;
         };
         PushMaterial.prototype._mustRebind = function (scene, effect, visibility) {
             if (visibility === void 0) { visibility = 0; }
-            return scene.isCachedMaterialValid(this, effect, visibility);
+            return scene.isCachedMaterialInvalid(this, effect, visibility);
         };
         return PushMaterial;
     }(BABYLON.Material));

Plik diff jest za duży
+ 1064 - 1064
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 1 - 0
src/Materials/babylon.material.ts

@@ -470,6 +470,7 @@
 
         protected _afterBind(mesh: Mesh): void {
             this._scene._cachedMaterial = this;
+            this._scene._cachedVisibility = mesh.visibility;
 
             this.onBindObservable.notifyObservers(mesh);
 

+ 1 - 1
src/Materials/babylon.pushMaterial.ts

@@ -42,7 +42,7 @@
         }
 
         protected _mustRebind(scene: Scene, effect: Effect, visibility: number = 0) {
-            return scene.isCachedMaterialValid(this, effect, visibility);
+            return scene.isCachedMaterialInvalid(this, effect, visibility);
         }
     }
 } 

+ 1 - 1
src/babylon.scene.ts

@@ -903,7 +903,7 @@
             return this._cachedVisibility;
         }
 
-        public isCachedMaterialValid(material: Material, effect: Effect, visibility: number = 0) {
+        public isCachedMaterialInvalid(material: Material, effect: Effect, visibility: number = 1) {
             return this._cachedEffect !== effect || this._cachedMaterial !== material || this._cachedVisibility !== visibility;
         }