Makepad Graphics & Effects
GPU-accelerated shaders, SDF drawing, and animations in Makepad.
Quick Navigation
| Category | Description |
|---|---|
| Shader Basics | Structure, variables, math functions |
| SDF Drawing | Circle, box, capsule, path drawing |
| Animation | Animator, easing, keyframes, loops |
| Visual Effects | Hover, gradients, shadow, glow |
Shader Structure
live_design! {
MyShader = {{MyShader}} {
fn pixel(self) -> vec4 {
let sdf = Sdf2d::viewport(self.pos * self.rect_size);
// Draw shapes
sdf.circle(50.0, 50.0, 20.0);
sdf.fill(#FF0000);
return sdf.result;
}
}
}
SDF Operations
// Basic shapes
sdf.circle(x, y, radius)
sdf.box(x, y, width, height, border_radius)
sdf.capsule(x1, y1, x2, y2, width)
// Fill and stroke
sdf.fill(color) // Fill shape
sdf.stroke(color, width) // Stroke outline
sdf.fill_keep(color) // Fill, keep shape for more ops
Animator System
live_design! {
<Button> {
animator: {
hover = {
default: off
off = { from: {all: Forward {duration: 0.15}} }
on = { from: {all: Snap} }
}
}
draw_bg: {
color: #2196F3
color_hover: #42A5F5
}
}
}
Easing Functions
| Easing | Use Case |
|---|---|
OutQuad | Enter animations |
InQuad | Exit animations |
InOutQuad | Smooth transitions |
ExpDecay {d1: 0.8, d2: 0.97} | Physics-like motion |
Animation Example
live_design! {
LoadingSpinner = {{LoadingSpinner}} {
animator: {
spin = {
default: on
on = {
from: {all: Loop {duration: 1.0}}
apply: { draw_bg: { rotation: 360.0 } }
}
}
}
draw_bg: {
fn pixel(self) -> vec4 {
// Rotating arc shader
let sdf = Sdf2d::viewport(self.pos * self.rect_size);
let angle = self.rotation * PI / 180.0;
// Draw rotating arc
return sdf.result;
}
}
}
}
Gradient Effects
draw_bg: {
fn pixel(self) -> vec4 {
// Linear gradient
let grad = self.pos.y;
let color = mix(#FF0000, #0000FF, grad);
return vec4(color, 1.0);
}
}
Resources
Comments
No comments yet. Be the first to comment!
Related Tools
Makepad Core Concepts
makepad.nl
Fundamental building blocks of Makepad UI development including layout systems, widgets, event handling, and styling with live_design! macro.
Makepad Getting Started
makepad.nl
Entry point for Makepad development with Claude. Learn project setup, structure, and available skills for building cross-platform UI applications with Rust.
Makepad Components Gallery
makepad.nl
Quick reference for all Makepad built-in widgets with usage examples. Covers buttons, inputs, sliders, checkboxes, dropdowns, labels, icons, and virtual lists.
Related Insights

Grok Bot and Hermes Bot: one person finally gets a think tank and a secretariat
Grok Bot now ships with Cursor Pro+. Hermes Bot runs on a VPS. They are not smarter chat boxes. The think tank advises, the secretariat executes, and you still make the call.
Hook OpenCode Go into Codex on Windows. Do Not Open a Second Toolkit.
A ChatGPT-signed Codex desktop app still shows mostly GPT in the picker. On Windows, enable only OpenCode Go and the Grok, GLM, Kimi, DeepSeek, and MiniMax models you already pay for appear in the same selector. Keys stay local. Native GPT stays put.
What Locks Codex Is the Picker, Not the Models
You already pay for OpenCode Go, Grok, and Z.ai, but the Codex picker still shows mostly GPT. The community project codex-router does not teach another install ritual. It puts subscriptions you already bought back into the selector, keeps keys on the machine, and leaves native GPT alone.