Agent skill

Godot Shader Fundamentals

by 925236118 in 925236118/AlphaAgent

Godot 4 Shader 基础语法与数学,包含类型系统、Uniform变量、内置函数及实用技巧. An agent skill from 925236118/AlphaAgent.

MITAuto-check passedGame Development

Install Godot Shader Fundamentals

skills CLI
$ npx skills add 925236118/AlphaAgent --skill godot-shader-fundamentals -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 925236118/AlphaAgent godot-shader-fundamentals --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/925236118/AlphaAgent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/addons/agent/skills/default_skills/godot-shader-fundamentals .claude/skills/godot-shader-fundamentals && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
godot-shader-fundamentals
GitHub stars
103
Token cost
~1.5k tokens
SKILL.md length
180 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Godot 4 Shader 基础语法与数学,包含类型系统、Uniform变量、内置函数及实用技巧. An agent skill from 925236118/AlphaAgent.

  • Works in 12 steps: Shader 概述 → Shader 类型 → 数据类型 → …
  • Tasks that involve Game development
  • SKILL.md covers 1. Shader 概述, 2. Shader 类型, 3. 数据类型 and 4. Uniform 变量, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Godot Shader Fundamentals is an agent skill from 925236118/AlphaAgent. Godot 4 Shader 基础语法与数学,包含类型系统、Uniform变量、内置函数及实用技巧。

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Game development and Shaders. It works with Godot. The repository describes itself as: 为Godot引擎编辑器开发的Ai Agent插件. The licence is MIT.

When your agent uses it

  • Tasks that involve Game development
  • Tasks that involve Shaders

Example prompts

  • “/godot-shader-fundamentals”

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Shader 概述
  2. Shader 类型
  3. 数据类型
  4. Uniform 变量
  5. 内置全局变量
  6. 基础数学函数
  7. 三角函数
  8. 向量运算
  9. UV 操作模式
  10. 颜色操作
  11. 噪声函数
  12. 实用技巧

What it can do on your machine

Read from SKILL.md and the folder at commit ed0da30. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are gdscript and glsl).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Godot Shader Fundamentals loads about 1.5k tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 180 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~19
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 925236118/AlphaAgent at commit ed0da30, republished under its MIT licence (© 925236118). 180 words, ~1,540 tokens.

Download SKILL.mdSave it as .claude/skills/godot-shader-fundamentals/SKILL.md (or your agent's skills folder).
name
godot-shader-fundamentals
description
Godot 4 Shader 基础语法与数学,包含类型系统、Uniform变量、内置函数及实用技巧。

Godot Shader 基础

1. Shader 概述

Shader 是一种运行在 GPU 上的特殊程序,负责决定如何处理网格模型的数据(如顶点位置、颜色、法线等)以及如何将它们绘制到屏幕上。Godot 引擎的 Shader 语言基于 GLSL,进行了简化和扩展。

为什么使用 Shader
  • 高性能:GPU 并行处理,适合处理大量像素
  • 程序化生成:可以动态生成纹理、颜色、效果
  • 视觉效果:实现光照、阴影、材质等复杂效果
  • 实时反馈:支持时间相关的动态效果

2. Shader 类型

Godot 4 支持 5 种 Shader 类型:

spatial(3D 着色器)

用于 3D 场景中的物体渲染,如网格、地形等。

gdscript
shader_type spatial;

void vertex() {
    // 顶点着色器:处理每个顶点
}

void fragment() {
    // 片段着色器:处理每个像素
}

void light() {
    // 光照着色器:处理光照计算
}
canvas_item(2D 着色器)

用于 2D 场景中的渲染,如 Sprite2D、Control 组件、ColorRect 等。

gdscript
shader_type canvas_item;

void vertex() {
    // 顶点着色器
}

void fragment() {
    // 片段着色器
    COLOR = vec4(1.0, 0.0, 0.0, 1.0); // 输出红色
}
particles(粒子着色器)
gdscript
shader_type particles;

void start() {
    // 粒子产生时调用
}

void process() {
    // 粒子每帧更新时调用
}

void fragment() {
    // 粒子片段着色器
}

3. 数据类型

基础类型
类型描述
void空类型
bool布尔类型
int有符号整型
float浮点数
bvec2/3/42/3/4 维布尔向量
ivec2/3/42/3/4 维整型向量
vec2/3/42/3/4 维浮点向量
矩阵类型
类型描述
mat22x2 矩阵
mat33x3 矩阵
mat44x4 矩阵
纹理类型
类型描述
sampler2D2D 纹理采样器
samplerCube立方体纹理采样器
sampler3D3D 纹理采样器

4. Uniform 变量

Uniform 变量用于从 CPU 端向 GPU 端传递数据。

gdscript
shader_type canvas_item;

uniform float my_float = 1.0;
uniform vec4 my_color;
uniform sampler2D my_texture;
Hint 提示
Hint描述
hint_range(min, max)范围提示
source_color颜色提示
hint_albedo纹理提示(默认白色)
hint_normal法线纹理提示
gdscript
uniform vec4 hurt_color : source_color;
uniform float hurt_intensity : hint_range(0.0, 1.0) = 0.0;
uniform float progress : hint_range(0.0, 1.0, 0.1) = 0.5;

5. 内置全局变量

数学常量
变量描述值
PI圆周率3.14159265359
TAU2倍圆周率6.28318530718
E自然常数 e2.71828182846
时间相关
变量描述
TIME从游戏开始经过的时间(秒)
FRAME当前帧编号
UV 坐标
变量描述
UV当前像素的 UV 坐标(0.0 ~ 1.0)

6. 基础数学函数

绝对值与取整
glsl
float abs(float x)
float floor(float x)
float ceil(float x)
float round(float x)
float fract(float x)
极值与限制
glsl
float min(float x, float y)
float max(float x, float y)
float clamp(float x, min_val, max_val)
float step(float edge, float x)
插值函数
glsl
float mix(float x, float y, float alpha)
float smoothstep(float edge0, float edge1, float x)

7. 三角函数

glsl
sin(x), cos(x), tan(x)
asin(x), acos(x), atan(x)

8. 向量运算

点乘与叉乘
glsl
float dot(vec2 x, vec2 y)
vec3 cross(vec3 x, vec3 y)
长度与归一化
glsl
float length(vec2 v)
vec2 normalize(vec2 v)
float distance(vec2 a, vec2 b)
反射与折射
glsl
vec2 reflect(vec2 I, vec2 N)
vec3 refract(vec3 I, vec3 N, float eta)

9. UV 操作模式

缩放
gdscript
shader_type canvas_item;

uniform vec2 scale = vec2(2.0, 2.0);
uniform vec2 pivot = vec2(0.5, 0.5);

void vertex() {
    UV -= pivot;
    UV /= scale;
    UV += pivot;
}
旋转
gdscript
shader_type canvas_item;
render_mode unshaded;

uniform float angular_speed = 1.0;
uniform vec2 pivot = vec2(0.5, 0.5);

void vertex() {
    UV -= pivot;
    float rot = TIME * angular_speed;
    UV *= mat2(
        vec2(sin(rot), -cos(rot)),
        vec2(cos(rot), sin(rot))
    );
    UV += pivot;
}
偏移/滚动
gdscript
shader_type canvas_item;

uniform vec2 scroll_speed = vec2(1, 0.0);

void fragment() {
    vec2 offset_uv = UV + cos(TIME) * scroll_speed;
    COLOR = texture(TEXTURE, offset_uv);
}

10. 颜色操作

灰度处理
gdscript
shader_type canvas_item;

void fragment() {
    vec4 color = texture(TEXTURE, UV);
    float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
    COLOR = vec4(vec3(gray), color.a);
}
颜色调整
gdscript
shader_type canvas_item;

uniform float brightness = 0.0;
uniform float contrast = 1.0;
uniform float saturation = 1.0;

void fragment() {
    vec4 color = texture(TEXTURE, UV);
    color.rgb += brightness;
    color.rgb = (color.rgb - 0.5) * contrast + 0.5;
    float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
    color.rgb = mix(vec3(gray), color.rgb, saturation);
    COLOR = color;
}

11. 噪声函数

随机数
glsl
float random(float x) {
    return fract(sin(x) * 43758.5453);
}

float noise(vec2 st) {
    vec2 i = floor(st);
    vec2 f = fract(st);
    float a = random(i);
    float b = random(i + vec2(1.0, 0.0));
    float c = random(i + vec2(0.0, 1.0));
    float d = random(i + vec2(1.0, 1.0));
    vec2 u = f * f * (3.0 - 2.0 * f);
    return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
}
FBM (分形布朗运动)
glsl
float fbm(vec2 st) {
    float value = 0.0;
    float amplitude = 0.5;
    float frequency = 1.0;

    for (int i = 0; i < 6; i++) {
        value += amplitude * noise(st * frequency);
        frequency *= 2.0;
        amplitude *= 0.5;
    }
    return value;
}

12. 实用技巧

创建圆形
glsl
shader_type canvas_item;

void fragment() {
    vec2 center = vec2(0.5, 0.5);
    float radius = 0.4;
    float dist = length(UV - center);
    float circle = step(radius, dist);
    COLOR = vec4(vec3(circle), 1.0);
}
波浪效果
glsl
void fragment() {
    float wave = sin(UV.y * 10.0 + TIME * 2.0) * 0.1 + 0.5;
    COLOR = vec4(vec3(wave), 1.0);
}
条纹动画
glsl
void fragment() {
    float stripe = sin(UV.y * 20.0 + TIME * 5.0);
    stripe = stripe * 0.5 + 0.5;
    COLOR = vec4(vec3(stripe), 1.0);
}

13. 性能优化

减少纹理采样
gdscript
// 错误:多次采样
void fragment() {
    float r = texture(TEXTURE, UV).r;
    float g = texture(TEXTURE, UV + vec2(0.1, 0.0)).g;
}

// 正确:单次采样
void fragment() {
    vec4 tex = texture(TEXTURE, UV);
    float r = tex.r;
    float g = tex.g;
}
避免分支
gdscript
// 避免
if (condition) {
    color = a;
} else {
    color = b;
}

// 推荐:使用 step 或 mix
color = mix(a, b, step(threshold, value));

© 925236118, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in addons/agent/skills/default_skills/godot-shader-fundamentals of 925236118/AlphaAgent.

Open the folder on GitHubat commit ed0da30

Compare with similar skills

Godot Shader Fundamentals next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Godot Shader Fundamentals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Godot Shader Fundamentals this skill925236118/AlphaAgent103—~1.5kAutomated safety check: PassMIT
Godot UI Rich Textthedivergentai/GD-Agentic-Skills821—~3.2kAutomated safety check: PassLGPL-3.0
Shader Basicsjame581/GodotPrompter805—~3.7kAutomated safety check: PassMIT
Godot Genre Card Gamethedivergentai/GD-Agentic-Skills821—~3.1kAutomated safety check: PassLGPL-3.0
Godot Particlesthedivergentai/GD-Agentic-Skills821—~3.4kAutomated safety check: PassLGPL-3.0
Godot Shaders Basicsthedivergentai/GD-Agentic-Skills821—~3.3kAutomated safety check: PassLGPL-3.0

Similar skills

  • Godot UI Rich Text

    thedivergentai/GD-Agentic-Skills

    Expert blueprint for RichTextLabel with BBCode formatting (bold, italic, colors, images, clickable links) and custom effects.

    821 GitHub stars~3.2k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Shader Basics

    jame581/GodotPrompter

    A skill your agent uses when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects

    805 GitHub stars~3.7k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot Genre Card Game

    thedivergentai/GD-Agentic-Skills

    Expert blueprint for digital card games (CCG/Deckbuilders) including card data structures (Resource-based), deck management (draw/discard/reshuffle), turn logic, hand layout (arcing), drag-and-drop…

    821 GitHub stars~3.1k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Godot Particles

    thedivergentai/GD-Agentic-Skills

    Expert blueprint for GPU particle systems (explosions, magic effects, weather, trails) using GPUParticles2D/3D, ParticleProcessMaterial, gradients, sub-emitters, and custom shaders.

    821 GitHub stars~3.4k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Godot Shaders Basics

    thedivergentai/GD-Agentic-Skills

    Expert Godot shader patterns for batch-safe hitflash, alpha-scissor foliage/dissolve, screenspace postFX, depth reconstruction, triplanar, and instance uniforms — not first-shader tutorials.

    821 GitHub stars~3.3k tokensUpdated 1 mo ago
    Game DevelopmentAuto-check passed
  • Godot Shaders

    gamedev-skills/awesome-gamedev-agent-skills

    Write Godot 4.7 shaders in the Godot Shading Language: canvasitem shaders for 2D and spatial shaders for 3D, with vertex/fragment functions, uniforms (sourcecolor, hintrange), TIME/UV animation, and…

    1.4k GitHub stars~1.4k tokensUpdated 2 days ago
    Game DevelopmentAuto-check passed

More from 925236118/AlphaAgent

All 17 skills in this repo
  • Godot Gdscript Patterns

    925236118/AlphaAgent

    Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization.

    103 GitHub starsUsed in 10 repos~5k tokens
    Auto-check passed
  • Godot Tscn Format

    925236118/AlphaAgent

    Godot 4.x .tscn 场景文件纯文本格式规范与 AI 操作指南 — 文件结构、资源引用、 Transform 变换、属性值格式、信号连接,以及 AI 直接读写 .tscn 文件的操作方法。

    103 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Godot Autoload Patterns

    925236118/AlphaAgent

    Godot 4 Autoload单例模式最佳实践,包含全局管理、事件总线、信号通信. An agent skill from 925236118/AlphaAgent.

    103 GitHub stars~1.5k tokensUpdated 3 days ago
    Auto-check passed
  • Godot Buff System

    925236118/AlphaAgent

    Godot 4 Buff系统完整实现,支持状态效果管理、持续时间、循环效果、层叠机制等。使用Resource+Component架构。

    103 GitHub stars~3.4k tokensUpdated 3 days ago
    Auto-check passed
  • Godot Building System

    925236118/AlphaAgent

    Godot 4 建造系统实现,包含GridMap方块管理、第一人称视角、射线交互. An agent skill from 925236118/AlphaAgent.

    103 GitHub stars~1k tokensUpdated 3 days ago
    Auto-check passed
  • Godot Ecs Component

    925236118/AlphaAgent

    Godot 4 ECS实体组件系统模式,包含组件化设计、数据与逻辑分离、组件通信. An agent skill from 925236118/AlphaAgent.

    103 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Godot Shader Fundamentals

What does Godot Shader Fundamentals do?

Godot 4 Shader 基础语法与数学,包含类型系统、Uniform变量、内置函数及实用技巧. An agent skill from 925236118/AlphaAgent. Godot Shader Fundamentals is an agent skill from 925236118/AlphaAgent.

When should I use Godot Shader Fundamentals?

Godot Shader Fundamentals fits situations like: tasks that involve Game development; tasks that involve Shaders.

How do I install Godot Shader Fundamentals in Claude Code?

Run `npx skills add 925236118/AlphaAgent --skill godot-shader-fundamentals -a claude-code`. Or copy the skill folder (addons/agent/skills/default_skills/godot-shader-fundamentals in 925236118/AlphaAgent) into .claude/skills/godot-shader-fundamentals in your project. Claude Code loads it when a task matches its description.

How do I install Godot Shader Fundamentals in Codex?

Run `npx skills add 925236118/AlphaAgent --skill godot-shader-fundamentals -a codex`. Or copy the skill folder (addons/agent/skills/default_skills/godot-shader-fundamentals in 925236118/AlphaAgent) into .agents/skills/godot-shader-fundamentals in your project. Codex loads it when a task matches its description.

Can I use Godot Shader Fundamentals in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 925236118/AlphaAgent --skill godot-shader-fundamentals -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/godot-shader-fundamentals, .gemini/skills/godot-shader-fundamentals, .github/skills/godot-shader-fundamentals and .opencode/skills/godot-shader-fundamentals in your project.

What does Godot Shader Fundamentals need to run?

SKILL.md names no scripts, command-line tools or credentials: Godot Shader Fundamentals is instructions for the agent only.

Does Godot Shader Fundamentals access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Godot Shader Fundamentals safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Godot Shader Fundamentals use?

Godot Shader Fundamentals is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Godot Shader Fundamentals use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Godot Shader Fundamentals?

Skills that share tags, products or a category with Godot Shader Fundamentals: Godot UI Rich Text (thedivergentai/GD-Agentic-Skills, 821 stars), Shader Basics (jame581/GodotPrompter, 805 stars), Godot Genre Card Game (thedivergentai/GD-Agentic-Skills, 821 stars) and Godot Particles (thedivergentai/GD-Agentic-Skills, 821 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Godot Shader Fundamentals?

925236118 (a GitHub user) maintains it in 925236118/AlphaAgent, which has 103 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 8, 2026.

Source: 925236118/AlphaAgent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.