Skip to content

Commit

Permalink
Merge pull request #13055 from BabylonJS/instances-neg-scaling
Browse files Browse the repository at this point in the history
Fix negative scaling issue with instances
  • Loading branch information
sebavan authored Oct 3, 2022
2 parents c4d6682 + 6e8d1cf commit d85572e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/dev/core/src/Meshes/mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
}

const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || subMesh.getRenderingMesh().hasThinInstances || !!this._userInstancedBuffersStorage;
const renderingMesh = subMesh.getRenderingMesh();
const hardwareInstancedRendering =
batch.hardwareInstancedRendering[subMesh._id] ||
renderingMesh.hasThinInstances ||
(!!this._userInstancedBuffersStorage && !subMesh.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh);
const instanceDataStorage = this._instanceDataStorage;

const material = subMesh.getMaterial();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/tools/tests/test/visualization/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"root": "https://cdn.babylonjs.com",
"tests": [
{
"title": "Negative scaling with instances",
"playgroundId": "#Z3YS9T#0",
"referenceImage": "negative scaling with instances.png"
},
{
"title": "Iridescence",
"playgroundId": "#2FDQT5#1505",
Expand Down

0 comments on commit d85572e

Please sign in to comment.