Преглед изворни кода

Test shadowMap before push in renderTargets

Error when the shadowGenerator is dispose, the renderTargets doesn't have to push the shadow map.
The shadow map has to be test before push in the renderTargets list.
Clément Levasseur пре 11 година
родитељ
комит
4c6746ba5e
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      Babylon/babylon.scene.js

+ 2 - 2
Babylon/babylon.scene.js

@@ -760,7 +760,7 @@ var BABYLON = BABYLON || {};
             var light = this.lights[lightIndex];
             var shadowGenerator = light.getShadowGenerator();
 
-            if (light.isEnabled() && shadowGenerator) {
+            if (light.isEnabled() && shadowGenerator && shadowGenerator.getShadowMap()._scene.textures.indexOf(shadowGenerator.getShadowMap()) !== -1) {
                 this._renderTargets.push(shadowGenerator.getShadowMap());
             }
         }
@@ -1088,4 +1088,4 @@ var BABYLON = BABYLON || {};
     BABYLON.Scene.FOGMODE_EXP = 1;
     BABYLON.Scene.FOGMODE_EXP2 = 2;
     BABYLON.Scene.FOGMODE_LINEAR = 3;
-})();
+})();