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

Improvement, colors #14

Open
Samsy opened this issue Jan 30, 2017 · 1 comment
Open

Improvement, colors #14

Samsy opened this issue Jan 30, 2017 · 1 comment

Comments

@Samsy
Copy link

Samsy commented Jan 30, 2017

What do you think of passing colors through geometry attributes instead as an uniform ?
So multiple text could share the same material / textures, and could even support multi color text.

@mattdesl
Copy link
Contributor

mattdesl commented Jan 30, 2017

Yeah, I think it would work though I'm curious how the API would look. Using attribute strings (where a paragraph is made up of chunks of strings with things like font style/color/size/etc) can get really complicated really quickly.

Ideally this module could handle all that stuff but it can become very application-dependent. Some apps might want to pack multiple font styles into the same atlas, so a chunk of text can be drawn in the same call. Other apps might prefer to implement color as a palette index to save vertex data (see here).

Maybe another approach is to expose the glyphs in a nice way so that it's easy to build your own vertex attributes on top of this BufferGeometry, suited to your application.

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

2 participants