-
Notifications
You must be signed in to change notification settings - Fork 21
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
Only emit triangles, regardless of GLU_TESS_EDGE_FLAG #9
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
saves 1942 bytes after minification, 720 bytes after gzip so far. Should squeeze out a few more after fixing up this lonely triangles business. |
unneeded since always one face per emitted primitive
brendankenny
changed the title
Remove triangle strip and fan output - DO NOT MERGE
Only emit triangles, regardless of GLU_TESS_EDGE_FLAG
Nov 11, 2014
🌳 |
final count is 2178 bytes saved on libtess.min.js, 774 bytes saved after gzip |
brendankenny
added a commit
that referenced
this pull request
Nov 11, 2014
Only emit triangles, regardless of GLU_TESS_EDGE_FLAG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Triangle strips and fans are generally not desirable (or at least not a win) on modern hardware, and libtess's output is just a decent-effort greedy-algorithm attempt at them anyway, with the possibility of many small, disconnected primitives, requiring primitive restarts or degenerate vertices between them.
This (in-progress) change makes it so libtess will always supply
GL_TRIANGLES
as a result. Previously you could trigger this mode by passing in anGLU_TESS_EDGE_FLAG
callback. It is now the only mode. You can still pass in aGLU_TESS_EDGE_FLAG
callback to get callbacks on whether an edge lies on the polygon boundary or not (see original README), but it is no longer necessary to get theGL_TRIANGLES
-only behavior.Technically libtess could already output a list of triangles for any input and you had to be prepared for it to do so, so this isn't a breaking change per se, but it is a change of output for the same input, so we'll probably increment the minor version number.