contrast_renderer

Crates.iocontrast_renderer
lib.rscontrast_renderer
version0.1.3
sourcesrc
created_at2021-04-18 19:43:42.664357
updated_at2024-11-21 18:55:10.772875
descriptionA web-gpu based 2D render engine
homepage
repositoryhttps://github.com/Lichtso/contrast_renderer/
max_upload_size
id386289
size384,420
Alexander Meißner (Lichtso)

documentation

README

actions Docs crates.io

Contrast Renderer

Contrast is a web-gpu based 2D renderer written in Rust. It renders planar vector graphics and can easily be integrated with other forward-rendering code. Filling uses implicit curves and is resolution-independent, while stroking uses parametric curves and is approximated via polygon tesselation. This way you can have non-diegetic, diegetic and spacial GUI elements on any flat plane:

  • As classic 2D menu overlay on top of the 3D scene.
  • As HUD fixed relative to the camera movement but occluded by the 3D scene.
  • As decals on walls or holograms hovering in the 3D scene.

To get started, checkout the showcase example.

Feature Roadmap

✓ Supported and implemented
◯ Rudimentary support
✗ Planned support, not implemented
  • Rendering

    • Anti Aliasing ◯
      • MSAA ✓
    • Instancing ✓
    • Customizable (User Defined)
      • Shaders ✓
      • Blending ✓
      • Depth Test ✓
      • Back Face Culling ✓
    • Nestable Clipping ✓
    • Nestable Transparency Layers (Group Opacity) ✓
  • Filling

    • Paths
      • Polygons ✓
      • Bezier Curves
        • Integral (Normal)
          • Quadratic ✓
          • Cubic ✓
        • Rational (Weighted)
          • Quadratic ✓
          • Cubic ✓
    • Winding Fill Rules ✓
  • Stroking

    • Paths
      • Polygons ✓
      • Bezier Curves
        • Approximation
          • Uniformly Spaced Parameters ✓
          • Uniform Tangent Angle ✓
          • Uniform Arc Length ✗
        • Integral (Normal)
          • Quadratic ✓
          • Cubic ✓
        • Rational (Weighted)
          • Quadratic ✓
          • Cubic ✓
    • Stroke Width ✓
    • Stroke Offset ◯
    • Closed / Open ✓
    • Line Joins
      • (Clipped) Miter ✓
      • Bevel ✓
      • Round ✓
    • Line Caps (Square, Round, Out, In, Right, Left, Butt) ✓
    • Dashing
      • Phase Translation ✓
      • Repeating Gap Intervals ✓
      • Dynamically Adjustable (for Animations) ✓
  • Path Constructors

    • Polygon ✓
    • Bezier Curves
      • Integral (Normal)
        • Quadratic ✓
        • Cubic ✓
      • Rational (Weighted)
        • Quadratic ✓
        • Cubic ✓
    • Rect ✓
    • Rounded Rect ✓
    • Ellipse ✓
    • Circle ✓
    • Elliptical Arc ✓
    • [Optional] Font (TTF)
      • Glyph ✓
      • Text ◯
  • Graphical User Interface ✗

Dependencies

Dependencies of the Library

Dependencies of the Examples

Commit count: 94

cargo fmt