Skip to content

Conversation

@AlaricBaraou
Copy link
Contributor

@AlaricBaraou AlaricBaraou commented Sep 10, 2025

Currently, because of three.js src\renderers\WebGLRenderer.js logic and the default instanceCount of InstancedBufferGeometry being Infinity, the renderer will attempt to render an infinite number of triangle while GlyphsGeometry wait for its first call to updateGlyphs.

This results in three.js WebGL.info displaying "Infinity" next to the triangle counter.

infinite.mp4

This also cause WebGLRenderer to try to make a render call with something that isn't ready, calling different binding etc as there is no early exit in the current state.

In this PR by setting instanceCount to 0 and drawRange to (0, 0) in the constructor, it'll guarantee that three.js WebGLRenderer early exit the render call for the current Text.
It should slighly improve the time to first render of the Text even though it's already barely noticeable while also preventing this confusing "Infinity" in the webgl infos whenever a new Text is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant