[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F9FPAXM12HM80MDBXF28R2":3,"skill-same:01M7F9FPAXM12HM80MDBXF28R2":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M7F9FPAXM12HM80MDBXF28R2","gamedev-shaders",null,"Use when authoring or debugging a shader, material, VFX, or full-screen post-process in a game engine — Godot 4.x `.gdshader`, Unity 6 URP\u002FHDRP, Unreal 5.x Materials, effect recipes, shader performance. NOT gameplay or engine-API code (that is `godot`\u002F`unity`\u002F`unreal`), NOT physics (`gamedev-physics`), NOT build variant stripping (`gamedev-shipping`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: gamedev-shaders\ndescription: \"Use when authoring or debugging a shader, material, VFX, or full-screen post-process in a game engine — Godot 4.x `.gdshader`, Unity 6 URP\u002FHDRP, Unreal 5.x Materials, effect recipes, shader performance. NOT gameplay or engine-API code (that is `godot`\u002F`unity`\u002F`unreal`), NOT physics (`gamedev-physics`), NOT build variant stripping (`gamedev-shipping`).\"\ntags: [shaders, vfx, materials, post-processing, shadergraph]\nrecommends: [godot, unity, unreal, gamedev-shipping]\nprofiles: [full]\norigin: risco\n---\n\n# Shaders & VFX (game engines)\n\nAuthor shaders, materials, and full-screen effects across Godot, Unity, and Unreal. One\nmental model — the GPU pipeline — mapped onto each engine's authoring surface, plus recipes\nfor the effects people actually ask for.\n\n## Version contract — read first\n\nTarget the current stable line of each engine and never emit its retired APIs. If unsure a\nsymbol is current, say so rather than guess.\n\n| Engine | Target | Never emit → use instead |\n| --- | --- | --- |\n| **Godot** | 4.x (4.4\u002F4.5 stable) | `SCREEN_TEXTURE`\u002F`DEPTH_TEXTURE`\u002F`NORMAL_TEXTURE` built-ins → declare a `uniform sampler2D … : hint_screen_texture` \u002F `hint_depth_texture` \u002F `hint_normal_roughness_texture`. `hint_color`\u002F`hint_albedo` → `source_color`. `hint_white`\u002F`hint_black` → `hint_default_white`\u002F`hint_default_black`. GLES2-era guides. |\n| **Unity** | 6 (6000.x LTS), URP\u002FHDRP | Surface shaders (`#pragma surface`) — Built-in-RP only, they do **not** compile under URP\u002FHDRP. `CGPROGRAM`+`UnityCG.cginc`, `UnityObjectToClipPos`, `mul(UNITY_MATRIX_MVP, v)` → `HLSLPROGRAM` + URP `Core.hlsl` and `TransformObjectToHClip(posOS)`. `OnRenderImage`\u002F`Graphics.Blit` post FX → URP Renderer Feature \u002F Fullscreen Shader Graph. |\n| **Unreal** | 5.x (5.4+) | `SceneTexture:PostProcessInput0` outside a Post Process material; Opacity without a translucent blend mode; Opacity Mask without a Masked blend mode. Prefer graph nodes; drop to a Custom HLSL node only for logic nodes can't express. |\n\n`shader_type` tokens in Godot 4 are exact: `spatial`, `canvas_item` (underscore), `particles`\n(plural), `sky`, `fog`.\n\n## Shader fundamentals (the pipeline)\n\nEvery engine compiles your material into the same GPU stages. Two you write:\n\n- **Vertex stage** — runs **once per vertex**. Transforms position into clip space and passes\n  interpolated data (UVs, normals, custom `varying`s) down. Cheap; scales with mesh vertex count.\n- **Rasterizer** (fixed) turns triangles into fragments and *interpolates* the vertex outputs.\n- **Fragment \u002F pixel stage** — runs **once per covered pixel** (× overdraw). Samples textures,\n  does lighting, writes the final color. Expensive; scales with screen coverage.\n\n**Per-vertex vs per-pixel is the core performance lever:** compute anything that interpolates\nlinearly (position offsets, un-normalized directions, scalar masks) in the vertex stage and pass\nit as a `varying`; keep only what must be exact per-pixel (normalizing interpolated normals,\ntexture sampling, lighting, fresnel) in the fragment stage.\n\n**UVs** are per-vertex 2D texture coordinates (0–1), interpolated across the face — you sample\ntextures and drive scrolling\u002Ftiling\u002Fmasks with them. **Normals** are surface directions used for\nlighting and rim; interpolated normals must be re-normalized per pixel. **Normal maps** store\ndirections in **tangent space** (unpack with `×2−1`); respect handedness.\n\n**Coordinate spaces** — know which space each value is in before you do math on it:\n\n| Space | Meaning | Typical use |\n| --- | --- | --- |\n| Object \u002F model | mesh-local, origin at the pivot | authoring positions\u002Fnormals start here |\n| World | scene-global | world-space effects, triplanar, lighting |\n| View \u002F camera | relative to the camera | Godot spatial `NORMAL`\u002F`VIEW` live here |\n| Clip \u002F NDC | post-projection homogeneous coords | the vertex stage's required output |\n| Tangent | per-fragment surface basis (T,B,N) | normal maps are decoded here |\n| Screen \u002F UV | 0–1 across the framebuffer | post-process sampling (`SCREEN_UV`) |\n\n## Per-engine authoring\n\n### Godot 4.x\n\nGodot ships its own GLSL-like language (`.gdshader`). Pick a `shader_type`, declare `uniform`s\n(exposed as material parameters), pass data with `varying`, write `vertex()`\u002F`fragment()`\n(+`light()`). A **ShaderMaterial** binds the shader to a node and holds uniform values; set them\nfrom code with `material.set_shader_parameter(\"name\", value)`. Uniform hints: `source_color`\n(sRGB→linear color pickers), `hint_range(a,b)`, `hint_default_white`, `hint_screen_texture`,\nplus texture filters\u002Frepeats (`filter_linear_mipmap`, `repeat_enable`).\n\nSmall **canvas_item** (2D) shader — scroll and tint a texture:\n\n```glsl\nshader_type canvas_item;\nuniform sampler2D noise : repeat_enable;\nuniform vec4 tint : source_color = vec4(1.0);\nuniform float speed = 0.1;\n\nvoid fragment() {\n    vec2 uv = UV + vec2(TIME * speed, 0.0);   \u002F\u002F UV is the node's texcoord\n    COLOR = texture(noise, uv) * tint * COLOR; \u002F\u002F in COLOR = vertex\u002Fmodulate color\n}\n```\n\nSmall **spatial** (3D) shader — a fresnel rim glow (`NORMAL` and `VIEW` are **view-space** here):\n\n```glsl\nshader_type spatial;\nrender_mode blend_add, cull_back;\nuniform vec3 rim_color : source_color = vec3(0.2, 0.6, 1.0);\nuniform float power : hint_range(0.0, 8.0) = 3.0;\n\nvarying vec3 v_normal;\nvoid vertex()   { v_normal = NORMAL; }        \u002F\u002F pass to fragment via varying\nvoid fragment() {\n    float f = pow(1.0 - dot(normalize(v_normal), normalize(VIEW)), power);\n    EMISSION = rim_color * f;\n    ALPHA = f;\n}\n```\n\nDeep dive (built-in variables per type, render_modes, particles\u002Fsky\u002Ffog, screen\u002Fdepth reads) →\n`references\u002Fgodot-shading-language.md`.\n\n### Unity 6\n\nTwo authoring paths, both on the Scriptable Render Pipeline (**URP** for most projects, **HDRP**\nfor high-end):\n\n- **Shader Graph** — visual node graph feeding a *master stack* (Vertex + Fragment blocks).\n  Artist-friendly, URP\u002FHDRP only, compiles to HLSL. Default choice for surface looks and VFX.\n- **Hand-written HLSL** — a `Shader \"…\" { … }` (ShaderLab) wrapping `Properties` and `Pass`\n  blocks; the program goes in an `HLSLPROGRAM … ENDHLSL` block that `#include`s URP's `Core.hlsl`\n  \u002F `Lighting.hlsl`. Use for full control, custom lighting, or compute-driven effects.\n\nSurface shaders are not an option under URP\u002FHDRP (see the Version contract) — a lit look is an\nHLSL pass or a Shader Graph. Set parameters at runtime through a `MaterialPropertyBlock` or\n`Material.SetFloat\u002FSetColor\u002FSetTexture`. Full URP unlit + lit HLSL pass and a Shader Graph\nmapping → `references\u002Funity-and-unreal-shaders.md`.\n\n### Unreal 5.x\n\nA **Material** is a node graph the engine compiles to HLSL. You wire outputs on the main result\nnode — Base Color, Metallic, Roughness, Emissive Color, Normal, Opacity \u002F Opacity Mask, World\nPosition Offset. Key knobs on the material:\n\n- **Material Domain** — what the material drives: *Surface* (default meshes), *Deferred Decal*,\n  *Light Function*, *Volume*, *Post Process* (full-screen), *User Interface*.\n- **Blend Mode** (Opaque\u002FMasked\u002FTranslucent\u002FAdditive…) and **Shading Model** (Default Lit,\n  Unlit, Subsurface, …). Opacity needs Translucent; Opacity Mask needs Masked.\n- **Material Instances** expose parameters (scalar\u002Fvector\u002Ftexture\u002Fswitch) for cheap variants and\n  runtime tweaks via a Dynamic Material Instance (`SetScalarParameterValue`, …).\n- **Custom node** — a raw HLSL escape hatch: set Output Type, add named Inputs, `return …;`.\n  Reach for it only when the node set can't express the logic (loops, bitops). Reuse via Material\n  Functions. UE5.5+ adds *Substrate* as an opt-in shading system; the standard material is still default.\n\nCustom-node HLSL, domains, and a Godot↔Unreal recipe mapping → `references\u002Funity-and-unreal-shaders.md`.\n\n## Common effect recipes (concepts)\n\nEach is a *technique*, engine-agnostic — the reference has full per-engine code.\n\n| Effect | Core idea |\n| --- | --- |\n| **Dissolve** | Threshold a noise texture against an animated cutoff; `discard`\u002Fclip below it; add an emissive band at the edge. |\n| **Rim \u002F outline** | Rim = fresnel `pow(1 − N·V, p)`. Outline = inverted-hull pass (scale along normals, flip culling) **or** a post-process depth\u002Fnormal edge detect. |\n| **Toon \u002F cel** | Quantize diffuse `N·L` into bands (`step`\u002F`smoothstep` or a ramp texture); hard-stepped specular. |\n| **Water \u002F flow** | Scroll two normal maps at different speeds (or advect a flow-map's RG); refract the screen texture; depth-difference foam at shorelines. |\n| **Force field** | Fresnel + scrolling hex\u002Fpattern texture + intersection glow from a scene-depth difference; additive. |\n| **Hologram** | Scanlines `sin(worldY·f + TIME)` + fresnel + flicker + slight RGB channel offset; additive\u002Ftranslucent. |\n\n**Worked example — dissolve (Godot spatial):**\n\n```glsl\nshader_type spatial;\nrender_mode cull_disabled;\nuniform sampler2D dissolve_noise : hint_default_white;\nuniform float threshold : hint_range(0.0, 1.0) = 0.0;   \u002F\u002F animate 0 → 1\nuniform float edge = 0.05;\nuniform vec3 edge_color : source_color = vec3(1.0, 0.4, 0.0);\n\nvoid fragment() {\n    float n = texture(dissolve_noise, UV).r;\n    if (n \u003C threshold) discard;                      \u002F\u002F cut the hole\n    float e = smoothstep(threshold, threshold + edge, n);\n    EMISSION = edge_color * (1.0 - e);               \u002F\u002F glowing burn ring\n    ALBEDO = vec3(0.6);\n}\n```\n\nDrive `threshold` from an `AnimationPlayer` or `set_shader_parameter`. The same math ports to\nUnity (`clip(n - threshold)`) and Unreal (Opacity Mask + a threshold parameter). All six recipes,\nper engine → `references\u002Feffect-recipes.md`.\n\n## Post-processing \u002F full-screen effects\n\n- **Godot** — a `canvas_item` shader on a full-rect `ColorRect` reading `hint_screen_texture`, or\n  a spatial unshaded full-screen quad reading `hint_screen_texture`\u002F`hint_depth_texture`; or a\n  `CompositorEffect` (4.3+) for a custom render pass. Environment already covers glow\u002Ftonemap\u002FSSAO.\n- **Unity (URP)** — a **Full Screen Pass Renderer Feature** driving a *Fullscreen* Shader Graph\n  (or a Blit pass). HDRP uses Custom Pass \u002F Fullscreen. Legacy `OnRenderImage` is Built-in-RP only.\n- **Unreal** — a **Post Process Material** (Material Domain = Post Process) on a Post Process\n  Volume; read the frame with **SceneTexture** nodes (SceneColor, SceneDepth, custom stencil).\n  Blendable Location orders it against tonemapping.\n\n## Performance\n\n- **Overdraw** is the top cost: transparent\u002Fadditive layers each re-shade the same pixels. Prefer\n  opaque, sort and minimize overlap, keep particle fill low. `discard`\u002F`clip` **disables early-Z**\n  — don't use it as a cheap \"invisible\".\n- **Texture sampling** = a memory fetch + filter each call; *dependent* reads (UV derived from a\n  prior sample) stall the pipeline. Pack masks into channels, atlas, and cache samples in locals.\n- **Branching**: a divergent `if` across a GPU warp can execute *both* sides. Prefer\n  `step`\u002F`mix`\u002F`clamp`; branches on a **uniform** (same value for all pixels) are cheap; static\n  branches compile out.\n- **LOD & precision**: use mipmaps, shader LOD variants, and `mediump`\u002Fhalf precision on mobile;\n  full `float` only where banding shows. Move linear work to the vertex stage.\n- **Mobile \u002F tile GPUs**: bandwidth-bound — keep render targets small, avoid mid-pass framebuffer\n  reads, and note that `discard` and large full-screen passes break tile hidden-surface removal.\n\n## Anti-patterns\n\n| Anti-pattern | Do instead |\n| --- | --- |\n| Porting a tutorial verbatim from Godot 3, Built-in RP, or pre-5.0 UE | Translate it through the Version contract table first — retired symbols still compile in old guides, not in your project. |\n| Reading a texture or writing a color without minding linear vs sRGB | Author color uniforms as `source_color` (Godot) \u002F sRGB-marked properties and check the space at every read and output — the #1 \"looks washed out \u002F too dark\" bug. |\n| Using interpolated normals raw, or a normal map straight from the sample | Re-normalize per pixel; unpack with `×2−1` and mind tangent handedness. |\n| Writing the shader before choosing the target surface | Pick `shader_type` \u002F render pipeline \u002F material domain first (2D vs 3D, URP vs HDRP, Surface vs Post Process) — it decides which built-ins and blend modes exist. |\n| Fresnel, normalization, or lighting math in the vertex stage | Only linearly-interpolating work goes per-vertex; exact math stays per-pixel. |\n| `discard`\u002F`clip` as a cheap \"make it invisible\" | Cull it or scale to zero — `discard` disables early-Z and breaks tile hidden-surface removal on mobile. |\n| Stacking additive\u002Ftranslucent layers until the look works | Count the overdraw: each layer re-shades the same pixels. Prefer opaque, minimize overlap, keep particle fill low. |\n| Full-screen effects via `OnRenderImage`\u002F`Graphics.Blit`, or `SceneTexture` outside the Post Process domain | Use the engine's supported path — URP Renderer Feature \u002F Fullscreen Shader Graph, UE Post Process material, Godot `ColorRect` + `hint_screen_texture` or `CompositorEffect`. |\n\n## Related skills\n\n- [`godot`](..\u002Fgodot\u002FSKILL.md) \u002F [`unity`](..\u002Funity\u002FSKILL.md) \u002F [`unreal`](..\u002Funreal\u002FSKILL.md) — gameplay\n  code, nodes\u002Fcomponents, input, scene wiring; this skill owns the *shading*, not the C#\u002FGDScript\u002FBlueprint around it.\n- [`gamedev-physics`](..\u002Fgamedev-physics\u002FSKILL.md) — simulation, collision, rigid bodies, character\n  controllers (a shader that *fakes* refraction is here; simulating fluid dynamics is not).\n- [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md) — platform export and shader-variant stripping in\n  the build (this skill keeps the per-shader performance work).\n\n## Checklist\n\n- [ ] Correct engine + version idiom (no banned API from the Version contract table).\n- [ ] Right `shader_type` \u002F render pipeline \u002F material domain for the target (2D vs 3D, URP vs HDRP, Surface vs Post Process).\n- [ ] Work placed in the right stage: linear math per-vertex via `varying`, exact math per-pixel.\n- [ ] Colors authored in the correct space (`source_color` \u002F sRGB handling); normals normalized and unpacked.\n- [ ] Uniforms\u002Fparameters exposed and driven from code or an animation track — not hard-coded.\n- [ ] Performance sanity: overdraw, sample count, and branching considered; mobile precision set if targeted.\n- [ ] Post-process uses the engine's supported full-screen path (not a retired Built-in-RP mechanism).\n","# Shaders & VFX (game engines)\n\nAuthor shaders, materials, and full-screen effects across Godot, Unity, and Unreal. One\nmental model — the GPU pipeline — mapped onto each engine's authoring surface, plus recipes\nfor the effects people actually ask for.\n\n## Version contract — read first\n\nTarget the current stable line of each engine and never emit its retired APIs. If unsure a\nsymbol is current, say so rather than guess.\n\n| Engine | Target | Never emit → use instead |\n| --- | --- | --- |\n| **Godot** | 4.x (4.4\u002F4.5 stable) | `SCREEN_TEXTURE`\u002F`DEPTH_TEXTURE`\u002F`NORMAL_TEXTURE` built-ins → declare a `uniform sampler2D … : hint_screen_texture` \u002F `hint_depth_texture` \u002F `hint_normal_roughness_texture`. `hint_color`\u002F`hint_albedo` → `source_color`. `hint_white`\u002F`hint_black` → `hint_default_white`\u002F`hint_default_black`. GLES2-era guides. |\n| **Unity** | 6 (6000.x LTS), URP\u002FHDRP | Surface shaders (`#pragma surface`) — Built-in-RP only, they do **not** compile under URP\u002FHDRP. `CGPROGRAM`+`UnityCG.cginc`, `UnityObjectToClipPos`, `mul(UNITY_MATRIX_MVP, v)` → `HLSLPROGRAM` + URP `Core.hlsl` and `TransformObjectToHClip(posOS)`. `OnRenderImage`\u002F`Graphics.Blit` post FX → URP Renderer Feature \u002F Fullscreen Shader Graph. |\n| **Unreal** | 5.x (5.4+) | `SceneTexture:PostProcessInput0` outside a Post Process material; Opacity without a translucent blend mode; Opacity Mask without a Masked blend mode. Prefer graph nodes; drop to a Custom HLSL node only for logic nodes can't express. |\n\n`shader_type` tokens in Godot 4 are exact: `spatial`, `canvas_item` (underscore), `particles`\n(plural), `sky`, `fog`.\n\n## Shader fundamentals (the pipeline)\n\nEvery engine compiles your material into the same GPU stages. Two you write:\n\n- **Vertex stage** — runs **once per vertex**. Transforms position into clip space and passes\n  interpolated data (UVs, normals, custom `varying`s) down. Cheap; scales with mesh vertex count.\n- **Rasterizer** (fixed) turns triangles into fragments and *interpolates* the vertex outputs.\n- **Fragment \u002F pixel stage** — runs **once per covered pixel** (× overdraw). Samples textures,\n  does lighting, writes the final color. Expensive; scales with screen coverage.\n\n**Per-vertex vs per-pixel is the core performance lever:** compute anything that interpolates\nlinearly (position offsets, un-normalized directions, scalar masks) in the vertex stage and pass\nit as a `varying`; keep only what must be exact per-pixel (normalizing interpolated normals,\ntexture sampling, lighting, fresnel) in the fragment stage.\n\n**UVs** are per-vertex 2D texture coordinates (0–1), interpolated across the face — you sample\ntextures and drive scrolling\u002Ftiling\u002Fmasks with them. **Normals** are surface directions used for\nlighting and rim; interpolated normals must be re-normalized per pixel. **Normal maps** store\ndirections in **tangent space** (unpack with `×2−1`); respect handedness.\n\n**Coordinate spaces** — know which space each value is in before you do math on it:\n\n| Space | Meaning | Typical use |\n| --- | --- | --- |\n| Object \u002F model | mesh-local, origin at the pivot | authoring positions\u002Fnormals start here |\n| World | scene-global | world-space effects, triplanar, lighting |\n| View \u002F camera | relative to the camera | Godot spatial `NORMAL`\u002F`VIEW` live here |\n| Clip \u002F NDC | post-projection homogeneous coords | the vertex stage's required output |\n| Tangent | per-fragment surface basis (T,B,N) | normal maps are decoded here |\n| Screen \u002F UV | 0–1 across the framebuffer | post-process sampling (`SCREEN_UV`) |\n\n## Per-engine authoring\n\n### Godot 4.x\n\nGodot ships its own GLSL-like language (`.gdshader`). Pick a `shader_type`, declare `uniform`s\n(exposed as material parameters), pass data with `varying`, write `vertex()`\u002F`fragment()`\n(+`light()`). A **ShaderMaterial** binds the shader to a node and holds uniform values; set them\nfrom code with `material.set_shader_parameter(\"name\", value)`. Uniform hints: `source_color`\n(sRGB→linear color pickers), `hint_range(a,b)`, `hint_default_white`, `hint_screen_texture`,\nplus texture filters\u002Frepeats (`filter_linear_mipmap`, `repeat_enable`).\n\nSmall **canvas_item** (2D) shader — scroll and tint a texture:\n\n```glsl\nshader_type canvas_item;\nuniform sampler2D noise : repeat_enable;\nuniform vec4 tint : source_color = vec4(1.0);\nuniform float speed = 0.1;\n\nvoid fragment() {\n    vec2 uv = UV + vec2(TIME * speed, 0.0);   \u002F\u002F UV is the node's texcoord\n    COLOR = texture(noise, uv) * tint * COLOR; \u002F\u002F in COLOR = vertex\u002Fmodulate color\n}\n```\n\nSmall **spatial** (3D) shader — a fresnel rim glow (`NORMAL` and `VIEW` are **view-space** here):\n\n```glsl\nshader_type spatial;\nrender_mode blend_add, cull_back;\nuniform vec3 rim_color : source_color = vec3(0.2, 0.6, 1.0);\nuniform float power : hint_range(0.0, 8.0) = 3.0;\n\nvarying vec3 v_normal;\nvoid vertex()   { v_normal = NORMAL; }        \u002F\u002F pass to fragment via varying\nvoid fragment() {\n    float f = pow(1.0 - dot(normalize(v_normal), normalize(VIEW)), power);\n    EMISSION = rim_color * f;\n    ALPHA = f;\n}\n```\n\nDeep dive (built-in variables per type, render_modes, particles\u002Fsky\u002Ffog, screen\u002Fdepth reads) →\n`references\u002Fgodot-shading-language.md`.\n\n### Unity 6\n\nTwo authoring paths, both on the Scriptable Render Pipeline (**URP** for most projects, **HDRP**\nfor high-end):\n\n- **Shader Graph** — visual node graph feeding a *master stack* (Vertex + Fragment blocks).\n  Artist-friendly, URP\u002FHDRP only, compiles to HLSL. Default choice for surface looks and VFX.\n- **Hand-written HLSL** — a `Shader \"…\" { … }` (ShaderLab) wrapping `Properties` and `Pass`\n  blocks; the program goes in an `HLSLPROGRAM … ENDHLSL` block that `#include`s URP's `Core.hlsl`\n  \u002F `Lighting.hlsl`. Use for full control, custom lighting, or compute-driven effects.\n\nSurface shaders are not an option under URP\u002FHDRP (see the Version contract) — a lit look is an\nHLSL pass or a Shader Graph. Set parameters at runtime through a `MaterialPropertyBlock` or\n`Material.SetFloat\u002FSetColor\u002FSetTexture`. Full URP unlit + lit HLSL pass and a Shader Graph\nmapping → `references\u002Funity-and-unreal-shaders.md`.\n\n### Unreal 5.x\n\nA **Material** is a node graph the engine compiles to HLSL. You wire outputs on the main result\nnode — Base Color, Metallic, Roughness, Emissive Color, Normal, Opacity \u002F Opacity Mask, World\nPosition Offset. Key knobs on the material:\n\n- **Material Domain** — what the material drives: *Surface* (default meshes), *Deferred Decal*,\n  *Light Function*, *Volume*, *Post Process* (full-screen), *User Interface*.\n- **Blend Mode** (Opaque\u002FMasked\u002FTranslucent\u002FAdditive…) and **Shading Model** (Default Lit,\n  Unlit, Subsurface, …). Opacity needs Translucent; Opacity Mask needs Masked.\n- **Material Instances** expose parameters (scalar\u002Fvector\u002Ftexture\u002Fswitch) for cheap variants and\n  runtime tweaks via a Dynamic Material Instance (`SetScalarParameterValue`, …).\n- **Custom node** — a raw HLSL escape hatch: set Output Type, add named Inputs, `return …;`.\n  Reach for it only when the node set can't express the logic (loops, bitops). Reuse via Material\n  Functions. UE5.5+ adds *Substrate* as an opt-in shading system; the standard material is still default.\n\nCustom-node HLSL, domains, and a Godot↔Unreal recipe mapping → `references\u002Funity-and-unreal-shaders.md`.\n\n## Common effect recipes (concepts)\n\nEach is a *technique*, engine-agnostic — the reference has full per-engine code.\n\n| Effect | Core idea |\n| --- | --- |\n| **Dissolve** | Threshold a noise texture against an animated cutoff; `discard`\u002Fclip below it; add an emissive band at the edge. |\n| **Rim \u002F outline** | Rim = fresnel `pow(1 − N·V, p)`. Outline = inverted-hull pass (scale along normals, flip culling) **or** a post-process depth\u002Fnormal edge detect. |\n| **Toon \u002F cel** | Quantize diffuse `N·L` into bands (`step`\u002F`smoothstep` or a ramp texture); hard-stepped specular. |\n| **Water \u002F flow** | Scroll two normal maps at different speeds (or advect a flow-map's RG); refract the screen texture; depth-difference foam at shorelines. |\n| **Force field** | Fresnel + scrolling hex\u002Fpattern texture + intersection glow from a scene-depth difference; additive. |\n| **Hologram** | Scanlines `sin(worldY·f + TIME)` + fresnel + flicker + slight RGB channel offset; additive\u002Ftranslucent. |\n\n**Worked example — dissolve (Godot spatial):**\n\n```glsl\nshader_type spatial;\nrender_mode cull_disabled;\nuniform sampler2D dissolve_noise : hint_default_white;\nuniform float threshold : hint_range(0.0, 1.0) = 0.0;   \u002F\u002F animate 0 → 1\nuniform float edge = 0.05;\nuniform vec3 edge_color : source_color = vec3(1.0, 0.4, 0.0);\n\nvoid fragment() {\n    float n = texture(dissolve_noise, UV).r;\n    if (n \u003C threshold) discard;                      \u002F\u002F cut the hole\n    float e = smoothstep(threshold, threshold + edge, n);\n    EMISSION = edge_color * (1.0 - e);               \u002F\u002F glowing burn ring\n    ALBEDO = vec3(0.6);\n}\n```\n\nDrive `threshold` from an `AnimationPlayer` or `set_shader_parameter`. The same math ports to\nUnity (`clip(n - threshold)`) and Unreal (Opacity Mask + a threshold parameter). All six recipes,\nper engine → `references\u002Feffect-recipes.md`.\n\n## Post-processing \u002F full-screen effects\n\n- **Godot** — a `canvas_item` shader on a full-rect `ColorRect` reading `hint_screen_texture`, or\n  a spatial unshaded full-screen quad reading `hint_screen_texture`\u002F`hint_depth_texture`; or a\n  `CompositorEffect` (4.3+) for a custom render pass. Environment already covers glow\u002Ftonemap\u002FSSAO.\n- **Unity (URP)** — a **Full Screen Pass Renderer Feature** driving a *Fullscreen* Shader Graph\n  (or a Blit pass). HDRP uses Custom Pass \u002F Fullscreen. Legacy `OnRenderImage` is Built-in-RP only.\n- **Unreal** — a **Post Process Material** (Material Domain = Post Process) on a Post Process\n  Volume; read the frame with **SceneTexture** nodes (SceneColor, SceneDepth, custom stencil).\n  Blendable Location orders it against tonemapping.\n\n## Performance\n\n- **Overdraw** is the top cost: transparent\u002Fadditive layers each re-shade the same pixels. Prefer\n  opaque, sort and minimize overlap, keep particle fill low. `discard`\u002F`clip` **disables early-Z**\n  — don't use it as a cheap \"invisible\".\n- **Texture sampling** = a memory fetch + filter each call; *dependent* reads (UV derived from a\n  prior sample) stall the pipeline. Pack masks into channels, atlas, and cache samples in locals.\n- **Branching**: a divergent `if` across a GPU warp can execute *both* sides. Prefer\n  `step`\u002F`mix`\u002F`clamp`; branches on a **uniform** (same value for all pixels) are cheap; static\n  branches compile out.\n- **LOD & precision**: use mipmaps, shader LOD variants, and `mediump`\u002Fhalf precision on mobile;\n  full `float` only where banding shows. Move linear work to the vertex stage.\n- **Mobile \u002F tile GPUs**: bandwidth-bound — keep render targets small, avoid mid-pass framebuffer\n  reads, and note that `discard` and large full-screen passes break tile hidden-surface removal.\n\n## Anti-patterns\n\n| Anti-pattern | Do instead |\n| --- | --- |\n| Porting a tutorial verbatim from Godot 3, Built-in RP, or pre-5.0 UE | Translate it through the Version contract table first — retired symbols still compile in old guides, not in your project. |\n| Reading a texture or writing a color without minding linear vs sRGB | Author color uniforms as `source_color` (Godot) \u002F sRGB-marked properties and check the space at every read and output — the #1 \"looks washed out \u002F too dark\" bug. |\n| Using interpolated normals raw, or a normal map straight from the sample | Re-normalize per pixel; unpack with `×2−1` and mind tangent handedness. |\n| Writing the shader before choosing the target surface | Pick `shader_type` \u002F render pipeline \u002F material domain first (2D vs 3D, URP vs HDRP, Surface vs Post Process) — it decides which built-ins and blend modes exist. |\n| Fresnel, normalization, or lighting math in the vertex stage | Only linearly-interpolating work goes per-vertex; exact math stays per-pixel. |\n| `discard`\u002F`clip` as a cheap \"make it invisible\" | Cull it or scale to zero — `discard` disables early-Z and breaks tile hidden-surface removal on mobile. |\n| Stacking additive\u002Ftranslucent layers until the look works | Count the overdraw: each layer re-shades the same pixels. Prefer opaque, minimize overlap, keep particle fill low. |\n| Full-screen effects via `OnRenderImage`\u002F`Graphics.Blit`, or `SceneTexture` outside the Post Process domain | Use the engine's supported path — URP Renderer Feature \u002F Fullscreen Shader Graph, UE Post Process material, Godot `ColorRect` + `hint_screen_texture` or `CompositorEffect`. |\n\n## Related skills\n\n- [`godot`](..\u002Fgodot\u002FSKILL.md) \u002F [`unity`](..\u002Funity\u002FSKILL.md) \u002F [`unreal`](..\u002Funreal\u002FSKILL.md) — gameplay\n  code, nodes\u002Fcomponents, input, scene wiring; this skill owns the *shading*, not the C#\u002FGDScript\u002FBlueprint around it.\n- [`gamedev-physics`](..\u002Fgamedev-physics\u002FSKILL.md) — simulation, collision, rigid bodies, character\n  controllers (a shader that *fakes* refraction is here; simulating fluid dynamics is not).\n- [`gamedev-shipping`](..\u002Fgamedev-shipping\u002FSKILL.md) — platform export and shader-variant stripping in\n  the build (this skill keeps the per-shader performance work).\n\n## Checklist\n\n- [ ] Correct engine + version idiom (no banned API from the Version contract table).\n- [ ] Right `shader_type` \u002F render pipeline \u002F material domain for the target (2D vs 3D, URP vs HDRP, Surface vs Post Process).\n- [ ] Work placed in the right stage: linear math per-vertex via `varying`, exact math per-pixel.\n- [ ] Colors authored in the correct space (`source_color` \u002F sRGB handling); normals normalized and unpacked.\n- [ ] Uniforms\u002Fparameters exposed and driven from code or an animation track — not hard-coded.\n- [ ] Performance sanity: overdraw, sample count, and branching considered; mobile precision set if targeted.\n- [ ] Post-process uses the engine's supported full-screen path (not a retired Built-in-RP mechanism).\n",{"name":5,"tags":24,"origin":30,"profiles":31,"recommends":33,"description":7},[25,26,27,28,29],"shaders","vfx","materials","post-processing","shadergraph","risco",[32],"full",[34,35,36,37],"godot","unity","unreal","gamedev-shipping","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fgamedev-shaders",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill gamedev-shaders",{"tool":52,"command":53},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill gamedev-shaders",{"tool":55,"command":56},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill gamedev-shaders","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002FSKILL.md",true,[60,66,70,74,78],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"evals\u002Fcases.yaml","REFERENCE","参考文档",4104,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002Fevals\u002Fcases.yaml",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"evals\u002FREADME.md",1133,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002Fevals\u002FREADME.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Feffect-recipes.md",8263,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002Freferences\u002Feffect-recipes.md",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fgodot-shading-language.md",5897,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002Freferences\u002Fgodot-shading-language.md",{"path":79,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Funity-and-unreal-shaders.md",7353,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fgamedev-shaders\u002Freferences\u002Funity-and-unreal-shaders.md",[83,90,95,102,109,116],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":91,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]