Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging text geometries is difficult #4

Open
kig opened this issue Apr 29, 2016 · 2 comments
Open

Merging text geometries is difficult #4

kig opened this issue Apr 29, 2016 · 2 comments

Comments

@kig
Copy link

kig commented Apr 29, 2016

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).

@mattdesl
Copy link
Contributor

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.

@mister-walter
Copy link

I'm also interested in merging geometries for performance purposes - is there anything I can do to help the PR get merged?

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

No branches or pull requests

3 participants