I have some additional notes: * You talked about minified text looking bad. The main reason for this is the lack of dynamic dilation of the bounding polygon. You need to expand the boundary by half a pixel to ensure that the pixel shader is run for every pixel that is partially covered even a tiny bit. This can be done in the vertex shader given the current MVP matrix and viewport dimensions, but it's tricky. Without dilation, there are often pixels that are as much as 50% covered getting skipped during rasterization because the actual centers of the pixels fall outside the polygon being rendered. * You mentioned the use of multiple rays, as used by the Dobbie method, to perform antialiasing. It turns out that only two are necessary, a horizontal ray and a vertical ray, and these can be combined using a specially weighted average to accomplish nice antialiasing. Supersampling is a bad idea due to the limited number of samples and the horrible effect on performance. * A neat property of the quadratic formula of which most people seem to be unaware is that choosing the plus sign always gives you the root for which the derivative of the quadratic polynomial is positive, and choosing the minus sign always gives you the root for which the derivative is negative. It is never necessary to actually compute the derivative to determine which way a quadratic Bézier curve crosses a ray. * The banding technique you mentioned near the end of the video is described in the Slug paper. Listing only the Bézier curves that intersect each band, leaving out those parallel to the band, achieves a massive performance boost. Sorting the curves by their largest coordinate in the band direction doubles the speed by providing early-out opportunities. The Slug paper mentioned split bands in which a ray goes one direction or the opposite depending on where the pixel being rendered in located, but I have since determined that it's not worth the trouble and extra storage cost. * The Dobbie method divides a glyph into a grid instead of bands, where the idea is that there would be fewer curves to check in a grid square than an entire band. However, this approach fails pretty badly because the pixel footprint can become arbitrarily large at small text sizes, and extra (janky and slow) code and data needs to be added to account for multiple grid square being covered. Bands extending both directions without bound do not suffer from this problem.
"...were designed to meet anticipated needs which never materialized" - i love that sentence
A) I hate that math can be patented B) I had no idea how much math you had to do for just one letter
You're the Bob Ross of programming. Your videos are so relaxing to watch, the learning is just an added bonus.
As soon as you said "The Beauty of Bezier Curves" I knew exactly what was coming.
I've tried loading and rendering fonts multiple times but stopped because of the complexity everywhere. I continue to be amazed at the level of debugging tools you write! And I appreciate how much effort you spend forming your work into a journey that's easy to follow. Thanks for showing one path through the complexity and taking a relaxed/fun approach to it! I'm inspired to try again!
It shocks me when I realize how much effort has been put in all of these adventures and how much of this I don't see as the viewer. I mean 1) docs and articles research 2) implementing and debugging 3) coding interactive visualizations 4) coding debug tools 5) collecting all of the material into one smooth journey I'm pretty sure that I see just 10th part of all work been done to make this video happen. And the amount of behind the scenes work is the main reason why these adventures so interesting and comfortable to watch. Thank you for your job.
the true nature of programming is beautifully (and very scary) encapsulated in this video: simple and beautiful solutions break down against gazillion corner cases, floating point math and "bad" input
There is exactly one (1) Youtuber who I would watch talk about displaying fonts programmatically for 70 minutes, and thank you for being him
After spending a long week focusing on quadratics, I come home for the weekend to unwind to videos containing parabolas.
"because its something i take for granted" is such an amazing reason to explore a topic. Ive learned so much from diving into topics that i always took as too complicated and obtuse for me to learn, like memory allocation, terminal shells, and web servers, and they always end up being my favorite projects.
The worst part about watching a Sebastian Lague video: knowing you'll have to wait months for the next one...
Sebastian is the only person who can catch people's attention about FONTS for AN HOUR Dude your insane. I learn so much from every one of your videos. Keep uploading!
this entire video summarizes coding precisely; step 1. I want to make some kind of game engine! first off, I need to figure out how to render some text for the UI! step 162. it's been a few weeks and I've encountered one of the last bugs. I'm done coding after I get this text to render
The 'twilight zone' cut-away... so good Sebastian, you're moving into 'film maker' level production here you realize...
What I love about text is there's so much optional stuff that goes into rendering it besides drawing the glyphs like CTL, layout, pixel alignment, angry art leads complaining that the font looks terrible, ...
This video is pure art. I can't imagine that if I told anyone that I watched more than an hour long video on rendering fonts with a smile on my face, anyone would believe. But I did.
That explanation of Bezier curves was just genius. You tricked me into learning them, and now I'll never forget about them.
The most impressive thing in this video and the thing that baffles me the most is how you never got tired of trying again and again to solve the artifacts problem. After a few tries I would have quit right then and there but you didn't.
@IngieKerr