Text Texture Atlas


So I got thinking about what I should do with regards to text as of late.
Drawing potentially up to 64 quads per glyph really doesn't seem as appealing as just drawing one quad that knows what uvs to sample for that given glyph, so I decided to just figure out a way to make a resolution independent text texture atlas.

Thus far, I got it to start working but still haven't gotten it fully working quite yet. So what I mean by this is that it only fills pixels in any sized textured at the moment but only fills the 8x8 pixels and doesn't scale that 8x8 grid out to cover N pixels based on resolution.

And that in and of itself really should just be the solution to have a resolution independent texture atlas. I'm still going to make it kinda jank by just rounding up or down based on the current resolution and number of glyphs I want to store in the atlas  before deciding the number of pixels you fill per singular traversal of the 8x8.

So just to give an example, say the texture is 1024 x 1024, I still don't know the math for it all, but it should be that you take the width and height and figure out how many pixels per width and height you can fill relative to the number of glyphs you want to store in the atlas. You'll round down or up once you do this supposed division and then just, for the current grid cell in the 8x8, go for the N pixels you just figured out.
That's it! I plan to have all this working on Thursday so look forward to that :] In the meantime, please let me know your thoughts on the current build of the game! Thank you for reading and have an awesome day!

Files

Funmi_Zip.7z 4 MB
Nov 13, 2021

Get Funmi

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.