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

Gutter usage #46

Closed
cdcseacave opened this issue Feb 8, 2020 · 3 comments
Closed

Gutter usage #46

cdcseacave opened this issue Feb 8, 2020 · 3 comments
Labels

Comments

@cdcseacave
Copy link

Great library, it works as I was hopping, thank you.
I am not sure if it's an issue or simply I do not know how to use it: I expect by setting the gutter parameter for ex to 2, that the atlas packing reserves an extra border of 2 pixels thickness around each chart. However when I draw the texture using the computed uv coordinates the charts are using the entire space (touche the limits of the image) without letting any space for me to fill in with the border pixels.
I feel I am missing something fundamental here, pls help.

@walbourn
Copy link
Member

walbourn commented Feb 8, 2020

See the wiki:

gutter: The minimum distance, in texels between two charts on the atlas. This gets scaled by the width, so if gutter is 2.5, and it is used on a 512x512 texture, then the minimum distance will be 2.5 / 512 in u-v space.

@walbourn walbourn closed this as completed Feb 8, 2020
@cdcseacave
Copy link
Author

cdcseacave commented Feb 9, 2020

I saw the wiki, but I wrote here as that is not enough. So now it is clear this is an issue and not a misunderstanding. How is anybody able to add any extra pixels around the charts (for bilinear interpolation, etc) if they extend to the image limits??? The gutter should be between charts but ALSO between charts and the image limits! the only option now is to give you a smaller image resolution, and after your lib to shift all texture coordinates!!! Possible, but not too smart, right?

@cdcseacave
Copy link
Author

cdcseacave commented Feb 9, 2020

And after looking into the code trying to fix it myself, it turns out even the documentation is wrong, 2 mistakes:

  • it can not be a float value like 2.5, as the first thing that happens inside the lib is to convert it to int
  • second the empty space seems to be 2*gutter (as it should be normal actually) and not just gutter as in the docs
  • and for completeness, no gutter between the charts and image limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants