فهرست منبع

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) {