SDF seems to be one of the better solutions for text rendering. Valve had this problem solved since 2007. I'd argue this technique is a big part of what gave TF2 its impressive visual style. That game ran at 100+ fps on hardware like the 8800GT at the time. https://www.redblobgames.com/x/2403-distance-field-fonts/
Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
11–20 of 42 posts
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#12Stupid question but what are the units used in the results tables??
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#13This website almost crashed my m1 macbook pro (renders at 1 fps or something), so I guess point taken: rendering text is not simple!
And on my desktop, scrolling this page is painfully slow. Author: frontend technical lead, setting high code standards
Haha, to be fair it's common to half-ass personal projects even if it's your primary domain.
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#14Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#15This website almost crashed my m1 macbook pro (renders at 1 fps or something), so I guess point taken: rendering text is not simple!
Edit: This is with Firefox 144 on Ubuntu 22.04
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#16Earlier quoted context omitted.
And on my desktop, scrolling this page is painfully slow. Author: frontend technical lead, setting high code standards
what's worse is that scrolling doesn't actually work unless you have the text area focused/under the wheel... very weird. Which is even worse for PgUp/Down as who would think to focus the area first for scrolling???
Sadly, this problem is common enough that click-before-keyboard-scrolling has become second nature for me.
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#17This website almost crashed my m1 macbook pro (renders at 1 fps or something), so I guess point taken: rendering text is not simple!
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#18I wonder how the GPU version is implemented. One quad and one texture draw per glyph sounds very not scalable, but one quad per terminal, one texture atlas and one shader to draw glyphs from the atlas already sounds much better.
Runs at ~1500 FPS with a 6K screen of full text on my machine even when text is being updated at about the pace of a 150 WPM typist but you only update quads that strictly need to change and store font metrics on the GPU in a buffer. A full screen refresh where you send quad data for 750 Lorem ipsum paragraphs every frame runs at 300 FPS on my hardware.
Re: Drawing Text Isn't Simple: Benchmarking Console vs. Graphical Rendering
#19SDF seems to be one of the better solutions for text rendering. Valve had this problem solved since 2007. I'd argue this technique is a big part of what gave TF2 its impressive visual style. That game ran at 100+ fps on hardware like the 8800GT at the time. https://www.redblobgames.com/x/2403-distance-field-fonts/
SDF is awesome but even then it's not a silver bullet. It's a raster technique and some people want vector fonts or subpixel rendering.