浏览代码

Fix Creating Cube Map again in PointLights

Sebastien Vandenberghe 8 年之前
父节点
当前提交
29a6f7f1b0

文件差异内容过多而无法显示
+ 4589 - 4589
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 6 - 6
dist/preview release/babylon.js


+ 10 - 0
dist/preview release/babylon.max.js

@@ -44327,12 +44327,18 @@ var BABYLON;
             }
             }
         };
         };
         ShadowGenerator.prototype.recreateShadowMap = function () {
         ShadowGenerator.prototype.recreateShadowMap = function () {
+            // Track render list.
+            var renderList = this._shadowMap.renderList;
             // Clean up existing data.
             // Clean up existing data.
             this._disposeRTTandPostProcesses();
             this._disposeRTTandPostProcesses();
             // Reinitializes.
             // Reinitializes.
             this._initializeGenerator(this.blurBoxOffset);
             this._initializeGenerator(this.blurBoxOffset);
+            // Reaffect the blur to ensure a correct fallback if necessary.
+            this.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap;
             // Reaffect the filter.
             // Reaffect the filter.
             this._applyFilterValues();
             this._applyFilterValues();
+            // Reaffect Render List.
+            this._shadowMap.renderList = renderList;
         };
         };
         /**
         /**
          * Boolean : true when the ShadowGenerator is finally computed.
          * Boolean : true when the ShadowGenerator is finally computed.
@@ -44480,15 +44486,19 @@ var BABYLON;
         ShadowGenerator.prototype._disposeRTTandPostProcesses = function () {
         ShadowGenerator.prototype._disposeRTTandPostProcesses = function () {
             if (this._shadowMap) {
             if (this._shadowMap) {
                 this._shadowMap.dispose();
                 this._shadowMap.dispose();
+                this._shadowMap = null;
             }
             }
             if (this._shadowMap2) {
             if (this._shadowMap2) {
                 this._shadowMap2.dispose();
                 this._shadowMap2.dispose();
+                this._shadowMap2 = null;
             }
             }
             if (this._downSamplePostprocess) {
             if (this._downSamplePostprocess) {
                 this._downSamplePostprocess.dispose();
                 this._downSamplePostprocess.dispose();
+                this._downSamplePostprocess = null;
             }
             }
             if (this._boxBlurPostprocess) {
             if (this._boxBlurPostprocess) {
                 this._boxBlurPostprocess.dispose();
                 this._boxBlurPostprocess.dispose();
+                this._boxBlurPostprocess = null;
             }
             }
         };
         };
         /**
         /**

文件差异内容过多而无法显示
+ 4589 - 4589
dist/preview release/babylon.module.d.ts


文件差异内容过多而无法显示
+ 9 - 9
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 5943 - 5943
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


文件差异内容过多而无法显示
+ 5943 - 5943
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


+ 10 - 2
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -345,14 +345,18 @@
         }
         }
 
 
         public recreateShadowMap(): void {
         public recreateShadowMap(): void {
+            // Track render list.
+            var renderList = this._shadowMap.renderList;
             // Clean up existing data.
             // Clean up existing data.
             this._disposeRTTandPostProcesses();
             this._disposeRTTandPostProcesses();
-
             // Reinitializes.
             // Reinitializes.
             this._initializeGenerator(this.blurBoxOffset);
             this._initializeGenerator(this.blurBoxOffset);
-
+            // Reaffect the blur to ensure a correct fallback if necessary.
+            this.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap;
             // Reaffect the filter.
             // Reaffect the filter.
             this._applyFilterValues();
             this._applyFilterValues();
+            // Reaffect Render List.
+            this._shadowMap.renderList = renderList;
         }
         }
 
 
         /**
         /**
@@ -532,18 +536,22 @@
         private _disposeRTTandPostProcesses(): void {
         private _disposeRTTandPostProcesses(): void {
             if (this._shadowMap) {
             if (this._shadowMap) {
                 this._shadowMap.dispose();
                 this._shadowMap.dispose();
+                this._shadowMap = null;
             }
             }
 
 
             if (this._shadowMap2) {
             if (this._shadowMap2) {
                 this._shadowMap2.dispose();
                 this._shadowMap2.dispose();
+                this._shadowMap2 = null;
             }
             }
 
 
             if (this._downSamplePostprocess) {
             if (this._downSamplePostprocess) {
                 this._downSamplePostprocess.dispose();
                 this._downSamplePostprocess.dispose();
+                this._downSamplePostprocess = null;
             }
             }
 
 
             if (this._boxBlurPostprocess) {
             if (this._boxBlurPostprocess) {
                 this._boxBlurPostprocess.dispose();
                 this._boxBlurPostprocess.dispose();
+                this._boxBlurPostprocess = null;
             }
             }
         }
         }