Loading...
Loading...
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 post-processing, global or per-instance uniforms, compute shaders and Texture2DRD, the shader baker; or when 'shader compiles but looks wrong', 'black screen from my post effect', 'my Godot 3 shader breaks', 'colors look washed out', 'first-launch shader stutter'.
npx skill4agent add scenario-labs/skills scenario-godot-shadersnpx skills add scenario-labs/skills --skill <name>gd_run#includeadd_nodeconnect_nodes.tresget_code()get_shader_uniform_list()--rendering-methodDEPTHinstance uniformvertex()fragment()ALPHAALPHA_SCISSOR_THRESHOLDdiscardrender_priorityRenderingServer.call_on_render_thread--headlessshader_baker/enabled=true.tresgd_shaders.install(project)res://shaders/addons/agentkit/shaders/gd_shaders.lint(path, renderers, project=P)errorwarngd_shaders.compile_matrix(P, root="res://shaders/")okfailedgd_shaders.draw_check(P, files)shader_errorsengine_errors.tscnokgd_shaders.param_sweep(P, scene, shots=...)shaderinstanceglobalpropchangesgd_shaders.renderer_captures(P, scene)gd_shaders.cost_compare(P, {"standard": ..., "hq": ..., "lite": ...})shader_baker/enabled=true.tresshader_tools.gd:visual_shadercompute_proberegister_globalRenderingServer.global_shader_parameter_setProjectSettings.set_settinginstance_shader_parameters/dissolve_amountshader_parameter/<name>dissolve.gdshaderwater_stylized.gdshadersource_colorlintsource_colorlintuniform_budgetTIMEglobal uniform float game_timegame_time.gd@toolinstance uniform vec2 boundsdissolve_swap.gd:swap_in(mi, mat)restoredepth_prepass_alphacull_disabledLIGHT_VERTEXVERTEXstencil_mode| Value | Number | Relative to |
|---|---|---|
| Headless compile, 3 renderers, 11 shaders | 1.3 s | M5 Max, run 2026-10-02 |
| First windowed draw (pipeline build) | Metal 7.5 s, Mobile 5.3 s, Compat 1.6 s | cold cache, same probe set |
| Water GPU p50 at 1080p | standard 2.9 to 3.2 ms, HQ 3.4 to 3.5, LITE 3.0 to 3.1 | Vulkan, 3 runs, whole frame |
| HQ water (refraction) over baseline | +0.35 to 0.5 ms | same scene, StandardMaterial3D water |
| Uniform buffer | 65,536 B desktop, 16,384 B mobile; vec3 pads to 16 B | official docs |
| Instance uniforms per shader | 16, no samplers or arrays | docs, sampler rejected by the compiler |
| Water noise | product of 2 pans, pow 1.25 | Bramwell |
| Dissolve edge | width 0.06, emission x6, Glow on | template defaults [added] |
| Compute, 1M floats, submit + sync | Metal 1.2 ms, Vulkan 1.9 to 2.4 ms | local RD, windowed |
| Shader baker, this project | 709 steps, pack 4.9 MB to 18.3 MB, 19 s first bake, 4 to 12 s later | windowed export, Metal limited to SPIR-V without Xcode tools |
| wraps at 3,600 s, ignores pause | docs |
| Shader-driven lockstep | diverged by one pixel after about 60,000 frames across GPU vendors | Leszek Nowak [00:23:39] |
lintcompile_matrixdraw_checkchangescost_comparemismatches == 0leaksLIGHT0_DIRECTION| Mistake | What it looks like | Fix |
|---|---|---|
Godot 3 names ( | compile error; the message names the uniform to use | hinted uniforms and |
Full-screen quad with | Forward+ and Mobile: the effect shows only over the sky; Compatibility hides the bug | |
| sprite darker (channel 54 becomes 11) | |
Global uniform not in | compiles at runtime with no error and reads another global's value; the baker and editor report it | |
| "Unknown character #35" | include |
| Stencil read in an opaque material | "reads stencil but is not in the alpha queue" at draw time; nothing masks | write |
| Stencil outline on a box | broken outline at the corners (split normals) | dense smooth meshes, or an inverted hull |
Shared dissolve material with one | small meshes vanish at once, big ones never finish | |
| blur stays sharp | |
| compile error under that renderer | Forward+ only, or a |
Shader baker enabled, | same pack size, no log line | export from a windowed process |
Tween on | "Type mismatch ... Nil and float"; the tween never finishes | |
| Measuring motion from capture frame counts | water looks frozen between frames | sweep |
| keeps scrolling in the pause menu | |
.gdshader.gdshaderinc.tresinstance_shader_parameters/<name>#if CURRENT_RENDERER == RENDERER_COMPATIBILITYstencil_modestencil_modenext_passtexture_get_data_asyncreferences/expert-notes.mdprocedures.mdcritique.mdgui-paths.mdsources.mdscripts/gd_shaders.pyscripts/agentkit/shaders/shader_tools.gddissolve_swap.gdgame_time.gd