Live data from Hacker News

Show HN: GPU text rendering with vector textures

wdobbie.com

11–20 of 91 posts

Re: Show HN: GPU text rendering with vector textures

#11
Although 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

#13
post #7

See 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 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

#14
post #8
post #5

Earlier 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…

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

#15
post #11

Although 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_...

...did you read the article? This exact paper was referenced in the second section.

Re: Show HN: GPU text rendering with vector textures

#16
post #11

Although 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_...

This isn't my field of expertise, so maybe I'm missing something, but the article cites the paper you describe in literally the second paragraph.

Re: Show HN: GPU text rendering with vector textures

#18
post #14
post #8

Earlier 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.

Even with a discrete card (M370x), the performance is poor on my rMBP. I only tried Chrome, though.

Re: Show HN: GPU text rendering with vector textures

#19
post #7

See 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…

Yes, it's a different technique, one that creates a triangle mesh from the curves first. Sorry for the lack of clarity in my original post.

Re: Show HN: GPU text rendering with vector textures

#20
This is a cool technique. The WebGL demonstration is pretty compelling!

It'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...

Post reply on HN