Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

godot-shaders-basics

БесплатноЗапускает вложенные скриптыНе проверен

Expert Godot shader patterns for batch-safe hitflash, alpha-scissor foliage/dissolve, screenspace postFX, depth reconstruction, triplanar, and instance…

thedivergentaiот thedivergentai★ 1 019 звёзд на GitHub

Об этом скилле

NEVER Do in Shaders

  • NEVER use discard unconditionally for optimization — It prevents the depth prepass from working effectively. A discarded pixel still costs vertex processing; sometimes not rendering the object is better [1].
  • NEVER use if/else for dynamic states in high-performance shaders — GPUs hate branching. Use mix(), step(), and smoothstep() for mathematical, hardware-optimized selection [5, 21].
  • NEVER compare floats exactly — Hardware precision varies; if (v == 0.5) is unreliable. Use abs(a - b) < epsilon or step().
  • NEVER use standard Alpha Blending for massive foliage — It prevents shadows and SSR. Use Alpha Scissor or Alpha Hash (dithering) to enable depth prepass and shadow casting [7].
  • NEVER hardcode POSITION to vec4(VERTEX, 1.0) for full-screen quads in 4.3+ — Godot 4.3 uses Reversed-Z depth; this will cause clipping. Use POSITION = vec4(VERTEX.xy, 1.0, 1.0) [8, 9].
  • NEVER duplicate materials to change one color/value on many enemies — Use instance uniform. This allows unique values for thousands of nodes while maintaining a single draw call (batching) [10].
  • NEVER use TIME without a speed multiplier — Fragment speed should be controllable via uniforms to ensure consistency across different gameplay states.
  • NEVER forget hint_source_color for color uniforms — Without it, the engine treats colors as linear math, leading to incorrect gamma and washed-out visuals in the inspector.
  • NEVER calculate complex math in fragment() that could be in vertex() — vertex() runs once per point; fragment() runs millions of times per frame. Interpolate values via varying instead.
  • NEVER use #define macros for dynamic runtime toggles — These create new shader permutations, causing massive compilation stutters when first encountered in-game. Use uniforms instead.
  • NEVER forget to normalize vectors — Using reflect(dir, normal) on unnormalized vectors causes severe rendering artifacts and incorrect lighting math.
  • NEVER modify UV without bounds checking or fract() — Shifting UVs beyond 0.0-1.0 without repeat wrapping or clamping will sample edge pixels or return black, breaking texture consistency.

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

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

dissolve_scissor_expert.gdshader

Mask dissolve with ALPHA_SCISSOR for depth-prepass + shadows.

foliage_wind_sway_expert.gdshader

World-space wind sway for foliage batches.

global_grass_flatten.gdshader

global uniform player interaction flattening grass.

screenspace_hex_pixelate.gdshader

hint_screen_texture stylized postFX.

screenspace_full_quad.gdshader

Reversed-Z-safe full-rect post pass.

depth_world_reconstruction.gdshader

hint_depth_texture → world position.

Полный SKILL.md на GitHub

Установить godot-shaders-basics в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/2d-effect-recipes.mdreferences/3d-and-postfx-recipes.mdreferences/expert-advanced-patterns.mdreferences/migration-notes.mdreferences/uniforms-and-builtins.mdscripts/depth_world_reconstruction.gdshaderscripts/dissolve_scissor_expert.gdshaderscripts/foliage_wind_sway_expert.gdshaderscripts/global_grass_flatten.gdshaderscripts/instance_texture_array.gdshaderscripts/instance_uniform_hitflash.gdshaderscripts/noise_terrain_displacement.gdshaderscripts/screenspace_full_quad.gdshaderscripts/screenspace_hex_pixelate.gdshaderscripts/shader_parameter_animator.gdscripts/shader_warmup_loader.gdscripts/triplanar_world_mapping.gdshaderscripts/vfx_port_shader.gdshader

FAQ

Что делает скилл godot-shaders-basics?

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-position FX. Keywords: instance uniform, ALPHA_SCISSOR, hint_screen_texture, hint_depth_texture, global uniform, sampler2DArray, canvas_item, spatial, post-processing.

Как установить скилл godot-shaders-basics?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл godot-shaders-basics запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить godot-shaders-basics с