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

Texture atlas for glyphs using new heuristic texture packer #1115

Merged
merged 8 commits into from May 23, 2019

Conversation

@bvssvni
Copy link
Member

commented May 21, 2019

This PR adds a new heuristic texture packer which works pretty decently without backtracking or future knowledge of tiles (skyline). The algorithm is O(N^2) for packing a new tile where N is the number of points in the skyline. Since this is usually a low number, the packing is pretty fast. It means it can e.g. pack glyphs into textures with hard performance guarantees that there will be no re-packing later.

  • Updated RustType glyph cache to use the new heuristic texture packer
  • Updated Character with fields for sub-rectangles

bvssvni added some commits May 21, 2019

Use `src_rect` on glyphs
- Store textures in glyph cache in separate array.
Use skyline terminology
- Use `ATLAS_SIZE` instead to two separate constants
@bvssvni

This comment has been minimized.

Copy link
Member Author

commented May 23, 2019

Merging.

@bvssvni bvssvni merged commit 4b4e797 into PistonDevelopers:master May 23, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bvssvni bvssvni deleted the bvssvni:glyph_texture branch May 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.