瀏覽代碼

let users call the great wipe if required

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

File diff suppressed because it is too large
+ 5190 - 5190
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 10 - 10
dist/preview release/babylon.js


+ 9 - 6
dist/preview release/babylon.max.js

@@ -8905,17 +8905,20 @@ var BABYLON;
             return !!this._alphaTest;
         };
         // Textures
-        Engine.prototype.wipeCaches = function () {
+        Engine.prototype.wipeCaches = function (bruteForce) {
             if (this.preventCacheWipeBetweenFrames) {
                 return;
             }
             this.resetTextureCache();
             this._currentEffect = null;
-            // 6/8/2017: deltakosh: Should not be required anymore. This message is then mostly for the future myself which will scream out loud when seeing that actually it was required :)
-            // this._stencilState.reset();
-            // this._depthCullingState.reset();
-            // this.setDepthFunctionToLessOrEqual();
-            // this._alphaState.reset();
+            // 6/8/2017: deltakosh: Should not be required anymore. 
+            // This message is then mostly for the future myself which will scream out loud when seeing that actually it was required :)
+            if (bruteForce) {
+                this._stencilState.reset();
+                this._depthCullingState.reset();
+                this.setDepthFunctionToLessOrEqual();
+                this._alphaState.reset();
+            }
             this._cachedVertexBuffers = null;
             this._cachedIndexBuffer = null;
             this._cachedEffectForVertexBuffers = null;

File diff suppressed because it is too large
+ 5190 - 5190
dist/preview release/babylon.module.d.ts


File diff suppressed because it is too large
+ 19 - 19
dist/preview release/babylon.worker.js


+ 9 - 6
src/babylon.engine.ts

@@ -2266,18 +2266,21 @@
         }
 
         // Textures
-        public wipeCaches(): void {
+        public wipeCaches(bruteForce?: boolean): void {
             if (this.preventCacheWipeBetweenFrames) {
                 return;
             }
             this.resetTextureCache();
             this._currentEffect = null;
 
-            // 6/8/2017: deltakosh: Should not be required anymore. This message is then mostly for the future myself which will scream out loud when seeing that actually it was required :)
-            // this._stencilState.reset();
-            // this._depthCullingState.reset();
-            // this.setDepthFunctionToLessOrEqual();
-            // this._alphaState.reset();
+            // 6/8/2017: deltakosh: Should not be required anymore. 
+            // This message is then mostly for the future myself which will scream out loud when seeing that actually it was required :)
+            if (bruteForce) {
+                this._stencilState.reset();
+                this._depthCullingState.reset();
+                this.setDepthFunctionToLessOrEqual();
+                this._alphaState.reset();
+            }
 
             this._cachedVertexBuffers = null;
             this._cachedIndexBuffer = null;