Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes GPU pixel and vertex shaders for Makepad 2.0 widgets using SDF2D primitives, instance and uniform variables.
32% 91%+59 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 7 of 22 without it.
3 of 3 safety checks passed
Not used yet
Version: makepad-widgets (dev branch) | Last Updated: 2026-03-03
Makepad uses a custom GPU shader system integrated into the widget property tree. Shaders are defined inline using pixel: fn() { ... } and vertex: fn() { ... } blocks within draw_bg, draw_text, or custom draw objects.
Refer to the local files for detailed documentation:
./references/shader-reference.md - Shader syntax, variables, built-ins, custom functions./references/sdf2d-reference.md - SDF2D primitives, combinators, drawing operationsdraw_bg +: {
// Declare variables
instance hover: 0.0 // Animatable per-instance
uniform accent: #4488ff // Shared across all instances
pixel: fn() {
let sdf = Sdf2d.viewport(self.pos * self.rect_size)
// ... SDF operations ...
return sdf.result
}
}
| Type | Declaration | Animatable | Scope |
|---|---|---|---|
instance | instance hover: 0.0 | Yes (via Animator) | Per-widget instance |
uniform | uniform color: #fff | No | Shared across instances |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.