Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

GPU-friendly Stroke Expansion

Published: 09 August 2024 Publication History
  • Get Citation Alerts
  • Abstract

    Vector graphics includes both filled and stroked paths as the main primitives. While there are many techniques for rendering filled paths on GPU, stroked paths have proved more elusive. This paper presents a technique for performing stroke expansion, namely the generation of the outline representing the stroke of the given input path. Stroke expansion is a global problem, with challenging constraints on continuity and correctness. Nonetheless, we implement it using a fully parallel algorithm suitable for execution in a GPU compute shader, with minimal preprocessing. The output of our method can be either line or circular arc segments, both of which are well suited to GPU rendering, and the number of segments is minimal. We introduce several novel techniques, including an encoding of vector graphics primitives suitable for parallel processing, and an Euler spiral based method for computing approximations to parallel curves and evolutes.

    Supplemental Material

    GZ File - supplemental material
    supplemental dataset

    References

    [1]
    Dale Connor and Lilia Krivodonova. 2014. Interpolation of two-dimensional curves with Euler spirals. J. Comput. Appl. Math. 261 (2014), 320--332. https://doi.org/10.1016/j.cam.2013.11.009
    [2]
    R. T. Farouki and C. A. Neff. 1990. Algebraic properties of plane offset curves. Comput. Aided Geom. Des. 7, 1-4 (jun 1990), 101--127. https://doi.org/10.1016/0167-8396(90)90024-L
    [3]
    Francisco Ganacim, Rodolfo S. Lima, Luiz Henrique de Figueiredo, and Diego Nehab. 2014. Massively-parallel vector graphics. ACM Transactions on Graphics 33, 6 (2014), 1--14. https://doi.org/10.1145/2661229.2661274
    [4]
    The gfx-rs authors. 2024. gfx-rs/wgpu. https://github.com/gfx-rs/wgpu
    [5]
    Ron Goldman. 2003. Chapter 5 - Bezier Approximation and Pascal's Triangle. In Pyramid Algorithms, Ron Goldman (Ed.). Morgan Kaufmann, San Francisco, 187--306. https://doi.org/10.1016/B978-155860354-7/50006-4
    [6]
    Google. 2024. Skia. https://skia.org
    [7]
    Adobe Systems Incorporated. 2008. Document management -- Portable document format -- Part 1: PDF 1.7. https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
    [8]
    Mark J. Kilgard. 2020a. Anecdotal Survey of Variations in Path Stroking among Real-world Implementations. arXiv:2007.12254
    [9]
    Mark J. Kilgard. 2020b. Polar Stroking: New Theory and Methods for Stroking Paths. ACM Trans. Graph. 39, 4, Article 145 (Aug. 2020), 15 pages. https://doi.org/10.1145/3386569.3392458
    [10]
    Benjamin B. Kimia, Ilana Frankel, and Ana-Maria Popescu. 2003. Euler Spiral for Shape Completion. International Journal of Computer Vision 54, 1 (01 Aug 2003), 159--182. https://doi.org/10.1023/A:1023713602895
    [11]
    Samuli Laine and Tero Karras. 2011. High-Performance Software Rasterization on GPUs. HPG '11: Proceedings of the ACM SIGGRAPH Symposium on High Performance Graphics (2011), 79--88. https://doi.org/10.1145/2018323.2018337
    [12]
    Raph Levien. 2021. Cleaner parallel curves with Euler spirals. https://raphlinus.github.io/curves/2021/02/19/parallelcurves.html
    [13]
    Georg Maier. 2014. Optimal arc spline approximation. Computer Aided Geometric Design 31, 5 (2014), 211--226. https://doi.org/10.1016/j.cagd.2014.02.011
    [14]
    D. S. Meek and D. J. Walton. 2004. An arc spline approximation to a clothoid. J. Comput. Appl. Math. 170, 1 (2004), 59--77. https://doi.org/10.1016/j.cam.2003.12.038
    [15]
    MotionMark. 2021. MotionMark 1.2. https://browserbench.org/MotionMark1.2/about.html
    [16]
    Smita Narayan. 2014. Approximating Cornu spirals by arc splines. J. Comput. Appl. Math. 255, 1 (2014). https://doi.org/10.1016/j.cam.2013.06.038
    [17]
    Diego Nehab. 2020. Converting Stroked Primitives to Filled Primitives. ACM Trans. Graph. 39, 4, Article 137 (Aug. 2020), 17 pages. https://doi.org/10.1145/3386569.3392392
    [18]
    Taweechai Nuntawisuttiwong and Natasha Dejdumrong. 2021. An Approximation of Bézier Curves by a Sequence of Circular Arcs. Information Technology and Control 50, 2 (2021). https://doi.org/10.5755/j01.itc.50.2.25178
    [19]
    Amar Patel and Tex Riddell. 2024. D3D12 Work Graphs. DirectX Developer Blog. https://devblogs.microsoft.com/directx/d3d12-work-graphs/
    [20]
    Ulrich Reif and Andreas Weinmann. 2021. Clothoid fitting and geometric Hermite subdivision. Advances in Computational Mathematics 47, 50 (26 June 2021). https://doi.org/10.1007/s10444-021-09876-5
    [21]
    Rive Inc. 2024. Rive Renderer. https://github.com/rive-app/rive-renderer
    [22]
    W. Tiller and E. G. Hanson. 1984. Offsets of two-dimensional profiles. IEEE Computer Graphics and Applications 4, 9 (Sept. 1984), 36--46.
    [23]
    D. J. Walton and D. S. Meek. 2009. G1 interpolation with a single Cornu spiral segment. J. Comput. Appl. Math. 223, 1 (2009), 86--96. https://doi.org/10.1016/j.cam.2007.12.022
    [24]
    WebGPU. 2024. WebGPU. World Wide Web Consortium. https://www.w3.org/TR/webgpu
    [25]
    Heinrich Wieleitner. 1907. Die Parallelkurve der Klothoide. Archiv der Mathematik und Physik 11 (1907), 373--375.
    [26]
    Norimasa Yoshida and Takafumi Saito. 2012. The Evolutes of Log-Aesthetic Planar Curves and the Drawable Boundaries of the Curve Segments. Computer-Aided Design and Applications 9, 5 (2012), 721--731. https://doi.org/10.3722/cadaps.2012. 721--731
    [27]
    Fabian Yzerman. 2020. Fast approaches to simplify and offset Bézier curves within specified error limits. https://blend2d. com/research/simplify_and_offset_bezier_curves.pdf

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Proceedings of the ACM on Computer Graphics and Interactive Techniques
    Proceedings of the ACM on Computer Graphics and Interactive Techniques  Volume 7, Issue 3
    August 2024
    363 pages
    EISSN:2577-6193
    DOI:10.1145/3688389
    Issue’s Table of Contents
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 09 August 2024
    Published in PACMCGIT Volume 7, Issue 3

    Check for updates

    Author Tags

    1. GPU
    2. Offset Curve
    3. Path Rendering
    4. Stroke
    5. Vector Graphics

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 5
      Total Downloads
    • Downloads (Last 12 months)5
    • Downloads (Last 6 weeks)5
    Reflects downloads up to 10 Aug 2024

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media