Skip to content

Half-pixel padding on atlasBounds #49

Answered by Chlumsky
jeremyabel asked this question in Q&A
Discussion options

You must be logged in to vote

No, you shouldn't truncate in the context of texture mapping.

It is to make sure that corners of the quads are in the middle of texels, to avoid having to add padding inbetween glyphs. The 0.5 pixels at the borders cannot be used in a meaningful way anyway, so saving a little bit of space in the atlas is the best solution.

In contexts where you need integer coordinates (e.g. when cutting up the atlas bitmap), you have to keep in mind that these coordinates correspond to the quad planeBounds, so those would also have to be changed accordingly in order to remain valid.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jeremyabel
Comment options

Answer selected by jeremyabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #48 on September 18, 2022 20:10.