shaders
/shaders
Write shaders in Godot using the shader language or Visual Shaders. Use this skill when creating visual effects, custom materials, post-processing, dissolve effects, outlines, water effects, particle shaders, or any GPU-based rendering customization.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 18.06.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Write shaders in Godot using the shader language or Visual Shaders. Use this skill when creating visual effects, custom materials, post-processing, dissolve effects, outlines, water effects, particle shaders, or any GPU-based rendering customization.
Original author description
Write shaders in Godot using the shader language or Visual Shaders. Use this skill when creating visual effects, custom materials, post-processing, dissolve effects, outlines, water effects, particle shaders, or any GPU-based rendering customization.
How it works
- Shader Types
- Common Shader Effects
- Visual Shaders
- Render Modes
- Best Practices
SKILL.md preview
---
name: shaders
description: Write shaders in Godot using the shader language or Visual Shaders. Use this skill when creating visual effects, custom materials, post-processing, dissolve effects, outlines, water effects, particle shaders, or any GPU-based rendering customization.
metadata:
author: godot-dev
version: "1.0"
---
# Shaders
## Shader Types
### CanvasItem Shader (2D)
```gdshader
shader_type canvas_item;
uniform float brightness : hint_range(0.0, 2.0) = 1.0;
uniform vec4 tint_color : source_color = vec4(1.0);
void fragment() {
vec4 color = texture(TEXTURE, UV);
color.rgb *= brightness;
color *= tint_color;
COLOR = color;
}
```
### Spatial Shader (3D)
```gdshader
shader_type spatial;
uniform vec4 albedo_color : source_color = vec4(1.0);
uniform float metallic : hint_range(0.0, 1.0) = 0.0;
uniform float roughness : hint_range(0.0, 1.0) = 0.5;
uniform sampler2D albedo_texture : source_color;
void fragment() {
ALBEDO = texture(albedo_texture, UV).rgb * albedo_color.rgb;
METALLIC = metallic;
ROUGHNESS = roughness;
}
void light() {
DIFFUSE_LIGHT += dot(NORMAL, LIGHT) * ATTENUATION * ALBEDO;
}
```
### Particle Shader
```gdshader
shader_type particles;
uniform float spread = 45.0;
uniform float initial_velocity = 10.0;
uniform float gravity = 9.8;
void vertex() {
if (RESTARTING) {
VELOCITY = vec3(
cos(UNIFORM.x) * initial_velocity,
sin(UNIFORM.x) * initial_velocity,
0.0
);
}
VELOCITY.y -= gravity * DELTA;
}
```
## Common Shader Effects
### Dissolve Effect
```gdshader
shader_type canvas_item;
uniform float dissolve_amount : hint_range(0.0, 1.0) = 0.0;
uniform sampler2D noise_texture;
uniform vec4 dissolve_color : source_color = vec4(1.0, 0.5, 0.0, 1.0);
void fragment() {
vec4 color = texture(TEXTURE, UV);
float noise = texture(noise_texture, UV).r;
if (noise < dissolve_amount) {
discard;
}
float edge = smoothstep(dissolve_amount, dissolve_amount + 0.1, noise);
color.rgb = mix(dissolve_color.rgb, color.rgb, edge);
COLOR = color;
}
```
### Outline Shader
```gdshader
shader_type canvas_item;
uniform float outline_width = 2.0;
uniform vec4 outline_color : source_color = vec4(0.0, 0.0, 0.0, 1.0);
void fragment() {
vec4 color = texture(TEXTURE, UV);
float size = outline_width / float(textureSize(TEXTURE, 0).x);
float alpha = color.a;
alpha = max(alpha, texture(TEXTURE, UV + vec2(size, 0.0)).a);
alpha = max(alpha, texture(TEXTURE, UV - vec2(size, 0.0)).a);
alpha = max(alpha, texture(TEXTURE, UV + vec2(0.0, size)).a);
alpha = max(alpha, texture(TEXTURE, UV - vec2(0.0, size)).a);
if (color.a < 0.1 && alpha > 0.1) {
COLOR = outline_color;
} else {
COLOR = color;
}
}
```
### Water Effect
```gdshader
shader_type canvas_item;
uniform float wave_speed = 1.0;
uniform float wave_strength = 0.02;
uniform sampler2D noise_texture;
void fragment() {
vec2 uv = UV;
float time = TIME * wave_speed;
float noise = texture(noise_texture, uv + vec2(time, 0.0)).r;
uv.x += (noise - 0.5) * wave_strength;
vec4 color = texture(TEXTURE, uv);
COLOR = color;
}
```
## Visual Shaders
### Creating in Editor
1. Create new VisualShader resource
2. Add nodes from the toolbar
3. Connect nodes to build the graph
4. Output connects to final fragment/vertex
### Common Visual Shader Nodes
- **Texture2D**: Sample textures
- **Vector Operation**: Math on vectors
- **Float Operation**: Math on scalars
- **Color Constant**: Fixed colors
- **Time**: Animation time
- **UV**: Texture coordinates
## Render Modes
```gdshader
render_mode blend_mix; // Standard alpha blending
render_mode blend_add; // Additive blending
render_mode cull_disabled; // Double-sided
render_mode unshaded; // No lighting
render_mode depth_draw_never; // No depth writing
```
## Best Practices
1. **Use hints**: `hint_range`, `source_color` for editor integration
2. **Optimize**: Minimize texture reads in fragment shader
3. **Use varyings**: Pass data from vertex to fragment shader
4. **Comment code**: Shaders can be complex
5. **Test on target hardware**: Performance varies greatly
6. **Use render_mode**: Control blending, culling, etc.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · leex852/skills | 100 | MIT |
| shader-effects-inc/shaders | 100 | MIT |
| thrashr888/alchemy | 100 | MPL-2.0 |
| whoamnesia/astudio-motion | 90 | MIT |
Database snapshot: 13.11.2026 · package version 9dedafbe4f48 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100shader-basics
Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects - 100shader-basics
Use when implementing shaders — Godot shader language, visual shaders, common visual recipes, and post-processing effects - 100godot-shaders-basics
Expert blueprint for shader programming (visual effects, post-processing, material customization) using Godot's GLSL-like shader language. Covers canvas_item (2D), spatial (3D), uniforms, built-in variables, and performance. Use when implementing custom effects OR stylized… - 100scenario-godot-shaders
Use when writing or fixing Godot 4.7 shaders: .gdshader code (spatial, canvas_item, particles, sky, fog), VisualShader graphs built in code, stylized or toon water, dissolve or burn effects, hit flash, outlines, X-ray or portals with the stencil buffer, depth or screen-texture… - 100godot-shader-developer
Use when Codex should act as the Godot Shader Developer specialist from Agency Agents. Godot 4 visual effects specialist - Masters the Godot Shading Language (GLSL-like), VisualShader editor, CanvasItem and Spatial shaders, post-processing, and performance optimization for 2D/3D effects - 100godot-shaders
Write Godot 4.7 shaders in the Godot Shading Language: canvas_item shaders for 2D and spatial shaders for 3D, with vertex/fragment functions, uniforms (source_color, hint_range), TIME/UV animation, and screen-reading via hint_screen_texture. Use when authoring .gdshader files,…