Skip to content
Rekonquest edited this page Jul 5, 2026 · 3 revisions

Atom Rendering Engine

A from-scratch 2D UI rendering engine built entirely from mathematical primitives — no GPU vector library (no Vello, Skia, or Cairo), no web engine, no Tauri/Electron. Shapes are rasterized from signed-distance fields with analytic anti-aliasing, arbitrary contours from a scanline path filler, and text from real TrueType outlines — a built-in, zero-dependency .ttf parser and glyph rasterizer that reads the system font with std::fs. It composites, lays out, and runs an interactive widget loop entirely on the CPU.

The name comes from the engine's foundation: everything is wired from eight root atoms — scan · hash · fold · project · scale · compare · combine · order.

Zero dependencies by default. cargo tree shows the whole workspace — library and examples — depending on zero external crates. The optional gpu feature adds wgpu for a GPU bloom tier; nothing else pulls a single crate.

Atom Rendering Engine — a UI rendered entirely by the engine, on the CPU

Why it exists

Most "lightweight" UI toolkits are only light because they hand the actual drawing to the OS (GDI/CoreGraphics) or a GPU library, or they embed a whole browser. Atom Rendering Engine draws every pixel itself, from math, with nothing underneath — and still stays tiny:

Footprint ~150–400 KB for a complete UI app (default, zero-dep); ~7.7 MB only if you enable the GPU tier
Dependencies none by default (pmre-kit has an empty dependency list; the CPU path is pure std)
Text real system TrueType glyphs, anti-aliased, cached — no font crate
Windowing the live window drives Win32/GDI directly via raw FFI — no winit, no softbuffer

The shape of it — two crates, per the Composition doctrine

  • pmre-kit — the kit: all the dumb, decision-free mechanism. The eight root atoms, geometry + affine transforms, SDF coverage + anti-aliasing, a scanline path rasterizer, gradients, alpha-over compositing, the TrueType parser + glyph rasterizer, rich inline text flow, the reduced flex/box layout solver, hit-testing, and clipping. Zero dependencies.
  • pmre-orchestrator — the orchestrator: all policy, no mechanism. Painter order, the interaction state machine (hover / press / click / toggle / scroll / drag), scrollbars, the resize loop, and the Quality tiers. It drives the kit; it never touches a pixel itself.

The kit computes; the orchestrator decides. If a kit function grows an if that makes a value judgement, that if belongs in the orchestrator.

Features at a glance

  • Shapes — rect, rounded-rect, circle, line via signed-distance fields with exact AA.
  • Paths — fill and stroke arbitrary polygons and flattened Béziers (nonzero winding).
  • Gradients — two-stop linear and radial, sampled per pixel.
  • Text — anti-aliased vector glyphs from the system font, plus rich inline flows that mix bold / underlined / colored spans in one wrapping paragraph. A bitmap fallback keeps things rendering even with no font file.
  • Layout — a reduced CSS-flexbox/block solver: row/column, Auto/Px/Flex/%, padding, margins, gap, align, justify, borders, radius, and soft box shadows.
  • Two front-ends, one core — a UxNode intent tree and an HTML/CSS document reduce onto the same box-model + layout + paint core.
  • Interaction — buttons, toggles, a scrollable region with a live scrollbar, text input with a caret and Enter-to-submit, and auto-resize reflow.
  • Live window — a real, interactive, DPI-aware OS window with zero crates.

Gallery

Everything below is drawn by the engine itself — no browser, no GPU vector library, no crates:

Paths & holes Gradients Strokes
paths gradients strokes

An HTML document with inline CSS, rendered straight to pixels — no browser engine:

html

A live, interactive todo app built on the engine:

todo

Start here

  • Getting Started — add the crates, render your first frame, run the examples.
  • Architecture — the pipeline from intent to pixels, the atoms, and the kit/orchestrator boundary.
  • Developer Guide — the full embedding/extension reference in the repo.

License

MIT — see the repository.


Created by Jesse G. Alicea, a Lucerna Labs project.

Clone this wiki locally