Просмотр исходного кода

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 лет назад
Родитель
Сommit
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;
-})();
+})();