Mold

Mold is a real-time vector graphics library for Unity and Godot.

Mold Thumbnail

A selection of animated shapes rendered with Mold

What it does πŸ”—

Mold includes a broad collection of 2D and 3D primitives, and capable of rendering 2D primitives with infinite resolution while capable of efficiently presenting 3D primitives silky smooth. A few additional features really helped my work:

Rounded 3D geometry πŸ”—

Pretty much every shape looks friendlier with softened edges, so Mold can generate rounded boxes, cylinders, prisms, and other primitives without sending them through a modeling tool first.

Editing a rounded 3D mesh in Mold

Oklab color blending πŸ”—

In addition to the usual blend modes, Mold can blend colors in the perceptually uniform Oklab color space. Gradients stay vivid and travel between colors more naturally, which is particularly handy for making a whole scene feel coherent.

Mold color blending modes, including linear RGB and Oklab

Automatic level of detail πŸ”—

Mold can automatically select a lower-detail version of each 3D primitive as it moves farther from the camera. The levels cross-fade with a dithered transition, reducing the cost of dense scenes without a distracting hard pop when the geometry changes.

Mold automatically changing primitive detail levels across a dense scene

GPU based polyine πŸ”—

Mold implements a GPU based polyline solution which can handle potentially millions of lines and points without a hitch. Optional CPU based polyline is still available for precise mesh construction.

Mold GPU based polyline running on Unity

Monilithic MoldComponent/MoldNode πŸ”—

Mold’s primitive and blend-mode catalog

A monilithic MoldComponent/MoldNode to create any shape you want, while still batch them efficiently with underlying low level rendering.

Unity component authoringGodot node authoring

Editing a Mold component in Unity

Editing a Mold node in Godot

Under the hood, Mold uses Unity’s DrawMeshInstanced API and Godot’s MultiMesh for rendering. It supports retained-mode rendering as the main workflow, with an immediate-mode API when that is more convenient.

What can you make with it? πŸ”—

Simple shapes can go surprisingly far. This little solar system was rendered in Godot using only Mold:

A miniature solar system rendered with Mold in Godot

The full Mini Outer Wilds experiment was built with roughly 3,000 lines of GDScript and no art assets. Mold has also been used to assemble colorful miniature towns and small strategy-game scenes:

A miniature town made from Mold primitives

A small hex-grid world made from Mold primitives

A small reality check πŸ”—

Mold is mainly designed for world-space rendering. Unity UI rendering is possible, but it is not the most straightforward use case. Its anti-aliased 2D primitives can look crisp and vector-like at any resolution, but Mold is not an SVG renderer. Oklab blending also costs more than ordinary linear RGB blending, so it is best used where the visual difference matters.

Mold is currently in beta while I work out the final distribution and licensing plan. If this sounds useful for something you are making, join the Discord.