Skip to content

Commit

Permalink
Fix support for thin instances (#12416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popov72 committed Apr 20, 2022
1 parent 703dc93 commit 69bf0ee
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,16 @@ export class VolumetricLightScatteringPostProcess extends PostProcess {
}
}

if (hardwareInstancedRendering && renderingMesh.hasThinInstances) {
effect.setMatrix("world", effectiveMesh.getWorldMatrix());
}

// Draw
renderingMesh._processRendering(effectiveMesh, subMesh, effect, Material.TriangleFillMode, batch, hardwareInstancedRendering, (isInstance, world) =>
effect.setMatrix("world", world)
);
renderingMesh._processRendering(effectiveMesh, subMesh, effect, Material.TriangleFillMode, batch, hardwareInstancedRendering, (isInstance, world) => {
if (!isInstance) {
effect.setMatrix("world", world);
}
});
}
};

Expand Down

0 comments on commit 69bf0ee

Please sign in to comment.