Browse Source

Fix instances support when determinant are different

David Catuhe 5 years ago
parent
commit
10007282bb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Meshes/mesh.ts

+ 1 - 1
src/Meshes/mesh.ts

@@ -1504,7 +1504,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         const onlyForInstances = isInIntermediateRendering ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances;
         const onlyForInstances = isInIntermediateRendering ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances;
         let batchCache = this._instanceDataStorage.batchCache;
         let batchCache = this._instanceDataStorage.batchCache;
         batchCache.mustReturn = false;
         batchCache.mustReturn = false;
-        batchCache.renderSelf[subMeshId] = !onlyForInstances && this.isEnabled() && this.isVisible;
+        batchCache.renderSelf[subMeshId] = isReplacementMode || (!onlyForInstances && this.isEnabled() && this.isVisible);
         batchCache.visibleInstances[subMeshId] = null;
         batchCache.visibleInstances[subMeshId] = null;
 
 
         if (this._instanceDataStorage.visibleInstances && !isReplacementMode) {
         if (this._instanceDataStorage.visibleInstances && !isReplacementMode) {