Skip to content

Commit 7c19e77

Browse files
committed
Add batched meshes to chunk group
1 parent d19897c commit 7c19e77

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/webgl-preview.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ export class WebGLPreview {
202202
private devGui?: DevGUI;
203203
/** Whether to preserve drawing buffer */
204204
private preserveDrawingBuffer = false;
205+
private currentChunk: any;
205206

206207
/**
207208
* Creates a new WebGLPreview instance
@@ -763,7 +764,7 @@ export class WebGLPreview {
763764
}
764765
const chunk = new Group();
765766
chunk.name = 'chunk' + this.renderPathIndex;
766-
767+
this.currentChunk = chunk;
767768
const endPathNumber = Math.min(this.renderPathIndex + pathCount, this.job.paths.length - 1);
768769
this.renderPaths(endPathNumber);
769770
if (this._boundingBoxColor !== undefined) {
@@ -958,7 +959,7 @@ export class WebGLPreview {
958959
const batchedMesh = this.createBatchMesh(geometries, material);
959960
this.disposables.push(material);
960961

961-
this.group?.add(batchedMesh);
962+
this.currentChunk?.add(batchedMesh);
962963
}
963964

964965
/**

0 commit comments

Comments
 (0)