
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 logos, icons, text and other GUI elements
- as classic 2D menu overlay on top of the 3D scene.
- as HUD fixed relative to the camera movement but in the 3D scene.
- on abitrary planes in the 3D scene: Decals on any flat surface such as a wall or simply mid air.
To get started, checkout the showcase example.
Feature Roadmap
✓ Supported and implemented
â—¯ Rudimentary support
✗ Planned support, not implemented
- Rendering
- Anti Aliasing â—¯
- Custom (User Provided) Shaders ✓
- Blending ✓
- Instanced ✗
- Filling
- Paths
- Polygons ✓
- Bezier Curves
- Integral (Normal)
- Rational (Weighted)
- Winding Fill Rules ✓
- Nestable Clipping ✓
- Stroking
- Paths
- Polygons ✓
- Bezier Curves
- Approximation
- Uniformly Spaced Parameters ✓
- Uniform Tangent Angle ✓
- Uniform Arc Length ✗
- Integral (Normal)
- Rational (Weighted)
- 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)
- Rational (Weighted)
- Arc ✓
- Rect ✓
- Rounded Rect ✓
- Ellipse ✓
- Circle ✓
- [Optional] Font (TTF)
Dependencies
Dev-Dependencies
Dependencies of the Library
Dependencies of the Examples