本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)48k · #5153

makepad-shaders

できること

Makepadシステム用の「シェーダー」と呼ばれる視覚的なコードを作成し、理解するのに役立ちます。これらのコードは、色、形、エフェクトなど、画面上で図形要素がどのように描画されるかを制御します。

使う場面

  • ✓Makepadで要素のオリジナルの見た目を作りたいとき。
  • ✓コードを使って複雑な図形やアニメーションを描きたいとき。
  • ✓Makepadの既存のシェーダーを理解したり、修正したりしたいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-shaders/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/makepad-shaders/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“角丸の枠線と青いグラデーションを持つボタンのシェーダーを作成してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

描きたいものの説明を入力すると、AIがシェーダーのコードを生成します。図形と色を定義するためにSdf2dという仕組みを使い、最終的なコードはMakepadのシェーダー言語で書かれます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • ./references/shader-basics.md
  • ./references/sdf2d-reference.md

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Makepad Shaders Skill

Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19

Check for updates: https://crates.io/crates/makepad-widgets

You are an expert at Makepad shaders. Help users by:

  • Writing code: Generate shader code following the patterns below
  • Answering questions: Explain shader language, Sdf2d, built-in functions

When to Use

  • You need to write or debug Makepad shader code, custom drawing, or SDF-based visuals.
  • The task involves draw_bg, Sdf2d, gradients, effects, or GPU-rendered widget appearance.
  • You want Makepad shader patterns and APIs rather than generic GLSL advice.

Documentation

Refer to the local files for detailed documentation:

  • ./references/shader-basics.md - Shader language fundamentals
  • ./references/sdf2d-reference.md - Complete Sdf2d API reference

Advanced Patterns

For production-ready shader patterns, see the _base/ directory:

Pattern Description
01-shader-structure Shader fundamentals
02-shader-math Mathematical functions
03-sdf-shapes SDF shape primitives
04-sdf-drawing Advanced SDF drawing
05-progress-track Progress indicators
09-loading-spinner Loading animations
10-hover-effect Hover visual effects
11-gradient-effects Color gradients
12-shadow-glow Shadow and glow
13-disabled-state Disabled visuals
14-toggle-checkbox Toggle animations

Community contributions: ./community/

IMPORTANT: Documentation Completeness Check

Before answering questions, Claude MUST:

  1. Read the relevant reference file(s) listed above
  2. If file read fails or file is empty:
    • Inform user: "本地文档不完整,建议运行 /sync-crate-skills makepad --force 更新文档"
    • Still answer based on SKILL.md patterns + built-in knowledge
  3. If reference file exists, incorporate its content into the answer

Key Patterns

1. Basic Custom Shader

<View> {
    show_bg: true
    draw_bg: {
        // Shader uniforms
        color: #FF0000

        // Custom pixel shader
        fn pixel(self) -> vec4 {
            return self.color;
        }
    }
}

2. Rounded Rectangle with Border

<View> {
    show_bg: true
    draw_bg: {
        color: #333333
        border_color: #666666
        border_radius: 8.0
        border_size: 1.0

        fn pixel(self) -> vec4 {
            let sdf = Sdf2d::viewport(self.pos * self.rect_size);
            sdf.box(1.0, 1.0,
                    self.rect_size.x - 2.0,
                    self.rect_size.y - 2.0,
                    self.border_radius);
            sdf.fill_keep(self.color);
            sdf.stroke(self.border_color, self.border_size);
            return sdf.result;
        }
    }
}

3. Gradient Background

<View> {
    show_bg: true
    draw_bg: {
        color: #FF0000
        color_2: #0000FF

        fn pixel(self) -> vec4 {
            let t = self.pos.x;  // Horizontal gradient
            return mix(self.color, self.color_2, t);
        }
    }
}

4. Circle Shape

<View> {
    show_bg: true
    draw_bg: {
        color: #0066CC

        fn pixel(self) -> vec4 {
            let sdf = Sdf2d::viewport(self.pos * self.rect_size);
            let center = self.rect_size * 0.5;
            let radius = min(center.x, center.y) - 1.0;
            sdf.circle(center.x, center.y, radius);
            sdf.fill(self.color);
            return sdf.result;
        }
    }
}

Shader Structure

Component Description

…

よくある質問

シェーダーとは何ですか?

グラフィックカード(GPU)上で動く小さなプログラムで、画面上の各ピクセルの色を決めます。複雑な視覚効果を実現できます。

Sdf2dとは何ですか?

Makepadの特別な仕組みで、「符号付き距離場」と呼ばれる手法を使って、幾何学的な図形や視覚効果を簡単に作れるようにします。

これを使うのにプログラミングの知識は必要ですか?

経験豊富なプログラマーである必要はありません。AIがコードを生成してくれますし、質問してコードの働きを理解することもできます。

詳細

作者による元の説明

CRITICAL: Use for Makepad shader system. Triggers on: makepad shader, makepad draw_bg, Sdf2d, makepad pixel, makepad glsl, makepad sdf, draw_quad, makepad gpu, makepad 着色器, makepad shader 语法, makepad 绘制

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5153
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル