Browse Source

Fix: cascade splits not updated when lambda changed

Popov72 5 years ago
parent
commit
b3312e77b3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Lights/Shadows/cascadedShadowGenerator.ts

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

@@ -486,11 +486,11 @@ export class CascadedShadowGenerator implements IShadowGenerator {
      * Sets csmLambda: parameter used for calculating the frustum in CSM.
      * Sets csmLambda: parameter used for calculating the frustum in CSM.
      */
      */
     public set lambda(value: number) {
     public set lambda(value: number) {
-        this._lambda = Math.min(Math.max(value, 0), 1);
-        if (this._lambda == value) {
+        const lambda = Math.min(Math.max(value, 0), 1);
+        if (this._lambda == lambda) {
             return;
             return;
         }
         }
-        this._lambda = value;
+        this._lambda = lambda;
         this._initCascades();
         this._initCascades();
     }
     }