Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104122

Anti-aliased curve rendering for shapes

    XMLWordPrintable

Details

    • User Story
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.4.0 FF
    • None
    • All
    • be813b995 (dev), 4a1e5d8e7 (dev), 69225ac60 (6.6), 73324c379 (dev), 218507a8a (6.6), ec6c05f4c (dev), 84d719baa (6.6), eb6af63f6 (dev), aca17e677 (6.6), 5546f41b0 (dev), 8ee3871d8 (6.6)

    Description

      Qt Quick Shape is Qt Quick's solution to rendering arbitrary painter paths.

      The current approach in Qt subdivides and flattens curves and then triangulates the resulting shape. This looks good at scales close to the original size, but if you zoom too far you will see the straight edges and will have to regenerate the mesh for it to look correct. It also currently depends on MSAA for antialiasing.

      If we could render the curves on the GPU, then we could generate the render data for the shape only once and keep it there. There are multiple ways of doing this, but we have decided to investigate an approach like https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf but only for quadratic curves.

      A proof-of-concept is available at https://codereview.qt-project.org/c/qt/qtdeclarative/+/430854

      The renderer will be opt-in and the default will still be the flattening algorithm, so it does not need to cover all corner cases, but it should be robust and as complete as possible. It should have built-in support for anti-aliasing and we should consider animation a prime use case, which probably means that generating the meshes has to be very fast.

      Other approaches are: https://medium.com/@evanwallace/easy-scalable-text-rendering-on-the-gpu-c3f4d782c5ac which requires a pre-pass for rendering the shape which might be expensive on a lot of hardware.

      Distance fields are also relevant for this, but since generating the distance fields themselves is so expensive, it will not perform well enough for animated shapes, so this was not explored.

      Attachments

        Issue Links

          1.
          Support gradient fills Technical task Closed Eskil Abrahamsen Blomfeldt
          2.
          Anti-aliasing for straight boundary lines Technical task Closed Eskil Abrahamsen Blomfeldt
          3.
          Support overlapping curves Technical task Closed Qt Graphics Team
          4.
          Support more complex paths Technical task Closed Qt Graphics Team
          5.
          Support asynchronous loading/processing Technical task Closed Qt Graphics Team
          6.
          Make updating stroke/fill cause the shape to update correctly Technical task Closed Paul Olav Tvete
          7.
          Implement aliased version Technical task Closed Qt Graphics Team
          8.
          Split cubic curves into quadratic curves Technical task Closed Eirik Aavitsland
          9.
          Self-intersecting shapes Technical task Closed Amr Elsayed
          10.
          Antialiasing artifacts and triangulation Technical task Closed Paul Olav Tvete
          11.
          Changing shapeBackend at runtime Technical task Closed Eskil Abrahamsen Blomfeldt
          12.
          Convex/concave check not working Technical task Closed Eskil Abrahamsen Blomfeldt
          13.
          Anti-aliasing on straight lines don't line up Technical task Closed Paul Olav Tvete
          14.
          Approximately flat curves or parts of curves are aliased Technical task Closed Paul Olav Tvete
          15.
          Improve memory leak Technical task Closed Qt Graphics Team
          16.
          Investigate better triangulation algorithm Technical task Closed Eskil Abrahamsen Blomfeldt
          17.
          Simplify curvature detection Technical task Closed Eskil Abrahamsen Blomfeldt
          18.
          High-level optimization: Add path property flags to the API Technical task Closed Paul Olav Tvete
          19.
          Improve QuadPath tree storage structure Technical task Closed Eirik Aavitsland
          20.
          Improve QuadPath's point storage Technical task Closed Eirik Aavitsland
          21.
          Improve QuadPath::contains() Technical task Closed Eirik Aavitsland
          22.
          Make QuadPath detect quadratic curves that are in fact lines Technical task Closed Eirik Aavitsland
          23.
          Skip empty elements in QuadPath Technical task Closed Eirik Aavitsland
          24.
          Overlap solver leaves self-intersecting edges Technical task Closed Qt Graphics Team
          25.
          Detect self-intersections in Delaunay code Technical task Closed Eskil Abrahamsen Blomfeldt
          26.
          Graceful handling of self-intersecting shapes Technical task Closed Matthias Rauter
          27.
          Add special case for arcs Technical task Closed Qt Graphics Team
          28.
          Stroke with of outline shader does not match QPainter Technical task Closed Paul Olav Tvete
          29.
          Handle degenerate triangles Technical task Closed Qt Graphics Team
          30.
          Missing edge when triangulating some SVGs Technical task Closed Eskil Abrahamsen Blomfeldt
          31.
          Infinite loop in triangulator Technical task Closed Eskil Abrahamsen Blomfeldt
          32.
          Unable to find triangle containing point Technical task Closed Eskil Abrahamsen Blomfeldt
          33.
          Split edges that touch two unrelated points in triangulation Technical task Closed Eskil Abrahamsen Blomfeldt
          34.
          Curve stroker: Antialiasing artifacts Technical task Closed Matthias Rauter
          35.
          Fix overlap detection for concave join points Technical task Closed Qt Graphics Team
          36.
          Reduce size of external fill triangles Technical task Closed Paul Olav Tvete
          37.
          Add support for cosmetic pens Technical task Closed Qt Graphics Team
          38.
          Combined stroke/fill shader Technical task Closed Qt Graphics Team
          39.
          Implicit size for shapes Technical task Closed Qt Graphics Team
          40.
          Example/demo Technical task Closed Qt Graphics Team
          41.
          Further API improvement ideas Technical task Closed Qt Graphics Team
          42.
          Parallelize path processing to increase performance Technical task Closed Qt Graphics Team
          43.
          Maintain z-ordering of paths Technical task Closed Eirik Aavitsland
          For Gerrit Dashboard: QTBUG-104122
          # Subject Branch Project Status CR V

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: