3 ms·
This is delightfully clever and hacky (so basically like every 3d rendering technique ever) but the end result isn't exactly beautiful unless you're trying to r
by esperent 2y ago
This is delightfully clever and hacky (so basically like every 3d rendering technique ever) but the end result isn't exactly beautiful unless you're trying to recreate an old school electronic billboard. You could improve it by adding more bits, but long before it starts to look good you'd be searching for an easier way to handle setting all the bits... And there's almost certainly no more efficient solution than using black and white pixels in a drawing program then saving the results in a texture. So, full circle.
If anyone is interested in the a more common way that modern 3d rendering engines draw text, look up SDF text (and related techniques like MSDF etc.). This uses a traditional texture atlas in a preprossing step to create an atlas of signed distance fields.
- 082349872349872 2y ago> So, full circle In case anyone hasn't yet seen the 1968 full circle paper, "On the Design of Display Processors": http://cva.stanford.edu/classes/cs99s/papers/myer-sutherland-design-of-display-processors.pdf http://cva.stanford.edu/classes/cs99s/papers/myer-sutherland... Hardware in their case, but we also have software saṃsāra.
- noduerme 2y agoIt is pretty clever for debug text if, for instance, textures aren't uploading properly. But uh... while it's cute that the OP compares sprite sheets to 16th century manual typesetting, the reality is that it took a printer's assistant an hour to layout a broadsheet of tiny metal slugs on a press, and it takes oh < 10ms to upload a spritesheet to a GPU, which is then infinitely configurable. Not saying it's not a neat trick, it is.
- swiftcoder 2y ago> If anyone is interested in the a more common way that modern 3d rendering engines draw text, look up SDF text (and related techniques like MSDF etc.). This is now at least a generation out of date. Pretty much everyone is now using approaches like https://sluglibrary.com https://sluglibrary.com, where one directly rasterises the font bezier curves in a shader. I cooked up a (very basic) version of the concept a while back: https://www.shadertoy.com/view/sdXBDs https://www.shadertoy.com/view/sdXBDs