Godot shaders basics

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot shaders basics is an AI agent skill from the GitHub repository 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. Trigger on draw-call batching breaks, discard vs depth-prepass, foliage shadows, post-process quads, or world

How to use this skill

Skill file

NEVER Do in Shaders

Scenario → Script Triggers

MANDATORY for the matching effect. Do NOT Load beginner canvas_item tint recipes or built-in variable glossaries here.

| Goal | Script |

|------|--------|

| Per-enemy hitflash without breaking batches | MANDATORY instance_uniform_hitflash.gdshader |

| Foliage wind + shadows | MANDATORY foliage_wind_sway_expert.gdshader (alpha scissor/hash — not unconditional discard) |

| Dissolve that keeps depth-prepass | MANDATORY dissolve_scissor_expert.gdshader |

| PostFX pixelate / stylize | MANDATORY screenspace_hex_pixelate.gdshader |

| Full-screen quad (Reversed-Z) | MANDATORY screenspace_full_quad.gdshader |

| Depth → world for water/fog | MANDATORY depth_world_reconstruction.gdshader |

| Grass flatten from player | global_grass_flatten.gdshader |

| UV-less cliffs/rocks | triplanar_world_mapping.gdshader |

| Unique textures on instanced meshes | instance_texture_array.gdshader |

| Vertex displacement terrain | noise_terrain_displacement.gdshader |

| Animate uniforms at runtime | shader_parameter_animator.gd |

| VFX port template | vfx_port_shader.gdshader |

Golden path for cutouts/dissolve: ALPHA_SCISSOR / alpha hash (see dissolve + foliage scripts) — not discard for optimization. NEVER list explains why.

Available Scripts

[instance_uniform_hitflash.gdshader](scripts/instance_uniform_hitflash.gdshader)

Instance-uniform flashes; one material, many unique intensities.

[dissolve_scissor_expert.gdshader](scripts/dissolve_scissor_expert.gdshader)

Mask dissolve with ALPHA_SCISSOR for depth-prepass + shadows.

[foliage_wind_sway_expert.gdshader](scripts/foliage_wind_sway_expert.gdshader)

World-space wind sway for foliage batches.

[global_grass_flatten.gdshader](scripts/global_grass_flatten.gdshader)

global uniform player interaction flattening grass.

[screenspace_hex_pixelate.gdshader](scripts/screenspace_hex_pixelate.gdshader)

hint_screen_texture stylized postFX.

[screenspace_full_quad.gdshader](scripts/screenspace_full_quad.gdshader)

Reversed-Z-safe full-rect post pass.

[depth_world_reconstruction.gdshader](scripts/depth_world_reconstruction.gdshader)

hint_depth_texture → world position.

[triplanar_world_mapping.gdshader](scripts/triplanar_world_mapping.gdshader)

World-axis projection without UVs.

[instance_texture_array.gdshader](scripts/instance_texture_array.gdshader)

sampler2DArray + instance uniform for unique batched textures.

[noise_terrain_displacement.gdshader](scripts/noise_terrain_displacement.gdshader)

Vertex noise displacement.

[vfx_port_shader.gdshader](scripts/vfx_port_shader.gdshader)

Validated VFX shader template.

[shader_parameter_animator.gd](scripts/shader_parameter_animator.gd)

Tween/runtime uniform animation without AnimationPlayer.

[shader_warmup_loader.gd](scripts/shader_warmup_loader.gd)

Pre-warm shader pipelines during loading screens to avoid first-frame stutter.

Expert Pointers

Deep recipes (on demand)

LLM-ignorance rule: if a general agent would not know it before reading, it lives here or in scripts/ — never delete, only move.

| Topic | Reference |

|-------|-----------|

| 2D dissolve/wave/outline | 2d-effect-recipes.md |

| 3D toon + vignette | 3d-and-postfx-recipes.md |

| Uniforms / built-ins | uniforms-and-builtins.md |

| Fog, compute, warmup | expert-advanced-patterns.md |

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API;

load Related Skills when routing work to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.