Myth: Vector graphics on GPU is hard because GPUs only know how to draw triangles, not curves. In fact, anyone who has touched a pixel shader in Unity can make a GPU draw a filled circle…
-
Show this thread
-
Rather, vector graphics on GPU is hard because GPUs don’t know how to draw filled *polygons*. That’s because fill rules are inherently sequential: whether a pixel is filled depends on every pixel before it in the scanline.
2 replies 5 retweets 43 likesShow this thread -
How to deal with this problem? Some choices are (1) draw paths on CPU and treat as a texture (perhaps SDF); (2) brute force using stencil buffer; (3) brute force in the shader; (4) partition with a CPU prepass (Pathfinder); (5) partition with a compute shader prepass (MPVG).
1 reply 0 retweets 33 likesShow this thread -
Replying to @pcwalton
(6) tessellate meshes on cpu, (7) fill scanlines in compute (tricky but technically doable and not brute force, would love to see more research exploring this)
1 reply 0 retweets 1 like -
Replying to @nicalsilva @pcwalton
Tessellation is kinda worth mentioning since for anything but text it is by a very large margin the approach that shipped the most so far.
1 reply 0 retweets 1 like
Not sure about that—stencil buffer brute force (e.g. NVPR, NanoVG) seems to be very popular too
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.