Explorar el Código

Merge pull request #953 from Temechon/master

Fix bug when disposing the water material
Raanan Weber hace 9 años
padre
commit
789d7a4fed

+ 9 - 0
materialsLibrary/dist/babylon.waterMaterial.js

@@ -582,6 +582,15 @@ var BABYLON;
             if (this.bumpTexture) {
                 this.bumpTexture.dispose();
             }
+            var index = this.getScene().customRenderTargets.indexOf(this._refractionRTT);
+            if (index != -1) {
+                this.getScene().customRenderTargets.splice(index, 1);
+            }
+            index = -1;
+            index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT);
+            if (index != -1) {
+                this.getScene().customRenderTargets.splice(index, 1);
+            }
             if (this._reflectionRTT) {
                 this._reflectionRTT.dispose();
             }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
materialsLibrary/dist/babylon.waterMaterial.min.js


+ 11 - 0
materialsLibrary/materials/water/babylon.waterMaterial.ts

@@ -695,6 +695,17 @@ module BABYLON {
             if (this.bumpTexture) {
                 this.bumpTexture.dispose();
             }
+
+            var index = this.getScene().customRenderTargets.indexOf(this._refractionRTT);
+            if (index != -1){
+                this.getScene().customRenderTargets.splice(index, 1);
+            }
+            index = -1;
+            index = this.getScene().customRenderTargets.indexOf(this._reflectionRTT);
+            if (index != -1){
+                this.getScene().customRenderTargets.splice(index, 1);
+            }
+
             if (this._reflectionRTT) {
                 this._reflectionRTT.dispose();
             }