I remember reading a 2007 SIGGRAPH paper about something similar Valve did in HL2 (or maybe it was Orange Box). Either way, it was a similar method of rendering vector textures via distance fields. Here it is: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_...
Show HN: GPU text rendering with vector textures
11–20 of 91 posts
Re: Show HN: GPU text rendering with vector textures
#12Re: Show HN: GPU text rendering with vector textures
#13See also: http://www.msr-waypoint.net/en-us/um/people/cloop/LoopBlinn0... (work done on the subject at Microsoft Research, with more of the math described).
This technique treats a pixel as a unit circle, coloring it according to its length of intersection, along multiple axes, with a glyph simply described by 3 point beziers, oriented to keep 'inside' on the right.
A point fully inside a glyph has a trivial intersection, and is fully shaded.
Points on the edge of a glyph intersect a bezier, with shading of the pixel being proportionate to the amount of intersection, giving anti-aliasing.
The product I work on in my day job has similar code to handle rendering filled polygons, with similar constraints on widdershins/anti-widdershins to turn off filling for 'holes'. The 'magic' of this technique seems to be applying that technique in a shader, on a per-pixel basis.
There's no triangulation that I can see (compare with the elaborate schemes Loop-Blinn paper above), just a decomposition of glyphs to these ordered collections of 3 point bezier curves, and some fiddling to get it all saved in a texture.
Re: Show HN: GPU text rendering with vector textures
#14Earlier quoted context omitted.
It's very laggy and slow on a quad i7 16GB Macbook Pro. Presumably this is because of the retina display.
Here's my experience on my local devices: * Quad i7 16 GBytes GTX 970 OSX FFox - perfectly smooth * iPhone 6s+ - very smooth * Nexus 6p - slightly jumpy / laggy but still impressive * Lumia 640 Windows Phone 10 - dFdx undeclared identifier (120,33) There may be issues with webgl on the MBP if it's using Intel graphics, but I'd be pretty disappointed to get worse performance than an iPhone ... For the curious, the Lum…
Re: Show HN: GPU text rendering with vector textures
#15Although cool, this is not a particularly novel idea. I remember reading a 2007 SIGGRAPH paper about something similar Valve did in HL2 (or maybe it was Orange Box). Either way, it was a similar method of rendering vector textures via distance fields. Here it is: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_...
Re: Show HN: GPU text rendering with vector textures
#16Although cool, this is not a particularly novel idea. I remember reading a 2007 SIGGRAPH paper about something similar Valve did in HL2 (or maybe it was Orange Box). Either way, it was a similar method of rendering vector textures via distance fields. Here it is: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_...
Re: Show HN: GPU text rendering with vector textures
#17See also: http://www.msr-waypoint.net/en-us/um/people/cloop/LoopBlinn0... (work done on the subject at Microsoft Research, with more of the math described).
Re: Show HN: GPU text rendering with vector textures
#18Earlier quoted context omitted.
Here's my experience on my local devices: * Quad i7 16 GBytes GTX 970 OSX FFox - perfectly smooth * iPhone 6s+ - very smooth * Nexus 6p - slightly jumpy / laggy but still impressive * Lumia 640 Windows Phone 10 - dFdx undeclared identifier (120,33) There may be issues with webgl on the MBP if it's using Intel graphics, but I'd be pretty disappointed to get worse performance than an iPhone ... For the curious, the Lum…
Yeah my rMBP uses an embedded Intel graphics card. The performance is horrible, ~2 fps, tried FF and Chrome.
Re: Show HN: GPU text rendering with vector textures
#19See also: http://www.msr-waypoint.net/en-us/um/people/cloop/LoopBlinn0... (work done on the subject at Microsoft Research, with more of the math described).
Just had a quick read though that paper, and it doesn't really look like the same thing. This technique treats a pixel as a unit circle, coloring it according to its length of intersection, along multiple axes, with a glyph simply described by 3 point beziers, oriented to keep 'inside' on the right. A point fully inside a glyph has a trivial intersection, and is fully shaded. Points on the edge of a glyph intersect a…
Re: Show HN: GPU text rendering with vector textures
#20It's a little odd to me that they describe distance fields as having an unavoidable problem with sharp corners, though. The Valve paper on signed distance fields for text demonstrates a simple workaround that fixes sharp corners...