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

Unindexed vec4 text coordinates for easy merging and manipulation #5

Closed
wants to merge 1 commit into from

Conversation

kig
Copy link

@kig kig commented Apr 29, 2016

#4 This PR changes the text coordinates from vec2 to vec4 and changes the geometry to use unindexed vertices.

The vec2->vec4 change makes it possible to re-position text geometry on Z & use the W-coord for alpha / palette index / bold flag.

The unindexed vertices change makes merging text geometries easy.

@gigablox
Copy link

"makes it possible to re-position text geometry on Z" - this will save me and my people.

@mattdesl
Copy link
Contributor

mattdesl commented Jul 2, 2020

Thanks but this diverges from the goal of having a small buffer footprint (also see #36). Perhaps something like this would be possible through an option, to allow users to expand the geometry positions to 3 or 4 dimensions, which provides some convenience at the expense of data storage and transfer speed.

And for Z positioning, usually I just reposition the Mesh. If you need per-glyph positioning or alpha or another feature, you can add your own attributes with geom.setAttribute. See the test-shader.js demo which adds per-glyph attribute specifying which line of text the glyph appears on.

@mattdesl mattdesl closed this Jul 2, 2020
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.

3 participants