소스 검색

Fix unitialized variable in first frame

Popov72 5 년 전
부모
커밋
8cea0b286e
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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) {