5 ms·
This is essentially how Pathfinder works, with 16x16 tiles instead of 32x32. It also has a pure-GPU mode that does tile setup on GPU instead of CPU, which is a
by pcwalton 4y ago
This is essentially how Pathfinder works, with 16x16 tiles instead of 32x32. It also has a pure-GPU mode that does tile setup on GPU instead of CPU, which is a nice performance boost, though a lot more complex. Note that if you're doing the setup on CPU, the work can be parallelized across cores and I highly recommend this for large scenes. The main difference, which isn't large, is that Pathfinder draws the tiles directly instead of drawing a large canvas-size quad and doing the lookup in the fragment shader.
When I originally checked, Slug works in a similar way but doesn't do tiling, so it has to process more edges per scanline than Pathfinder or piet-gpu. Slug has gone through a lot of versions since then though and I wouldn't be surprised if they added tiling later.
- moonchild 4y agoI thought pathfinder is scanline-oriented, using techniques similar to http://kunzhou.net/zjugaps/pathrendering/ http://kunzhou.net/zjugaps/pathrendering/ Tiling doesn't work too well under domain transforms--3d environments, dynamic zoom, etc. That's why I am betting on high-quality space partitioning. Slug space partitioning is not amazing; I believe it still processes O(n) curves per fragment in a horizontal band.
- jstimpfle 4y agoYou are literally talking to the Pathfinder author. I just implemented basically the same tiling mechanism, it works OK for me, I can already do about 1000 line segments, covering ~10000 tiles (multiply counting tiles that are touched by different polygons) in about 1ms on CPU and GPU each. Meaning the work is already quite well divided for my test cases. This is end to end without any caching. For static scenes doing world space partitioning is an idea that I considered, but for now I'm trying to optimize more in order to see what the limits of this basic approach are.
- pcwalton 4y ago> You are literally talking to the Pathfinder author. No worries, I think they know :) And yeah, I considered doing fancier partitioning, but really toward the end (before work stopped due to layoffs) I was pushing on shipping, which meant deprioritizing fancy partitioning in favor of implementing all the bells and whistles of SVG. I certainly believe that you could get better results with more sophisticated acceleration structures, especially in cases like texturing 3D meshes with vector textures.
- spartanatreyu 4y agoI do web and app dev, but I was always interested enough in servo, pathfinder, druid, tauri, etc... to keep tabs on them. What did you end up moving on to after pathfinder?
- Jasper_ 4y agoPathfinder 1 was a scanline approach. Pathfinder 2 was a tess-based approach. Pathfinder 3 is a tiles approach.
- coffeeaddict1 4y agoWould you recommend Pathfinder for real world use? Of course, I know that you're no longer working on it but would like to know if there any significant bugs/drawbacks in using it. For context, I'm coding a simple vector graphics app that needs to resize and render quite complex 2d polycurves in real time. So far, the only thing I found working was Skia which is good but not fast enough to do the stuff I need in real time (at least on low end devices).
- Jasper_ 4y agopathfinder is dead -- pcwalton works at Meta now, and not on graphics.
- coffeeaddict1 4y agoYes, I know that the project hasn't got a bright future unfortunately. What I was more interested in was its current stability and correctness. I wouldn't mind using it if it was relatively stable and free of bugs.