Browse Source

Fix unitialized variable in first frame

Popov72 5 years ago
parent
commit
8cea0b286e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/Lights/Shadows/shadowGenerator.ts

+ 2 - 0
src/Lights/Shadows/shadowGenerator.ts

@@ -1059,6 +1059,8 @@ export class ShadowGenerator implements IShadowGenerator {
 
             renderingMesh._bind(subMesh, effect, material.fillMode);
 
+            this.getTransformMatrix(); // make sur _cachedDirection et _cachedPosition are up to date
+
             effect.setFloat3("biasAndScaleSM", this.bias, this.normalBias, this.depthScale);
 
             if (this.getLight().getTypeID() === Light.LIGHTTYPEID_DIRECTIONALLIGHT) {