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

Only emit triangles, regardless of GLU_TESS_EDGE_FLAG #9

Merged
merged 13 commits into from Nov 11, 2014

Conversation

brendankenny
Copy link
Owner

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 an GLU_TESS_EDGE_FLAG callback. It is now the only mode. You can still pass in a GLU_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 the GL_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.

@coveralls
Copy link

Coverage Status

Coverage increased (+9.1%) when pulling de8a3aa on onlyTriangles into 7c00225 on gh-pages.

@brendankenny
Copy link
Owner Author

saves 1942 bytes after minification, 720 bytes after gzip so far. Should squeeze out a few more after fixing up this lonely triangles business.

@coveralls
Copy link

Coverage Status

Coverage increased (+9.06%) when pulling a5712d3 on onlyTriangles into 7c00225 on gh-pages.

@coveralls
Copy link

Coverage Status

Coverage increased (+9.13%) when pulling 07f572b on onlyTriangles into 7c00225 on gh-pages.

@coveralls
Copy link

Coverage Status

Coverage increased (+9.05%) when pulling cee92cb on onlyTriangles into 7c00225 on gh-pages.

@coveralls
Copy link

Coverage Status

Coverage increased (+9.14%) when pulling f354cc1 on onlyTriangles into 7c00225 on gh-pages.

@brendankenny 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
@brendankenny
Copy link
Owner Author

🌳

@brendankenny
Copy link
Owner Author

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
@brendankenny brendankenny merged commit 96e6df7 into gh-pages Nov 11, 2014
@brendankenny brendankenny deleted the onlyTriangles branch November 11, 2014 01:54
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.

None yet

2 participants