πŸ–±οΈ Halo: 17 Metal shaders for one tiny pointer

Halo makes your pointer impossible to miss in screen recordings, presentations, tutorials and live demos. It stacks 17 real-time Metal effects, swaps in custom cursors and includes Halo Studio, a layer stack with a live shader editor, all from the menu bar.

By Dennis Bruijn Β· Β· 13 min read Β· #projects #apple #macos #metal #swift #swiftui

You know the moment. Someone shares their screen, says "so if you look right here", and fifty people squint at a 4K desktop hunting for an arrow the size of a grain of rice. The mouse pointer is the most important thing on screen during a demo, and macOS draws it like it would rather you didn't notice.

So I gave mine a halo. Then a ring of fire. Then a raymarched 3D torus. Things escalated.

Aurora Ring, Flame Halo, Plasma Halo, Torus 3D and the Neon Cursor rendered by Halo in a row over faint God Rays on a dark background

The hero row is Halo's own output, rendered offscreen by the app and set on a Montage backdrop.

The 33.5-second tour, if you'd rather watch than read:

Watch the 33-second Halo explainer

17 effects and 20 presets, from Cyber Neon to God Mode

At its simplest, Halo does what a cursor highlighter should: a filled circle, ring or rounded square with a soft glow around the pointer, in whatever shape, color, size, opacity, ring width and glow you like. Click effects get animated ripples. A spotlight dims the rest of the screen and keeps a soft pool of light around the cursor.

Then there's the part I actually had fun with: a real-time Metal effects engine with 17 built-in GPU effects. Neon, aurora, flame, fire and spark trails, a glass orb, liquid chrome, plasma, god rays, a raymarched 3D torus, shockwaves and more. They stack in layers with four blend modes.

Watch the effects loop: Aurora Ring, Plasma Halo, Torus 3D, Fire Trail, Spark Trail, Neon Cursor, Shockwave and the Inferno preset

One effect per second, cut from 4-second clips that Halo rendered itself. Click the still to play the loop.

Here are all 17, side by side. Every still was rendered offscreen by the app with Halo --render-effect, so nothing here is a mockup:

A contact sheet of all 17 Halo effects. Top row: Aurora Ring, Flame Halo, Plasma Halo, Neon Ring, Torus 3D, Liquid Chrome. Middle row: Glass Orb, Fire Trail, Spark Trail, Shockwave, Neon Ripple, God Rays. Bottom row: Vignette Spotlight, Classic Ring, Neon Cursor, Glass Cursor, Ember Cursor

Left to right, top to bottom: Aurora Ring, Flame Halo, Plasma Halo, Neon Ring, Torus 3D, Liquid Chrome, Glass Orb, Fire Trail, Spark Trail, Shockwave, Neon Ripple, God Rays, Vignette Spotlight, Classic Ring, Neon Cursor, Glass Cursor and Ember Cursor.

A few personal favorites, in the README's own words: Liquid Chrome is "a ring of molten mercury", Glass Orb does two-surface refraction with dispersion, and Spark Trail throws grinder sparks that fall and cool.

Effects come in five categories:

CategoryWhat it does
cursorFollows the pointer.
clickFires on each click.
spotlightDims everything except a pool of light.
fullscreenCovers the whole screen.
cursorReplacementDraws the pointer itself.

On top of that come 20 built-in presets, including the combo looks Cyber Neon, Inferno, Cinematic Presenter, Glass Studio, Aurora Calm, Recording Pro and God Mode. You switch them from the menu bar, which lists every preset with a rendered thumbnail, and every pick applies at once to the live overlay:

The Halo menu bar menu opens its Preset submenu and picks God Mode, Inferno, Cyber Neon and Torus 3D in turn, and each pick lights the pointer with that preset

Preset roulette. The menu is a Montage recreation of MenuBarController.swift; the effects are Halo's own renders.

Clicks you can tell apart

Left and right clicks get their own ripple colors and styles, so viewers can tell them apart in a recording. Stack a click effect such as Neon Ripple or Shockwave on top of any cursor effect and every click lands with a little ceremony:

A highlighted pointer clicks on a dim slide window: left clicks spring blue neon rings, right clicks spring red dashed rings and a shockwave fringe follows each click

Click choreography, with the rings redrawn in Montage from the neon-ripple and shockwave parameters.

Ripples are one of those ideas that never get old. This site has its own three.js take on it. It isn't Halo code, just the same itch scratched in a browser: move your pointer over the grid.

pointer-ripples

The spotlight, sketched in CSS

Halo has a spotlight mode and a Metal effect called Vignette Spotlight ("a cinematic follow-spot"). The idea fits in a radial gradient, though, so here is a sketch you can edit. Move over the fake desktop and drag the slider to change how dark the rest of the screen gets:

<style>
  html, body { margin: 0; height: 100%; overflow: hidden; font: 12px system-ui, sans-serif; }
  .desk { position: absolute; inset: 0; background: linear-gradient(135deg, #1d2340, #3a1f3d); }
  .win { position: absolute; background: #e9e9ef; border-radius: 10px; padding: 26px 14px 12px; box-shadow: 0 10px 30px #0009; }
  .line { height: 8px; border-radius: 4px; background: #c4c4cf; margin: 8px 0; }
  .spot {
    --x: 50%; --y: 50%; --r: 120px; --dim: 0.75;
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle var(--r) at var(--x) var(--y),
      transparent 40%, rgb(0 0 0 / var(--dim)) 100%);
  }
  label { position: fixed; top: 8px; right: 10px; z-index: 1; color: #fff; }
</style>
<div class="desk">
  <div class="win" style="left: 8%; top: 12%; width: 40%">
    <div class="line"></div><div class="line" style="width: 70%"></div><div class="line" style="width: 85%"></div>
  </div>
  <div class="win" style="left: 46%; top: 42%; width: 44%">
    <div class="line"></div><div class="line" style="width: 55%"></div><div class="line"></div><div class="line" style="width: 35%"></div>
  </div>
</div>
<div class="spot" id="spot"></div>
<label>dim <input id="dim" type="range" min="0" max="0.95" step="0.01" value="0.75"></label>
<script>
  const spot = document.getElementById("spot").style
  addEventListener("pointermove", (e) => {
    spot.setProperty("--x", e.clientX + "px")
    spot.setProperty("--y", e.clientY + "px")
  })
  document.getElementById("dim").oninput = (e) => spot.setProperty("--dim", e.target.value)
</script>

Halo Studio, and a shader editor that answers while you type

Presets are great until you want your look. That's what Halo Studio is for: an effect library on the left, a live Metal preview in the middle and an inspector on the right.

Halo Studio with a three-layer stack of Shockwave, Neon Ring and Aurora Ring and the inspector sliders for the selected layer

A real Studio window, captured by Halo's own UI driver.

You build a look the way you'd build one in a design tool:

  • Library. Browse effects by category with thumbnails, tags and search, or switch to presets. Double-click, press + or drag an effect onto the layer list.
  • Layers. Stack effects top first. Reorder, duplicate, remove, solo and mute.
  • Inspector. Per layer: enabled, opacity, blend mode and speed, then every effect parameter grouped into sections with reset buttons.
  • Live preview. The real compositor draws into the canvas. The effect follows your mouse and reacts to left and right clicks, and a transport bar has play and pause, a time scrubber, global speed, a simulated figure-eight cursor and click buttons. A HUD shows fps and frame time.
  • Randomize. Random Stack (⌘R) builds a new stack; β‡§βŒ˜R randomizes the selected layer's parameters. Dangerous for productivity.
  • Apply to Cursor. βŒ˜β†© sends the stack to the live overlay, and Revert undoes it. ⌘Z and β‡§βŒ˜Z cover everything in between.

Halo Studio with the Presets library open, showing built-in and combo presets

Looks travel, too. Export… writes a preset as a .halopreset file (JSON) or an effect as a .haloeffect package, and Import… (⌘O) takes those, plain effect folders and .zip files. You can also just drop them on the Studio window.

An effect is just data

This is the bit I like most. An effect is a folder with two files: an effect.json descriptor and an effect.metal fragment function, compiled at run time. In the Studio, New Effect… creates exactly this template and opens it in the shader editor. Here's the starter, a soft pulsing dot:

{
  "id": "my-dot",
  "name": "My Dot",
  "category": "cursor",
  "author": "Me",
  "version": "1.0",
  "description": "A soft pulsing dot that follows the cursor.",
  "symbolName": "circle.fill",
  "bounds": { "mode": "cursorLocal", "size": 64, "sizeParams": { "radius": 3 } },
  "blend": "normal",
  "animated": true,
  "clickTriggered": false,
  "parameters": [
    { "name": "color",  "label": "Color",  "type": "color", "default": [0.3, 0.75, 1.0, 1.0], "group": "Look" },
    { "name": "radius", "label": "Radius", "type": "float", "default": 18, "min": 4, "max": 80, "step": 1, "group": "Shape" },
    { "name": "pulse",  "label": "Pulse",  "type": "float", "default": 0.3, "min": 0, "max": 1, "step": 0.01, "group": "Motion" }
  ]
}
// `in.p` and `u.cursor` are in points (origin bottom-left, y up).
// Return a PREMULTIPLIED sRGB color.
float4 haloEffect(HaloFragmentIn in, constant HaloUniforms& u, constant float4* params) {
    float4 color = param_color;
    float pulse = 1.0 + param_pulse * 0.25 * sin(u.time * 4.0);
    float r = param_radius * pulse;
    float d = haloSdCircle(in.p - u.cursor, r);
    float body = haloAA(d, haloPixel(u));
    float glow = exp(-max(d, 0.0) / (r * 0.35)) * 0.6;
    float a = max(body * 0.85, glow) * color.a;
    return haloPremultiply(color.rgb, a);
}

The contract fits on an index card:

  • Entry point. Exactly float4 haloEffect(HaloFragmentIn in, constant HaloUniforms& u, constant float4* params). No #include: the header already brings in <metal_stdlib> and the halo* helpers.
  • Parameters become macros. param_color, param_radius and so on. Enum options become constants such as shape_ring.
  • Uniforms. u.time, u.cursor, u.cursorVelocity, u.resolution, u.screenScale, u.cursorIdleTime, u.seed and up to 8 recent clicks in u.clicks[i] (position, age, button).
  • Output. A premultiplied color. The engine applies layer opacity and the blend mode for you.
  • Bounds. cursorLocal for a small region around the cursor (cheap), or fullscreen for whole-screen looks.

Run that shader in your browser

Because the effect is just a function of a pixel position and a few uniforms, it ports almost line for line. Below is the my-dot shader translated to JavaScript, with Halo's real haloAA, haloSdCircle and haloSdRing helpers copied over from its Metal header. It runs per pixel on the CPU, which is exactly the job Halo hands to the GPU. Move, left-click and right-click in the preview, then change param_radius or param_pulse in the source.

<style>
  html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
  canvas { display: block; width: 100vw; height: 100vh; cursor: crosshair; }
  p { position: fixed; left: 10px; bottom: 6px; margin: 0; font: 12px ui-monospace, Menlo, monospace; color: #777; }
</style>
<canvas id="c"></canvas>
<p>move Β· left click Β· right click</p>
<script>
// my-dot/effect.json parameters
const param_color = [0.3, 0.75, 1.0, 1.0]
const param_radius = 18
const param_pulse = 0.3

// Halo's helpers, ported from its Metal header
const saturate = (x) => Math.min(Math.max(x, 0), 1)
const haloAA = (d, w) => saturate(0.5 - d / Math.max(w, 1e-4))
const haloSdCircle = (x, y, r) => Math.hypot(x, y) - r
const haloSdRing = (x, y, r, width) => Math.abs(Math.hypot(x, y) - r) - width * 0.5
const haloPixel = (u) => 1 / Math.max(u.screenScale, 1)

const u = { time: 0, cursor: [0, 0], screenScale: 1, clicks: [] }
const still = matchMedia("(prefers-reduced-motion: reduce)").matches

// my-dot/effect.metal, line for line. Returns premultiplied [r, g, b, a].
function haloEffect(px, py) {
  const color = param_color
  const pulse = 1 + param_pulse * 0.25 * Math.sin(u.time * 4)
  const r = param_radius * pulse
  const d = haloSdCircle(px - u.cursor[0], py - u.cursor[1], r)
  const body = haloAA(d, haloPixel(u))
  const glow = Math.exp(-Math.max(d, 0) / (r * 0.35)) * 0.6
  const a = Math.max(body * 0.85, glow) * color[3]
  return [color[0] * a, color[1] * a, color[2] * a, a]
}

// Not part of my-dot: a ring per recent click, so u.clicks has a job.
function clickRing(px, py, c) {
  const d = haloSdRing(px - c.position[0], py - c.position[1], 8 + c.age * 150, 3)
  const a = haloAA(d, haloPixel(u)) * (1 - c.age / 0.6)
  const rgb = c.button === "right" ? [1, 0.33, 0.28] : [0.2, 0.55, 1]
  return [rgb[0] * a, rgb[1] * a, rgb[2] * a, a]
}

const canvas = document.getElementById("c")
const ctx = canvas.getContext("2d")
let W, H, image
function resize() {
  W = canvas.width = innerWidth
  H = canvas.height = innerHeight
  image = ctx.createImageData(W, H)
  u.cursor = [W / 2, H / 2]
}
resize()
addEventListener("resize", resize)
canvas.addEventListener("pointermove", (e) => (u.cursor = [e.offsetX, e.offsetY]))
canvas.addEventListener("contextmenu", (e) => e.preventDefault())
canvas.addEventListener("pointerdown", (e) => {
  u.clicks.unshift({ position: [e.offsetX, e.offsetY], age: 0, button: e.button === 2 ? "right" : "left" })
  u.clicks.length = Math.min(u.clicks.length, 8) // Halo keeps up to 8 recent clicks
})

let last = performance.now()
function frame(now) {
  const dt = (now - last) / 1000
  last = now
  if (!still) u.time += dt
  u.clicks.forEach((c) => (c.age += dt))
  u.clicks = u.clicks.filter((c) => c.age < 0.6)

  const out = image.data
  for (let y = 0; y < H; y++) {
    for (let x = 0; x < W; x++) {
      let o = haloEffect(x, y)
      for (const c of u.clicks) {
        const s = clickRing(x, y, c) // premultiplied "over"
        o = o.map((v, i) => s[i] + v * (1 - s[3]))
      }
      const i = (y * W + x) * 4
      out[i] = o[0] * 255
      out[i + 1] = o[1] * 255
      out[i + 2] = o[2] * 255
      out[i + 3] = 255
    }
  }
  ctx.putImageData(image, 0, 0)
  requestAnimationFrame(frame)
}
requestAnimationFrame(frame)
</script>

Your laptop fan may now understand why Halo does this on the GPU, and why cursorLocal bounds exist.

Hot reload, with errors at your own line numbers

In Halo's shader editor, every edit schedules a compile 300 ms after you stop typing. The compile runs off the main thread, so the UI never stalls. Errors and warnings appear inline at your line numbers. When the source compiles and the descriptor is valid, Halo writes both files back to the effect folder, reloads the library, and the live preview picks up the new shader at once.

The shader editor on a Pulse Ring effect with a typo on line 6: a red gutter dot, a wavy underline under puls, a 1 error chip and an Issues list suggesting pulse

An inline compile error. This view is a Montage mockup rebuilt from the SwiftUI sources with a synthetic effect.

Fix the typo and you're back in business:

The live shader editor with Metal source, a Live compile status and the effect inspector

Two small touches I'm fond of: the JSON tab edits effect.json through a form or as raw JSON, and choosing Edit Shader on a built-in effect first duplicates it as "Name Copy", so the originals stay untouched.

The app is also a CLI

The Halo binary doubles as a command-line tool for effect authors, and none of these commands opens a window. This is also how every still in this post was made.

B=build/Halo.app/Contents/MacOS/Halo
$B --list-effects
$B --compile-effect ~/Library/Application\ Support/Halo/Effects/my-dot   # diagnostics with your line numbers
$B --render-effect neon-ring --out /tmp/neon.png --time 1.3 --background '#1E1E24'
$B --render-effect shockwave --out /tmp/shock.png --click-age 0.15 --click-button right
$B --render-preset cyber-neon --out /tmp/cyber.png --velocity 700,250 --click-age 0.25 \
   --background '#F2F2F5' --composite over                              # deterministic (fixed seed)
$B --render-cursor-theme neon --out /tmp/neon-cursor.png --scale 2
$B --bench-effect god-rays                                              # GPU ms: avg / p95 / max

Seven cursor themes, and the pointer always comes back

Sometimes a glow around the pointer isn't enough and you want a different pointer altogether. Halo can hide the system cursor and draw its own: 7 themes covering 13 cursor types (arrow, I-beam, pointing hand, resize, busy and friends), tinted and scaled to taste. You can also import your own PNG or SVG cursors, or use an effect such as the Neon Cursor as the pointer.

The seven cursor themes, each with an arrow, pointing hand and I-beam: Halo Classic, Big & Bold, Minimal Dot, Retro Pixel, Glass, Neon and Ember

Halo Classic, Big & Bold, Minimal Dot, Retro Pixel, Glass, Neon and Ember, rendered by Halo with --render-cursor-theme.

Now, hiding someone's mouse pointer is a slightly terrifying thing for an app to do. A Mac with no visible pointer is the worst way this feature can fail, so every exit path puts the real one back:

Exit pathWhat happens
Panic hotkeyβŒƒβŒ₯⌘H restores the real pointer immediately and turns the feature off. It's registered only while the custom cursor is on, and the pointer is never hidden without it.
Normal exitsQuitting, stopping Halo or switching the feature off restores it.
Crashesexit(), crashes and signals (SIGTERM, SIGINT, SIGSEGV, SIGABRT and more) run an emergency restore before the process ends.
Password fieldsWhen Secure Event Input is on, the custom cursor pauses and the real pointer shows.
Killed processIf the process is killed outright, WindowServer drops the hidden state together with the connection.

Turn it on in Settings β€Ί Cursor, where the theme, size, tint and the panic hotkey live:

Halo Settings on Cursor, with the custom cursor switch, theme picker, size, tint and panic hotkey

Shortcuts, Spotlight and Siri

Halo adds 7 App Intents to the Shortcuts app and Spotlight. App Shortcuts work with no setup, so you can say "Toggle Halo", "Apply Inferno in Halo" or "Open Halo Studio" to Siri, which is a very satisfying thing to say out loud mid-presentation.

ActionWhat it does
Toggle HaloTurns the highlight on or off.
Set Halo On or OffSets the highlight to a given state.
Toggle Halo SpotlightTurns spotlight dimming on or off.
Apply Halo PresetApplies any built-in or user preset, shown with rendered thumbnails.
Toggle Halo Custom CursorTurns the custom cursor on or off.
Set Halo Custom Cursor On or OffSets the custom cursor to a given state.
Open Halo StudioOpens the Studio.

Or skip all that and press βŒƒβŒ₯H anywhere to toggle Halo (the hotkey is configurable).

A resting cursor costs nothing

All of this would be a hard sell if it cooked your Mac. Halo is a menu bar app with no Dock icon, and frames are drawn only when something changes, so a resting cursor costs no CPU. Animated effects render only while visible and slow down when you're idle; static ones cost nothing while the cursor rests. It honors Reduce Motion and Low Power Mode too.

A quick tour of the rest

On first launch, a Welcome window explains what Halo does and asks you to choose a look:

The Halo Welcome window with a short explanation of the app and a Choose a look grid of presets

Settings uses Liquid Glass and has seven sections (General, Highlight & Effects, Clicks, Spotlight, Cursor, Keystrokes and About). Changes apply live. Highlight & Effects, Clicks, Spotlight, Cursor and Keystrokes each have their own Reset to Defaults…, and the one in General restores all appearance settings but keeps your hotkey, launch at login and on/off state.

Halo Settings on the General section: enable switch, toggle hotkey, launch at login, renderer and motion options

There's also an optional on-screen keystroke HUD with left and right click badges for tutorials, and Halo works across multiple displays and Spaces.

Under the hood

Stack: Swift 6 Β· SwiftUI and AppKit Β· Metal Β· App Intents Β· XcodeGen Β· XCTest. Runs on macOS 26 and later.

Everything hangs off one composition root, HaloController. Here's the shape of it:

AppDelegate (menu bar app)
└── HaloController                 composition root
    β”œβ”€β”€ HaloSettings               user defaults
    β”œβ”€β”€ HotkeyManager              βŒƒβŒ₯H
    β”œβ”€β”€ MenuBarController
    β”œβ”€β”€ InputMonitor               mouse, clicks, keys ──► OverlayController, KeystrokeHUD
    β”œβ”€β”€ OverlayController          per-screen panels   ──► EffectEngine
    β”œβ”€β”€ PresetStore                ── active stack ──► EffectEngine
    β”œβ”€β”€ EffectLibrary              ──► EffectEngine
    β”œβ”€β”€ EffectEngine               compositor
    β”‚   β”œβ”€β”€ EffectShaderCompiler   runtime Metal, off-main
    β”‚   └── ScreenCompositor Γ—N    CAMetalLayer + display link
    β”œβ”€β”€ CursorController           custom cursor ──► SystemCursorHider (always restores)
    └── StudioWindowController     Studio + shader editor ── Apply to Cursor ──► EffectEngine

Four ideas carry most of the weight:

  • Overlay. Each screen gets a transparent, click-through overlay panel. Effects are grouped into render surfaces: small cursorLocal surfaces move with the pointer without redrawing, and fullscreen surfaces cover their screen.
  • Compile. Shaders compile at run time off the main actor. A layer whose pipeline is still compiling is skipped until it's ready.
  • Frame pacing. Frames are drawn on demand: animated effects are throttled when the cursor rests, and static ones render once per change.
  • Input. InputMonitor follows the mouse, clicks and (with Accessibility) keys, and feeds the overlay, the click history in the shader uniforms and the keystroke HUD.

The 17 built-in effects live in Resources/Effects/<id>/ as the same effect.json plus effect.metal pair you saw above, next to 20 .halopreset files and the 7 cursor themes.

Privacy by having nothing to leak

PermissionWhy it is needed
NoneHighlight, click effects, spotlight, Metal effects, the custom cursor and the global hotkey need no permission.
AccessibilityOnly for the optional keystroke HUD, and requested only when you turn it on. Decline it and everything else keeps working.
Screen RecordingNever. Halo doesn't read screen pixels. Those glass and chrome reflections are synthetic.

Halo has no network access, no analytics, no telemetry and no crash reporting. The keystroke HUD shows keys only while you type and never stores or logs them. Preferences, presets and effects stay on your Mac.

Tested like it means it

scripts/test.sh runs the XCTest unit tests: the engine, shader editor, Studio, presets, settings, cursor themes and the reset and randomize paths. scripts/e2e.sh is a black-box suite against a Release build that renders every effect and every preset on a dark and a light background and checks each image. Its live phase drives the real app through App Intents and synthetic input, hides and restores the pointer, measures CPU budgets per preset and checks for crash reports.

scripts/test.sh                          # unit tests (HaloKitTests, Debug, with coverage)
scripts/e2e.sh                           # build, unit tests, self-tests, compile and render every effect and preset
E2E_UI=1 scripts/e2e.sh                  # + scripted UI driver: menu, Settings, Welcome, Studio, shader editor, hotkey
E2E_LIVE=1 E2E_UI=1 scripts/e2e.sh -k    # + live phase: App Intents, synthetic input, cursor-restore drills, CPU budgets

That UI driver is also what captured the real window screenshots in this post, in light and dark.

What's not there yet

Halo is in development, and the README is honest about it, so I will be too:

  • No notarized build. Developer ID signing and notarization haven't been done yet, so you build from source (macOS 26, Xcode 27 and XcodeGen, then scripts/build-app.sh). Signing with Developer ID, notarizing and publishing a DMG from scripts/release.sh is the first item on the roadmap.
  • CPU while the mouse moves. In the last full live run, 107 of 113 checks passed. The 6 failures were CPU budgets with the mouse moving (Classic Ring at about 7% against a 3% budget, for example), measured while other processes kept the machine busy. Re-checking those on a quiet machine is on the list.
  • One frame rate per surface. Surfaces don't yet idle at different rates, so the maxFps: 20 of God Rays has no effect inside the God Mode preset, which also runs Plasma Halo. Per-surface frame rates are on the roadmap.
  • Placeholder identifiers. The bundle identifier and defaults domain still need their real names before any public release.
  • Small UI leftovers. A thin line under the traffic lights in the Settings sidebar, a small-looking Glass cursor theme preview and a default-style Studio error alert.

The full project lives on the projects page, next to the other things I've built.

Curious about the source? It's private, but access can be granted to anyone interested in contributing. Get in touch.