Explorar o código

Fix unitialized variable in first frame

Popov72 %!s(int64=5) %!d(string=hai) anos
pai
achega
8cea0b286e
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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) {