4 ms·
I have a similar technique before, embedding the entire font data in the fragment shader source code. Then you can use `snprintf` to directly print into a GPU b
by exDM69 2y ago
I have a similar technique before, embedding the entire font data in the fragment shader source code. Then you can use `snprintf` to directly print into a GPU buffer mapped to the CPU (this is a footgun, I know). Instead of drawing individual characters with a vertex shader, I've just drawn one full screen triangle and use `gl_FragCoord` instead of UV coordinates. Not the most efficient way of doing things but it's a debug feature and it's fast enough to be practical.
Despite what the filename says, this is using the font from the IBM PC ROM, not the NES. You can find the "NES font" and other 8x8 pixel fonts around the web.
https://github.com/rikusalminen/triangles/blob/nesfont/shaders/nesfont/nesfont.glslf https://github.com/rikusalminen/triangles/blob/nesfont/shade...
- LoganDark 2y ago> You can find the "NES font" and other 8x8 pixel fonts around the web. This is my favorite pixel font pack: https://int10h.org/oldschool-pc-fonts/ https://int10h.org/oldschool-pc-fonts/
- RiverCrochet 2y agoIncoming trivia: I finally found out recently that the "NES" font is from the 1976 arcade game Quiz Show. The font was used in other black-and-white Kee/Atari games. The font data is available in the quizshow MAME ROM set - split into nybbles for some reason. This game was interesting - it stored question and answer data on a 8-track tape.
- LocalH 2y agoThe font has slightly changed over the years. Notably, the "E" glyph originally had a longer lower arm, and the "!" and "?" glyphs are often different between variants of the font. Super Mario Bros also notably modifies the 8 to have a straight crossbar instead of intersecting spines.