Scenario Godot Shaders 标志

Scenario Godot Shaders

组织
scenario-labs
scenario-godot-shaders

当您要编写或修复 Godot 4.7 着色器时:.gdshader 代码(spatial、canvas_item、particles、sky、fog)、用代码构建的 VisualShader 图表、风格化或卡通水面、溶解或燃烧效果、受击闪光、描边、使用模板缓冲区的 X 射线或传送门、深度或屏幕纹理后期处理、全局或实例级 uniform、计算着色器和 Texture2DRD、着色器烘焙器;也适用于“着色器编译成功但效果不对”“后期效果导致黑屏”“我的 Godot 3 着色器坏了”“颜色看起来褪色”“首次启动时着色器卡顿”等问题。

Add to TypingMind

概览

发布者scenario-labs
代码仓库skills
技能名称scenario-godot-shaders
星标数
970
复刻数
114
附带文件
30
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 30 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 scenario-labs 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Scenario Godot Shaders AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/scenario-labs/skills/tree/main/skills/game-engines/godot/scenario-godot-shaders
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/scenario-labs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/game-engines/godot/scenario-godot-shaders .claude/skills/scenario-godot-shaders
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Scenario Godot Shaders,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Scenario Godot Shaders。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Scenario Godot Shaders 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Godot shaders (technical artist, shading)

Target: Godot 4.7.2.stable, macOS Apple Silicon (Metal by default, Vulkan through MoltenVK for GPU timing).

Expert level here means every shader is text the agent can diff, compiled under each target renderer, drawn on a real mesh in a window, swept across its parameters and looked at on a contact sheet, with its GPU cost measured against a StandardMaterial3D baseline. Compiling is not the same as working: several 4.7.2 failures only appear when the backend draws, and several bugs produce no error at all. If a sibling skill named here is missing from your available skills, ask the user to install it (npx skills add scenario-labs/skills --skill <name>); unattended, proceed from tool schemas and flag the gap.

REQUIRED BACKGROUND: scenario-godot-expert (channels, gd_run, the review loop, 4.7 traps).

Stance (the expert delta)

  1. Code first, graphs on request. Text shaders give loops, functions, #include and clean diffs (Godotneers, Shaderland [01:10:09]; Daniel Ilett on the gaps of VisualShader). When a human wants a graph, build the VisualShader in code (add_node, connect_nodes, an Expression node for the maths) and save it as .tres; port names are not exposed to GDScript, so output indices are hard-coded and checked by reading get_code() [added, run 2026-10-02].
  2. Compile headless, then draw windowed. Headless get_shader_uniform_list() catches language errors per --rendering-method in about 0.4 s per renderer. Stencil reads in the opaque pass and fog shaders under Compatibility only fail when a window draws them. Uninitialized locals and DEPTH written in one branch never fail at all, so the linter checks those [added, run 2026-10-02].
  3. World or object space beats mesh UVs. Dissolve, wind, water and triplanar effects should be driven from object-space or world-space coordinates, so seams and UV stretch disappear (StayAtHomeDev dissolve [00:09:59], DevPoodle triplanar, Dylearn grass). For a shared material, put the per-object values (bounds, amount) in instance uniforms, or each mesh dissolves at the wrong height [added].
  4. Water that does not slide. Use two panned copies of one seamless cellular noise, multiply them, raise to 1.25, and share them between vertex() and fragment() so the crests sit on the wave tops (Bramwell [00:11:57 to 00:20:57]). Use hybrid toon bands, a smoothstep only near each cut, so the bands do not flicker (Dylearn [00:13:42]). Shore foam comes from vertical depth, reconstructed from the depth texture with the reversed-z formula [added].
  5. HDR edges need three things together: a color above 1.0, the EMISSION output, and Glow in the WorldEnvironment (StayAtHomeDev [00:07:36], Daniel Ilett [00:10:22], Pixezy [00:06:55]).
  6. Know what moves a material to the transparent pass. Writing ALPHA or reading the screen or depth texture moves it there. It loses shadows and sorting, and it is invisible to other screen-reading materials (docs). Use ALPHA_SCISSOR_THRESHOLD for dissolves: the material stays opaque and the shadow dissolves too. Scissor is still an alpha test: like discard, it gives up early-Z for that mesh (docs), which costs most on mobile tile GPUs, so swap the dissolve material in only for the effect (P18). Stencil readers must be transparent, with a render_priority above the writer's (LowQualityCoding [00:07:35]).
  7. Compute: on screen, stay on the main device. Texture2DRD needs the main RenderingDevice inside RenderingServer.call_on_render_thread, and no submit or sync (The Pathfinders Codex [00:03:07]). To get results back on the CPU, use a local device, free every RID and test parity against a CPU version (DevPoodle [00:02:21], Crigz [00:11:24]).
  8. Bake shaders from a windowed export. The shader baker runs only when the export process has a rendering device. A --headless export with shader_baker/enabled=true silently packs nothing extra [added, run 2026-10-02].

Establish first

  • Target renderers: Forward+ (desktop), Mobile (phones), Compatibility (web, old GPUs); each decides which hints and stages exist. Default: Forward+ plus one named fallback.
  • Style: toon, PBR or pixel art. Decide the band count, the outline method (stencil or inverted hull) and whether Glow is on.
  • Budget: GPU ms per effect against a StandardMaterial3D baseline. Default: under +0.5 ms at 1080p on this Mac for a hero effect, confirmed on the device.
  • Who edits: an agent (text) or a human artist too (VisualShader .tres, grouped uniforms with hints).
  • Shared or unique materials: per-instance values decide between instance uniforms (at most 16, no textures), unique materials and globals.

Workflow

  1. Install and lint. gd_shaders.install(project) copies the templates into res://shaders/ and the tools into addons/agentkit/shaders/. Then gd_shaders.lint(path, renderers, project=P). GATE: no error findings; every warn fixed or justified.
  2. Compile per renderer. gd_shaders.compile_matrix(P, root="res://shaders/"). GATE: ok with an empty failed list for every target renderer.
  3. Draw once per renderer. gd_shaders.draw_check(P, files) puts each shader on a drawn mesh, canvas item, sky, particle system or fog volume. GATE: zero shader_errors and engine_errors in each run.
  4. Build the test scene in code. Write a job that saves a .tscn with the camera, the light and the Environment set explicitly: AgX, Glow on or off as the brief says. Water needs ground crossing the water level and objects above and below it. A dissolve needs at least three meshes with different sizes and rotations. GATE: the scene loads headless with ok, and the project.godot renderer and Jolt settings were checked.
  5. Sweep and look. Run gd_shaders.param_sweep(P, scene, shots=...) with kinds shader, instance, global or prop. Open the contact sheet. GATE: changes behave as expected (a monotonic dissolve, a moving phase), and the sheet shows the intended look in every shot.
  6. Compare renderers. gd_shaders.renderer_captures(P, scene). GATE: the look holds under each target renderer; known differences are written down (Compatibility renders brighter and more saturated with the same Environment).
  7. Cost. gd_shaders.cost_compare(P, {"standard": ..., "hq": ..., "lite": ...}) on Vulkan at 1080p. GATE: the delta against the baseline is within budget; mobile numbers are marked "desktop proxy".
  8. Ship. Add a macOS or target preset with shader_baker/enabled=true. Export once from a windowed process (see procedures.md P14). GATE: the log shows "Baking shaders (N steps)" and the pack grows. A missing global uniform shows up here as an error.

Side paths:

  • VisualShader for a human artist (P9): build the graph in code with an Expression node and save it as .tres. Read it back with shader_tools.gd:visual_shader, which returns the generated code, the node counts and the uniforms. Then sweep it like a text shader. GATE: the generated code contains every expected output assignment.
  • Compute (P12, P13): run compute_probe windowed for the CPU parity check. Use the Texture2DRD job for on-screen output. GATE: zero mismatches, no leaked RIDs, and frames that change.
  • Globals (P11): register the global with register_global (it writes the editor's multi-line format). Set live values with RenderingServer.global_shader_parameter_set and keep a copy in an autoload: the getter stalls the render thread (docs). ProjectSettings.set_setting at runtime does not register a global.
  • Animating parameters: a Tween or an AnimationPlayer track on instance_shader_parameters/dissolve_amount drives an instance uniform; shader_parameter/<name> drives a material uniform (P8).

Expert checklist (state these in the plan)

  • Complete code in the deliverable. Paste the full templates (dissolve.gdshader, water_stylized.gdshader plus its include) and setup script: readers may lack the kit.
  • source_color on every color uniform and color sampler, never on normal, roughness or mask data (lint rule source_color).
  • Uniform budget 16,384 B on mobile, vec3 padded to 16 B; big arrays go in a texture (lint rule uniform_budget).
  • TIME wraps at 3,600 s and keeps running while paused (docs): drive pausable motion from global uniform float game_time, written by the game_time.gd autoload (P18).
  • Dissolve bounds. World space breaks when the mesh moves or scales; StayAtHomeDev feeds AABB min and max from an @tool script (pIwQ 09:59 to 12:52). The template uses object space plus an instance uniform vec2 bounds per mesh, which survives movement, scale and sharing.
  • Swap in for the effect. dissolve_swap.gd:swap_in(mi, mat) puts one duplicate per surface (keeping each surface's albedo color and texture) and returns the originals for restore (P18).
  • Sorting. depth_prepass_alpha with cull_disabled fixes transparent sorting artifacts and keeps shadows (pIwQ 00:01:00).
  • LIGHT_VERTEX (4.3) moves the lit position, for example snapped to a grid for stepped pixel-art light, without touching VERTEX (Dylearn 00:01:25); it draws on all three renderers (P18).
  • Outlines. BaseMaterial3D stencil_mode outline on dense meshes; an inverted-hull next pass elsewhere (Daniel Ilett 15:18).

Numbers

ValueNumberRelative to
Headless compile, 3 renderers, 11 shaders1.3 sM5 Max, run 2026-10-02
First windowed draw (pipeline build)Metal 7.5 s, Mobile 5.3 s, Compat 1.6 scold cache, same probe set
Water GPU p50 at 1080pstandard 2.9 to 3.2 ms, HQ 3.4 to 3.5, LITE 3.0 to 3.1Vulkan, 3 runs, whole frame
HQ water (refraction) over baseline+0.35 to 0.5 mssame scene, StandardMaterial3D water
Uniform buffer65,536 B desktop, 16,384 B mobile; vec3 pads to 16 Bofficial docs
Instance uniforms per shader16, no samplers or arraysdocs, sampler rejected by the compiler
Water noiseproduct of 2 pans, pow 1.25Bramwell
Dissolve edgewidth 0.06, emission x6, Glow ontemplate defaults [added]
Compute, 1M floats, submit + syncMetal 1.2 ms, Vulkan 1.9 to 2.4 mslocal RD, windowed
Shader baker, this project709 steps, pack 4.9 MB to 18.3 MB, 19 s first bake, 4 to 12 s laterwindowed export, Metal limited to SPIR-V without Xcode tools
TIMEwraps at 3,600 s, ignores pausedocs
Shader-driven lockstepdiverged by one pixel after about 60,000 frames across GPU vendorsLeszek Nowak [00:23:39]

Quality gates

  • Measurable: lint has no errors; compile_matrix and draw_check show zero shader errors per target renderer; sweep changes match the intent (0 at the first shot, monotonic for a dissolve, above 0.005 for a moving phase); pixel probes hit the expected colors; cost_compare within budget; compute mismatches == 0 with no leaks; the baker log shows its step count.
  • Visual (open the sheet):
    • water: a depth ramp, a foam ring at every shore, ripples that move, no tile scroll, and submerged objects tinted while dry rocks are not;
    • dissolve: the edge follows the noise, glows, and cuts the shadow too; no leftover at amount 1; each mesh dissolves independently;
    • post effect: it covers the whole screen when the camera turns;
    • stencil: the outline is continuous on smooth meshes;
    • sky: the bands and the sun disc are where LIGHT0_DIRECTION puts them.

Common mistakes

MistakeWhat it looks likeFix
Godot 3 names (SCREEN_TEXTURE, hint_color, WORLD_MATRIX)compile error; the message names the uniform to usehinted uniforms and MODEL_MATRIX; lint rule godot3
Full-screen quad with POSITION = vec4(VERTEX, 1.0)Forward+ and Mobile: the effect shows only over the sky; Compatibility hides the bugvec4(VERTEX.xy, 1.0, 1.0), flip_faces quad, extra_cull_margin 16384
texture(TEXTURE, UV) * COLOR in canvas_itemsprite darker (channel 54 becomes 11)COLOR already holds texture times modulate
Global uniform not in [shader_globals]compiles at runtime with no error and reads another global's value; the baker and editor report itgd_shaders.register_global before saving the shader
#include of a .gdshader"Unknown character #35"include .gdshaderinc only
Stencil read in an opaque material"reads stencil but is not in the alpha queue" at draw time; nothing maskswrite ALPHA (or disable depth draw or depth test), raise render_priority
Stencil outline on a boxbroken outline at the corners (split normals)dense smooth meshes, or an inverted hull
Shared dissolve material with one boundssmall meshes vanish at once, big ones never finishinstance uniform vec2 bounds per mesh
textureLod on the screen texture without a mipmap filterblur stays sharpfilter_linear_mipmap
hint_normal_roughness_texture on Mobile or Compatibilitycompile error under that rendererForward+ only, or a #if CURRENT_RENDERER branch
Shader baker enabled, --headless exportsame pack size, no log lineexport from a windowed process
Tween on shader_parameter/x left at its default"Type mismatch ... Nil and float"; the tween never finishesset_shader_parameter once before tweening (unset values read null)
Measuring motion from capture frame countswater looks frozen between framessweep wave_speed as a phase offset
TIME for gameplay-synced motionkeeps scrolling in the pause menugame_time global from an autoload (P18)

Handoffs

  • Receives: renderer, Environment and Compositor needs (scenario-godot-rendering-lighting); particle and card shaders (scenario-godot-vfx); sprite effects (scenario-godot-2d); tileable maps (scenario-textures).
  • Delivers: .gdshader, .gdshaderinc and VisualShader .tres files, ShaderMaterial setup code, instance and global uniform names with ranges, the sweep sheet and the cost table.
  • Hands off to: scenario-godot-performance-export (stutter, baker in CI, device timing); scenario-godot-animation (tracks on instance_shader_parameters/<name>); scenario-godot-rendering-lighting (full-screen effects for a CompositorEffect).

Godot 4.7 notes

  • Reversed-z since 4.3 (Forward+ and Mobile); Compatibility keeps OpenGL depth. Use #if CURRENT_RENDERER == RENDERER_COMPATIBILITY (4.4+) for the NDC formula.
  • Stencil (4.5, still experimental): shader stencil_mode, and the BaseMaterial3D stencil_mode presets (outline, X-ray), which create their own next_pass. These run in Forward+ and Compatibility on 4.7.2.
  • Shader baker (4.5): an export option; ubershaders (4.4) reduce the remaining stutter.
  • Texture2DRD (4.2) and texture_get_data_async (4.4) are current.
  • Changes in 4.8 or later: not covered; recheck the stencil syntax, which is marked experimental.

References

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Scenario Godot Shaders AI 技能有什么作用?

当您要编写或修复 Godot 4.7 着色器时:.gdshader 代码(spatial、canvas_item、particles、sky、fog)、用代码构建的 VisualShader 图表、风格化或卡通水面、溶解或燃烧效果、受击闪光、描边、使用模板缓冲区的 X 射线或传送门、深度或屏幕纹理后期处理、全局或实例级 uniform、计算着色器和 Texture2DRD、着色器烘焙器;也适用于“着色器编译成功但效果不对”“后期效果导致黑屏”“我的 Godot 3 着色器坏了”“颜色看起来褪色”“首次启动时着色器卡顿”等问题。

为什么在 TypingMind 中使用 Scenario Godot Shaders?

因为您只需安装一次,就能搭配任何模型使用。Scenario Godot Shaders 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Scenario Godot Shaders?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/scenario-labs/skills/tree/main/skills/game-engines/godot/scenario-godot-shaders。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Scenario Godot Shaders?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Scenario Godot Shaders 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Scenario Godot Shaders 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Scenario Godot Shaders AI 技能免费吗?

是的。scenario-labs 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇