authoring-godot-prompt…
Use when writing or editing a SKILL.md or an agent definition in this repo — required frontmatter, section ordering, and the GDScript-then-C# example…
Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects
$ npx -y skills add jame581/GodotPrompter --skill shader-basics --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/shader-basicsContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects
name: shader-basics description: Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects
All examples target Godot 4.3+ with no deprecated APIs.
> **Related skills:** **animation-system** for shader-driven effects like hit flash, **godot-optimization** for shader performance considerations, **camera-system** for post-processing camera effects, **2d-essentials** for 2D lighting, pixel-art shaders, and CanvasTexture normal maps, **3d-essentials** for spatial shaders and environment materials, **particles-vfx** for custom particle shaders, **tween-animation** for animating shader parameters at runtime.
---
| Shader Type | Applied To | Use For | |------------------|--------------------------|--------------------------------------------------| | `canvas_item` | 2D nodes (Sprite2D, Control, etc.) | 2D effects — outlines, dissolve, color swap | | `spatial` | 3D meshes (MeshInstance3D) | 3D materials — water, terrain, toon shading | | `particles` | GPUParticles2D/3D | Custom particle behavior | | `sky` | WorldEnvironment | Procedural sky rendering | | `fog` | FogVolume | Volumetric fog effects |
Shader (.gdshader) → The code (GLSL-like language) ShaderMaterial → Instance of a shader with specific uniform values CanvasItemMaterial / StandardMaterial3D → Built-in materials (no code needed)
Multiple nodes can share the same Shader but have different ShaderMaterial instances with different uniform values (e.g., same dissolve shader but different dissolve progress per enemy).
1. Select a node (e.g., Sprite2D) 2. In Inspector → Material → New ShaderMaterial 3. On the ShaderMaterial → Shader → New Shader 4. Edit the `.gdshader` file in the built-in editor
Or create a `.gdshader` file directly in the FileSystem dock.
---
Godot uses a GLSL ES 3.0-like language with Godot-specific additions.
shader_type canvas_item;
void fragment() {
// COLOR is the output pixel color
// TEXTURE is the sprite's texture
// UV is the texture coordinate (0,0 top-left to 1,1 bottom-right)
vec4 tex = texture(TEXTURE, UV);
COLOR = tex;
}shader_type spatial;
void fragment() {
// ALBEDO is the base color (vec3)
ALBEDO = vec3(0.8, 0.2, 0.2);
}| Variable | Type | Description | |------------|--------|---------------------------------------| | `UV` | `vec2` | Texture coordinates | | `COLOR` | `vec4` | Output color (set this in `fragment()`) | | `TEXTURE` | `sampler2D` | The node's texture | | `VERTEX` | `vec2` | Vertex position (in `vertex()`) | | `TIME` | `float`| Elapsed time in seconds | | `SCREEN_UV`| `vec2` | Screen-space UV (for screen effects) |
> `SCREEN_TEXTURE` was removed in Godot 4.0. To read the screen, declare a uniform: `uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;`
| Variable | Type | Description | |-------------|--------|---------------------------------------| | `ALBEDO` | `vec3` | Base surface color | | `METALLIC` | `float`| Metallic value (0.0–1.0) | | `ROUGHNESS` | `float`| Roughness value (0.0–1.0) | | `NORMAL` | `vec3` | Surface normal (for normal mapping) | | `EMISSION` | `vec3` | Emissive color | | `ALPHA` | `float`| Transparency (enable in render mode) | | `VERTEX` | `vec3` | Vertex position (in `vertex()`) |
Uniforms expose shader values to the Inspector and code.
shader_type canvas_item;
uniform float speed : hint_range(0.0, 10.0, 0.1) = 1.0;
uniform vec4 tint_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);
uniform sampler2D noise_texture : filter_linear_mipmap;
void fragment() {
vec4 tex = texture(TEXTURE, UV);
COLOR = tex * tint_color;
}| Hint | Type | Description | |-----------------------------|--------------|-------------------------------------| | `hint_range(min, max, step)` | `float/int` | Slider in Inspector | | `source_color` | `vec4` | Color picker in Inspector | | `filter_linear_mipmap` | `sampler2D` | Texture filtering mode | | `repeat_enable` | `sampler2D` | Allow texture tiling | | `hint_normal` | `sampler2D` | Treat as normal map |
var mat: ShaderMaterial = $Sprite2D.material
mat.set_shader_parameter("speed", 2.0)
mat.set_shader_parameter("tint_color", Color.RED)var mat = GetNode<Sprite2D>("Sprite2D").Material as ShaderMaterial;
mat.SetShaderParameter("speed", 2.0f);
mat.SetShaderParameter("tint_color", Colors.Red);---
The canvas_item recipes most projects need: **dissolve** (noise + edge glow), **outline** (sample neighbors, expand alpha), **flash-white** (uniform-driven hit effect), **color swap** (palette shift), **scrolling UV** (water/lava/clouds), **wave distortion**.
> See [references/2d-shader-recipes.md](references/2d-shader-recipes.md) for complete shader code for all six recipes.
---
Spatial-shader recipes: **toon/cel shading** (banded NdotL), **rim lighting / Fresnel** (1 - NdotV), **simple water surface** (UV scroll + normal-map blend + Fresnel).
> See [references/3d-shader-recipes.md](references/3d-shader-recipes.md) for the full shader source for each recipe.
---
Visual shaders provide a node-based graph editor — no code required.
| Use Visual Shaders When | Use Code Shaders When | |--------------------------------|------------------------------------| | Prototyping effects quickly | Complex math or branching logic | | Artists need to tweak values | Need precise control over every line | | Learning
Agentic skills framework for Godot 4.x game development. Gives AI coding agents domain-specific expertise for GDScript and C# projects.
Use when writing or editing a SKILL.md or an agent definition in this repo — required frontmatter, section ordering, and the GDScript-then-C# example…
Use when cutting a GodotPrompter release or bumping its version — the version-bump sequence, tag-triggered workflow, and the marketplace manifests that must…
Use when working with 2D-specific systems — TileMaps, parallax scrolling, 2D lights and shadows, canvas layers, particles 2D, custom drawing, and 2D meshes in…
Use when working with 3D-specific systems — materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling, and decals in Godot…
Use when building character abilities — Resource-based abilities with cost/cooldown/cast, buffs/debuffs, stat modifiers, gameplay tags, and HUD binding
Use when creating Godot editor plugins — EditorPlugin, @tool scripts, custom inspectors, and dock panels