Giter VIP home page Giter VIP logo

wall's Introduction

Wall is a vector graphics renderer using OpenGL written in pure OCaml.

Code is licensed under BSD3. API is not stable yet.

Installation

Project is heavily under development.

$ opam pin add --dev-repo stb_truetype
$ git clone [email protected]:let-def/wall.git 
$ opam pin add wall ./wall/

Credits

The main inspiration for this project is NanoVG.

Shader and renderer design are taken from it.

Status

Basic drawing is fully functional:

  • basic primitives, from straight lines and circles to bezier curve,
  • fill and stroke
  • linear and radial gradients and textured brushes

The main missing item is text rendering.

The drawing API is moving toward a functional style: state is isolated as much as possible. Transformation matrix is now selected on a path-basis. This could be used to push as many coordinate transformations as possible on the GPU.

By making the API stateless, it becomes possible to expose a convenient API for caching paths. This as not yet been investigated.

Area needing more work

Pushing more bezier rendering to the GPU would be nice. Tesselation is done on CPU side and is the most time consuming step. Being resolution-dependent, it is sensitive to transformation matrix and makes caching harder.

Rendering bezier on GPU is the number one item to simplify pipeline and provide clean and efficient high-level API.

The other major work needed is for text rendering. It would be implemented by texture atlases like in NanoVG. Things to do:

  • decide how flexible the high-level API should be, e.g. is some preprocessing step needed or should atlases be generated on-the-fly?
  • decide which rendering primitives to add, e.g. keeping symbolic representation late in the pipeline allow generation of good-quality atlases at the last minute
  • a reasonable bin-packing algorithm implementation, for portability and convenience (C library would be awkward to use for an online algorithm)

A platform dependent library would still be used for font rasterization. Likely Stb_truetype in C and custom plumbing to browser rasterizers in web browsers.

wall's People

Contributors

let-def avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.