Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix negative scaling issue with instances #13055

Merged
merged 3 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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