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
Related: consulting-pptx-skill and Document Skills. Hub: skills.
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.
How to pick an AI coding CLI for your repo
Match Claude Code, Codex CLI, OpenCode, Pi, omp, DeepSeek Harness, and Grok Build to the work you actually run. Docs rechecked 2026-10-06.
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.