Explorar o código

Fix: breaks not recalculated when num cascades changed

Popov72 %!s(int64=6) %!d(string=hai) anos
pai
achega
2e30cbc1ca
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/Lights/Shadows/cascadedShadowGenerator.ts

+ 3 - 1
src/Lights/Shadows/cascadedShadowGenerator.ts

@@ -688,7 +688,7 @@ export class CascadedShadowGenerator implements IShadowGenerator {
         this._light = light;
         this._mapSize = mapSize;
         light._shadowGenerator = this;
-        this.frustumLength = this._scene.activeCamera?.maxZ ?? 10000;
+        this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000;
 
         CascadedShadowGenerator._SceneComponentInitialization(this._scene);
 
@@ -779,6 +779,8 @@ export class CascadedShadowGenerator implements IShadowGenerator {
             this._light._markMeshesAsLightDirty();
             this.recreateShadowMap();
         });
+
+        this._initCascades();
     }
 
     private _renderForShadowMap(opaqueSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, depthOnlySubMeshes: SmartArray<SubMesh>): void {