Closed trishume closed 5 years ago
A lot of the performance problems come down to vertex shading load. One of the problems with the VS load is that cubic-to-quadratic Bézier approximation was needlessly precise. I pushed a fix for that.
I should be able to reduce the vertex shading load by quite a bit, by consolidating duplicate vertices.
Yeah, so in theory we perform 8x the vertex shading load that is required (not counting additional vertices created from cubic-to-quadratic Bézier conversion). Each of these steps at most doubles the number of vertices to be shaded over those present in the input:
(1) is difficult to remove; it would require some sort of curve-aware triangulation algorithm that does not add Steiner vertices. (2) should be fixable by generating more traditional meshes instead of using instanced rendering on B-quads. (3) is fixable by either skipping the depth prepass (probably undesirable) or by transform feedback (OpenGL/OpenGL ES 3.0+, WebGL 2). Opt-in transform feedback seems doable, so I would say that we can probably cut the number of vertices to be transformed by a factor of 4.
Another possibility is to do a path simplification prepass if we know the resolution we're likely to be rendering at. This could be a dramatic win.
Not applicable to Pathfinder 3.
I was taking a look at some of the SVGs from http://w3.impa.br/~diego/projects/GanEtAl14/ in the current PathFinder and noticed many of them have artifacts. The Boston map has hairlines and the contours one has hairline cracks and is missing a bunch of triangles.
I also noticed the performance appears to be substantially worse than the numbers you gave way back when you had your Metal-based prototype. The Boston map and paper1 take around 35ms to render. Both of these are substantially smaller than the Paris map I had you render before (which I couldn't get to load now) which you said back then rendered in 3-4ms. Do you know why this might be?