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

Add sprite atlas generation code to 2D API. #7

Closed
Tape-Worm opened this issue May 2, 2019 · 1 comment
Closed

Add sprite atlas generation code to 2D API. #7

Tape-Worm opened this issue May 2, 2019 · 1 comment
Assignees
Labels
enhancement An enhancement to current functionality. feature-request A new feature for Gorgon or its tool(s). v3 Applies to version 3.x
Projects

Comments

@Tape-Worm
Copy link
Owner

Add a service object that allows a user to pass in a series of GorgonSprite objects to pack onto 1 or more texture atlases. Sprites will be returned that point at the new texture(s) when done.

The object should take:

  • A list of GorgonSprite objects.
  • A maximum 2D texture size.
  • A maximum array size.
  • The resulting texture format (limited to render target formats).
  • A padding so that textures won't necessarily touch each other.

When processing, this will take the sprite texture coordinates (converted to pixel coordinates), and copy that rectangle onto a destination texture. The algorithm will work similarly to the Glyph packing algorithm in GorgonFont and will try to utilize the space as best as it can. If the texture size/array size is exceeded, then a new texture should be created.

The processing method should return a data structure that contains:

  1. The texture atlas(es)
  2. The updated sprites.
@Tape-Worm Tape-Worm added the enhancement An enhancement to current functionality. label May 2, 2019
@Tape-Worm Tape-Worm self-assigned this May 2, 2019
@Tape-Worm Tape-Worm added this to ToDo in Gorgon May 2, 2019
@Tape-Worm Tape-Worm added feature-request A new feature for Gorgon or its tool(s). v3 Applies to version 3.x labels May 2, 2019
@Tape-Worm Tape-Worm moved this from ToDo to In Progress in Gorgon May 2, 2019
@Tape-Worm
Copy link
Owner Author

Texture atlas service is now in the 3.0 branch

Gorgon automation moved this from In Progress to Done May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to current functionality. feature-request A new feature for Gorgon or its tool(s). v3 Applies to version 3.x
Projects
Gorgon
  
Done
Development

No branches or pull requests

1 participant