You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In making the text renderer for https://tabletree.io and http://fhtr.org/textclock I had to do a couple of optimizations to get decent performance. THREE.js objects are pretty heavy, so you'll run into trouble after a few hundred of them. For better performance, you need to merge the text geometries into a single big geometry.
The three-bmfont-text text geometries use vertex indices and are defined as arrays of vec2s. This works a-ok if you don't need to merge geometries. But if you do need to merge geometries, using vec4s for position allows you to position the text verts in 3D (and you get to use the w-coord for random shenanigans.) Additionally, using unindexed vertices makes it a lot simpler to merge two geometries together, for a small bandwidth hit, and a small bufferData speed boost (drawElements has to validate all the element indices).
The text was updated successfully, but these errors were encountered:
Yup, I was thinking maybe it would be good to have a more generic module that just provides vertex data in flat arrays. It can be optimized to reduce GC etc, and could be generic enough that it doesn't need to depend on ThreeJS.
In making the text renderer for https://tabletree.io and http://fhtr.org/textclock I had to do a couple of optimizations to get decent performance. THREE.js objects are pretty heavy, so you'll run into trouble after a few hundred of them. For better performance, you need to merge the text geometries into a single big geometry.
The three-bmfont-text text geometries use vertex indices and are defined as arrays of vec2s. This works a-ok if you don't need to merge geometries. But if you do need to merge geometries, using vec4s for position allows you to position the text verts in 3D (and you get to use the w-coord for random shenanigans.) Additionally, using unindexed vertices makes it a lot simpler to merge two geometries together, for a small bandwidth hit, and a small bufferData speed boost (drawElements has to validate all the element indices).
The text was updated successfully, but these errors were encountered: