Explorar o código

Fix thin instance bounding info computation (#8740)

Popov72 %!s(int64=5) %!d(string=hai) anos
pai
achega
a8a88654d5

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

@@ -826,6 +826,8 @@ export class CascadedShadowGenerator extends ShadowGenerator {
 
 
         const world = mesh.getWorldMatrix();
         const world = mesh.getWorldMatrix();
 
 
+        effect.setMatrix(matriceNames?.world ?? "world", world);
+
         world.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer)!, tmpMatrix);
         world.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer)!, tmpMatrix);
 
 
         effect.setMatrix(matriceNames?.worldViewProjection ?? "worldViewProjection", tmpMatrix);
         effect.setMatrix(matriceNames?.worldViewProjection ?? "worldViewProjection", tmpMatrix);

+ 1 - 1
src/Meshes/thinInstanceMesh.ts

@@ -301,7 +301,7 @@ Mesh.prototype.thinInstanceRefreshBoundingInfo = function(forceRefreshParentInfo
         }
         }
     }
     }
 
 
-    boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]);
+    boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1], this.getWorldMatrix());
 };
 };
 
 
 Mesh.prototype._thinInstanceUpdateBufferSize = function(kind: string, numInstances: number = 1) {
 Mesh.prototype._thinInstanceUpdateBufferSize = function(kind: string, numInstances: number = 1) {