Giter VIP home page Giter VIP logo

rootvg's Introduction

RootVG

Documentation Crates.io License

A 2D vector graphics library optimized for GUIs, written in Rust and wgpu

How it Works

Unlike other 2D vector graphics libraries which have a streaming drawing API similar to HTML5's Canvas API, users of RootVG construct reusable "primitives" that can be cheaply cloned and added in any order with any z index and inside of any scissoring rectangle. Primitives of the same type, z index, and scissoring rectangle are automatically batched together so that the number of draw calls to the GPU are greatly reduced.

See the demo for a quick overview of how the API works.

Primitive Types

RootVG provides six primitive types:

  • SolidQuadPrimitive and GradientQuadPrimitive - based on the quad primitives from Iced
  • SolidMeshPrimitive and GradientMeshPrimitive - draws arbitrary triangles with a solid color or a gradient. The lyon crate is used to generate meshes.
  • TextPrimitive - powered by glyphon
  • ImagePrimitive - supports scale and rotation. The output of a previous render pass can also be used as a texture source.

Additionally, users can create custom primitives with custom rendering pipelines. This can be useful for creating things like efficient spectrometer and oscilloscope displays.

Primitives types that aren't needed can be disabled in the feature flags.

Motivation

This library was created for the Yarrow GUI library which powers the Meadowlark DAW.

rootvg's People

Contributors

billydm avatar porky11 avatar

Stargazers

Ribbon avatar Mu Xian Ming avatar Oskar avatar Bartłomiej Maryńczak avatar Kaem avatar  avatar Brian Roach avatar  avatar  avatar Ilias Woithe avatar Leadbelly avatar Mike Hilgendorf avatar Max avatar Tatsuya Shiozawa avatar  avatar

Watchers

Lucian avatar  avatar  avatar  avatar

Forkers

porky11

rootvg's Issues

OpenGL bug with scissor rectangles

There seems to be a bug in wgpu when setting scissoring rectangles with the OpenGL backend, causing rendering issues. Further investigation is needed.

I have only tested the OpenGL backend on my Arch Linux system running on an AMD RX570 graphics card with the KDE desktop environment (I get the same problem in both Wayland and X11).

(I'm creating this issue for future reference.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.