agentleFS
fetastyfetasty/godot-skills/godot-shader/SKILL.md

godot-shader

Skill29 starsChanged 6 months agoMITView on GitHub

Godot 4 shaders, materials, visual effects, and rendering customization: Godot shading language (.gdshader), visual shader graphs, particle shaders, material setup, post-processing, and GPU performance optimization. Use when working on Godot 4 rendering for: (1) Writing or optimizing .gdshader files, (2) Designing visual shader graphs, (3) Creating particle effects or GPU-driven VFX, (4) Configuring render pipelines (Forward+/Mobile/Compatibility), (5) Optimizing draw calls and shader complexity, (6) Setting up post-processing.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. alexmeckes/godot-claude-skills★ 35same name
    2. mattstruble/skills★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for: PC, console, high-end mobile

    line 22
  2. Distinctive:

    Use for: mobile devices, low-end hardware

    line 28
  3. Distinctive:

    Use for: web exports, very old hardware (OpenGL 3.3/WebGL 2)

    line 33
  4. Distinctive:

    No compute shaders — plan visual design around this if targeting web

    line 34
  5. Very specific:

    Use #include (Godot 4.3+) or #define for shared functions

    line 44
  6. Distinctive:

    All uniforms must have descriptive names and appropriate hints

    line 75
  7. Distinctive:

    No magic numbers — use named constants or documented uniform values

    line 77
  8. Very specific:

    Use when a spatial shader is unnecessary

    line 82
  9. Very specific:

    Use when StandardMaterial3D doesn't have a needed feature

    line 88
  10. Distinctive:

    Use sparingly — each overlay adds a draw call per mesh

    line 93
  11. Very specific:

    Use GPUParticles3D/GPUParticles2D for large counts (100+)

    line 109
  12. Very specific:

    Write shader_type particles for custom behavior

    line 110
  13. Very specific:

    Use TRANSFORM for position, VELOCITY for movement, COLOR/CUSTOM for data

    line 112
  14. Very specific:

    Use CPUParticles3D/CPUParticles2D for small counts (<50) or Compatibility renderer

    line 115
  15. Very specific:

    Use visibility_aabb to cull off-screen particles

    line 120
  16. Distinctive:

    Use sparingly — each effect adds a full-screen pass

    line 134
  17. Distinctive:

    Use for: heat distortion, underwater, damage vignette, blur effects

    line 142
  18. Very specific:

    Use hint_default_white/hint_default_black for optional textures

    line 154
  19. Very specific:

    Avoid dynamic branching in fragment shaders — use mix() and step() instead

    line 155
  20. Distinctive:

    Not using mipmaps on textures sampled at varying distances

    line 175
  21. Very specific:

    Not setting render_priority on transparent materials — incorrect sort order

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Godot Shader Specialist

Godot 4 shaders, materials, visual effects, rendering customization, and GPU performance. Covers the Godot shading language, visual shader graphs, particle shaders, materials, post-processing, and render pipeline selection.

Renderer Selection

Forward+ (Default for Desktop)

  • Use for: PC, console, high-end mobile
  • Features: clustered lighting, volumetric fog, SDFGI, SSAO, SSR, glow
  • Supports unlimited real-time lights via clustered rendering
  • Best visual quality, highest GPU cost

Mobile Renderer

  • Use for: mobile devices, low-end hardware
  • Features: limited lights per object (8 omni + 8 spot), no volumetrics
  • Lower precision, fewer post-process options

Compatibility Renderer

  • Use for: web exports, very old hardware (OpenGL 3.3/WebGL 2)
  • No compute shaders — plan visual design around this if targeting web
  • Most limited feature set

Shader File Standards

  • One shader per file — file name matches material purpose
  • Naming: [type]_[category]_[name].gdshader
    • spatial_env_water.gdshader (3D environment water)
    • canvas_ui_healthbar.gdshader (2D UI health bar)
    • particles_combat_sparks.gdshader (particle effect)
  • Use #include (Godot 4.3+) or #define for shared functions

Shader Types

TypeUse
shader_type spatial3D mesh rendering
shader_type canvas_item2D sprites, UI elements
shader_type particlesGPU particle behavior
shader_type fogVolumetric fog effects
shader_type skyProcedural sky rendering

Code Standards

shader_type spatial;

// Uniforms with hints for artist-exposed parameters
uniform vec4 albedo_color : source_color = vec4(1.0);
uniform float roughness : hint_range(0.0, 1.0) = 0.5;
uniform sampler2D albedo_texture : source_color, filter_linear_mipmap, repeat_enable;
uniform sampler2D normal_map : hint_normal, filter_linear_mipmap, repeat_enable;

// Group uniforms for inspector organization — Godot 4.3+
group_uniforms Albedo;
uniform vec4 albedo_color : source_color = vec4(1.0);
uniform sampler2D albedo_texture : source_color, filter_linear_mipmap, repeat_enable;
group_uniforms Normal;
uniform sampler2D normal_map : hint_normal, filter_linear_mipmap, repeat_enable;
  • All uniforms must have descriptive names and appropriate hints
  • Comment non-obvious calculations, especially math-heavy sections
  • No magic numbers — use named constants or documented uniform values

Material Setup

StandardMaterial3D

  • Use when a spatial shader is unnecessary
  • Features: albedo, metallic/roughness, emission, normal, AO, detail maps
  • Performance: significantly cheaper than custom shaders
  • Good for 80%+ of project materials

ShaderMaterial

  • Use when StandardMaterial3D doesn't have a needed feature
  • Attach a .gdshader file or use ShaderMaterial for code-defined shaders

Material Overlay

  • Adds an extra render pass on a MeshInstance3D
  • Use sparingly — each overlay adds a draw call per mesh
  • Good for: damage flash, selection highlight, temporary effects

Post-4.3 Rendering Changes

From the godot skill references — key changes the model may not know:

  • 4.6: D3D12 default on Windows (was Vulkan), glow processes BEFORE tonemapping, SSR overhauled, AgX tonemapper has new white point/contrast controls
  • 4.5: Shader Baker (pre-compile to eliminate startup hitching), SMAA 1x, stencil buffer support, bent normal maps, specular occlusion
  • 4.4: Shader texture types changed from Texture2D to Texture

Particle Systems

GPU Particles (preferred)

  • Use GPUParticles3D/GPUParticles2D for large counts (100+)
  • Write shader_type particles for custom behavior
  • Particle shader controls: spawn, velocity, color over lifetime, size over lifetime
  • Use TRANSFORM for position, VELOCITY for movement, COLOR/CUSTOM for data

CPU Particles

  • Use CPUParticles3D/CPUParticles2D for small counts (<50) or Compatibility renderer
  • Simpler setup — use inspector properties

Particle Performance

  • Set lifetime to minimum needed
  • Use visibility_aabb to cull off-screen particles
  • LOD: reduce particle count at distance
  • Target: all particle systems combined < 2ms GPU time

Post-Processing

WorldEnvironment

  • WorldEnvironment node with Environment resource for scene-wide effects
  • Configure: glow, tone mapping, SSAO, SSR, fog, adjustments
  • Multiple environments for different areas (indoor vs outdoor)

Compositor Effects (4.3+)

  • Custom full-screen effects via CompositorEffect scripts
  • Access screen texture, depth, normals for custom passes
  • Use sparingly — each effect adds a full-screen pass

Screen-Space Shaders

uniform sampler2D screen_texture : hint_screen_texture;
uniform sampler2D depth_texture : hint_depth_texture;
  • Apply via ColorRect or TextureRect covering the viewport
  • Use for: heat distortion, underwater, damage vignette, blur effects

Performance Optimization

Draw Call Management

  • MultiMeshInstance3D for repeated objects — batches draw calls
  • MeshInstance3D.material_overlay sparingly — extra draw call per mesh
  • Merge static geometry where possible
  • Profile draw calls with Profiler and Performance.get_monitor()

Shader Complexity

  • Minimize texture samples in fragment shaders — expensive on mobile
  • Use hint_default_white/hint_default_black for optional textures
  • Avoid dynamic branching in fragment shaders — use mix() and step() instead
  • Pre-compute expensive operations in vertex shader when possible
  • LOD materials: simplified shaders for distant objects

Render Budgets (60 FPS target)

SubsystemBudget
Geometry rendering4-6ms
Lighting2-3ms
Shadows2-3ms
Particles/VFX1-2ms
Post-processing1-2ms
UI< 1ms

Common Shader Anti-Patterns

  • Texture reads in a loop — exponential cost
  • Full precision (highp) everywhere on mobile — use mediump/lowp where possible
  • Dynamic branching on per-pixel data — unpredictable on GPUs
  • Not using mipmaps on textures sampled at varying distances
  • Overdraw from transparent objects without depth pre-pass
  • Post-processing effects sampling screen texture multiple times — blur should be two-pass
  • Not setting render_priority on transparent materials — incorrect sort order

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.