Skip to content
Open
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
5 changes: 5 additions & 0 deletions packages/troika-three-text/src/GlyphsGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class GlyphsGeometry extends InstancedBufferGeometry {
// Preallocate empty bounding objects
this.boundingSphere = new Sphere()
this.boundingBox = new Box3()

// Prevent rendering while we don't have any glyphs
this.instanceCount = 0
this.setDrawRange(0, 0)
}

computeBoundingSphere () {
Expand Down Expand Up @@ -124,6 +128,7 @@ class GlyphsGeometry extends InstancedBufferGeometry {
this._blockBounds = blockBounds
this._chunkedBounds = chunkedBounds
this.instanceCount = glyphAtlasIndices.length
this.setDrawRange(0, Infinity)
this._updateBounds()
}

Expand Down