Yeah, I addressed SDF in the next tweet: drawing the SDF is essentially equivalent to drawing paths on CPU.
-
-
Replying to @pcwalton
Oh sorry i was talking about continuous SDFs, like not made into a texture. A pixel is able to take a discrete sample of the continuous SDF and reconstruct.
1 reply 0 retweets 1 like -
Replying to @Atrix256
Oh, you mean something like constructing a voronoi diagram for edges and encoding distance to edge in each voronoi region?
1 reply 0 retweets 0 likes -
Replying to @pcwalton
Like mathematically defining some 2d shapes, possibly doing domain distortion (modify x values in strange ways), using modulus to repeat the shapes, and operations to combine the influence of multiple distance fields. Its not good for drawing text, but lemme grab a shadertoy rq.
2 replies 0 retweets 2 likes -
Replying to @Atrix256
Ah, I see, that’s cool! Not really relevant for <canvas>/SVG/text which are all about beziergon meshes though
1 reply 0 retweets 0 likes -
This looks relevant: https://www.shadertoy.com/view/Mlj3zD Compute SDF from bezier, evaluate per pixel.
2 replies 0 retweets 2 likes -
(1) This is exactly my point: drawing curves on GPU is easy. It’s drawing *polygons* (or beziergons) that is hard. (2) There’s a much more efficient way to draw cubic beziers, as shown by Taubin, “Distance approximations for rasterizing implicit curves” 1994
1 reply 0 retweets 6 likes -
(That paper is the basis of Loop/Blinn, and I use the technique to draw elliptical border radii in Firefox/WebRender. I should blog about it)
1 reply 0 retweets 3 likes -
Not saying that this is going to be more efficient, it's just a different approach that's neat, but you can do analytic SDFs polygons too (see https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm …).
2 replies 0 retweets 1 like -
This is more likely to be useful if you abandon SVG etc. and build up a new "shape language" with these sorts of primitives. I mean look at stuff like this: https://www.shadertoy.com/view/ld3Gz2 It's clearly fairly rich.
2 replies 0 retweets 0 likes
Honestly you could just preprocess everything up front into monotone polygons/beziergons and that would get you a lot of those benefits. https://en.wikipedia.org/wiki/Monotone_polygon … The entire point of a monotone polygon is that you only have to raytrace 1 edge to decide if a point is in or out
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.