makepad-2.0-shaders
makepad shader, Sdf2d, pixel shader, draw_bg, draw_text, draw_quad, makepad gpu, shader function, pixel fn, vertex fn, instance, uniform, shader variable, sdf, premultiply, Pal.premul, GaussShadow, makepad graphics, custom draw, DrawQuad, DrawVector, 着色器, 像素, 渲染, 自定义绘制, 距离场
npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-shaders --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Makepad 2.0 Shader Skill > **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-03-03 ## Overview 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. ## Documentation 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 operations --- ## Shader Basics ### Pixel Shader Structure ``` draw_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 } } ``` ### Variable Types | Type | Declaration | Animatable | Scope | |------|-------------|-----------|-------| | `instance` | `instance hover: 0.0` | Yes (via Animator) | Per-widget instance | | `uniform` | `uniform color: #fff` | No | Shared across instances | | `texture_2d` | `texture_2d tex: none` | No |
- Overview
- Documentation
- Shader Basics
- Pixel Shader Structure
- Variable Types
- Built-in Variables
- CRITICAL: Premultiply Alpha
- SDF2D Quick Reference
- Setup
- Primitives
- Drawing
- Combinators
- Transforms
- Color Operations
What does the makepad-2.0-shaders skill do?
makepad shader, Sdf2d, pixel shader, draw_bg, draw_text, draw_quad, makepad gpu, shader function, pixel fn, vertex fn, instance, uniform, shader variable, sdf, premultiply, Pal.premul, GaussShadow, makepad graphics, custom draw, DrawQuad, DrawVector, 着色器, 像素, 渲染, 自定义绘制, 距离场
How do I install it?
Run `npx skills add ZhangHanDong/makepad-skills --skill makepad-2.0-shaders --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ZhangHanDong/makepad-skills, a repository with 745 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
