MCPcopy Index your code
hub / github.com/Lichtso/contrast_renderer

github.com/Lichtso/contrast_renderer @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
169 symbols 275 edges 15 files 90 documented · 53% updated 14mo ago★ 85
What it actually does AI analysis from the code graph — generated when you open this
loading…
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

Extension points exported contracts — how you extend this code

Application (Interface)
(no doc)
examples/application_framework.rs

Core symbols most depended-on inside this repo

vec_to_point
called by 38
src/utils.rs
tangent_from_points
called by 11
src/path.rs
point_to_vec
called by 10
src/utils.rs
weighted_vec_to_point
called by 10
src/utils.rs
weight_derivatives
called by 10
src/fill.rs
offset_control_point
called by 7
src/stroke.rs
emit_stroke_vertices
called by 7
src/stroke.rs
append
called by 7
src/path.rs

Shape

Method 67
Function 63
Class 29
Enum 9
Interface 1

Languages

Rust100%

Modules by API surface

src/path.rs38 symbols
src/text.rs23 symbols
src/utils.rs22 symbols
src/renderer.rs18 symbols
src/curve.rs18 symbols
examples/application_framework.rs16 symbols
src/stroke.rs9 symbols
src/fill.rs9 symbols
src/vertex.rs6 symbols
examples/showcase/main.rs6 symbols
src/safe_float.rs2 symbols
src/error.rs1 symbols

For agents

$ claude mcp add contrast_renderer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page