Skip to content

LeoYeAI/agent-master-skills / skills/animation-shader

animation-shader

Verified

READ this skill when implementing or configuring animation-style shaders (Toon/Cel Shaders) — including outlines, rim lighting, toon shading, MatCap, emission, dissolve, hatching, or any stylized rendering effect. Contains preset styles and feature-to-reference mappings for lilToon, Poiyomi, UTS2, RToon, SToon, and ToonShadingCollection. Works as a domain knowledge plugin alongside workflow skills (OpenSpec, SpecKit) or plan mode of an agent.

FileKindSize
SKILL.mdskill md17.0 KB
_meta.jsonconfig285 B
references/PoiyomiShaders/Details/01_Base_Main.mdmarkdown4.8 KB
references/PoiyomiShaders/Details/02_Lighting_Shadows.mdmarkdown4.9 KB
references/PoiyomiShaders/Details/03_Surface_Reflections.mdmarkdown3.9 KB
references/PoiyomiShaders/Details/04_Special_Effects.mdmarkdown3.4 KB
references/PoiyomiShaders/Details/05_Outline.mdmarkdown2.6 KB
references/PoiyomiShaders/Features.mdmarkdown2.1 KB
references/RToon/Details/01_Core_Shading.mdmarkdown5.3 KB
references/RToon/Details/02_ShadowT.mdmarkdown3.1 KB
references/RToon/Details/03_Outline.mdmarkdown4.6 KB
references/RToon/Details/04_MatCap_Reflection.mdmarkdown3.6 KB
references/RToon/Details/05_Gloss_Rim.mdmarkdown3.2 KB
references/RToon/Details/06_Advanced_Features.mdmarkdown3.3 KB
references/RToon/Features.mdmarkdown4.2 KB
references/SToon/Details/01_Core_Shading.mdmarkdown3.4 KB
references/SToon/Details/02_Outline.mdmarkdown2.9 KB
references/SToon/Details/03_Overlays.mdmarkdown3.1 KB
references/SToon/Details/04_Specular_Rim.mdmarkdown2.7 KB
references/SToon/Details/05_Artistic_Controls.mdmarkdown3.2 KB
references/SToon/Features.mdmarkdown2.6 KB
references/ToonShadingCollection/Details/01_ArtStyles.mdmarkdown2.5 KB
references/ToonShadingCollection/Details/02_Outline.mdmarkdown4.4 KB
references/ToonShadingCollection/Details/03_Diffuse.mdmarkdown4.5 KB
references/ToonShadingCollection/Details/04_Specular.mdmarkdown3.2 KB
references/ToonShadingCollection/Details/05_Environment.mdmarkdown3.1 KB
references/ToonShadingCollection/Details/06_PBR_Stylization.mdmarkdown4.6 KB
references/ToonShadingCollection/Details/07_Stylized_Features.mdmarkdown4.0 KB
references/ToonShadingCollection/Details/08_PostProcessing.mdmarkdown3.5 KB
references/ToonShadingCollection/Details/09_Lighting_Shadows.mdmarkdown3.1 KB
references/ToonShadingCollection/Details/10_Animation_VFX.mdmarkdown3.7 KB
references/ToonShadingCollection/Details/11_Modeling_Pipeline.mdmarkdown2.9 KB
references/ToonShadingCollection/Features.mdmarkdown2.1 KB
references/UnityChanToonShaderVer2/Details/01_DoubleShade.mdmarkdown3.6 KB
references/UnityChanToonShaderVer2/Details/02_ShadingGradeMap.mdmarkdown3.1 KB
references/UnityChanToonShaderVer2/Details/03_Outline.mdmarkdown2.7 KB
references/UnityChanToonShaderVer2/Details/04_SpecialFeatures.mdmarkdown3.6 KB
references/UnityChanToonShaderVer2/Features.mdmarkdown5.6 KB
references/lilToon/Details/01_Base_Main.mdmarkdown4.8 KB
references/lilToon/Details/02_Lighting_Shadows.mdmarkdown3.9 KB
references/lilToon/Details/03_Surface_Reflections.mdmarkdown4.2 KB
references/lilToon/Details/04_Special_Effects.mdmarkdown4.7 KB
references/lilToon/Details/05_Advanced.mdmarkdown3.9 KB
references/lilToon/Details/06_Variants.mdmarkdown3.4 KB
references/lilToon/Details/07_Variant_Features.mdmarkdown4.8 KB
references/lilToon/Details/08_Outline.mdmarkdown3.3 KB
references/lilToon/Features.mdmarkdown3.3 KB
workflow-standalone.mdmarkdown6.4 KB

references/RToon/Details/05_Gloss_Rim.md

View on GitHub
# Gloss & Rim Light (高光与边缘光)

## 1. Gloss (高光/Specular)

RToon 提供了传统的高光计算和基于纹理的艺术化高光。

### Properties (参数)
*   `_GlossIntensity` ("Intensity"): 整体强度。
*   `_Glossiness` ("Glossiness"): 高光范围/聚焦度(类似 Smoothness)。
*   `_GlossSoftness` ("Softness"): 高光边缘的柔和度(0=硬边)。
*   `_GlossColor`: 高光颜色。
*   `_MaskGloss`: 高光遮罩。

### Texture Based Gloss (纹理高光)
当开启 `_GlossTexture` 时,高光不再只是光斑,而是一个纹理图案。
*   `_GlossTextureSoftness`: 纹理采样的 LOD 偏移(模糊)。
*   **三种模式**:
    1.  **Follow Light (`_GlossTextureFollowLight`)**:
        *   纹理基于 `HalfDirection` (半角向量) 采样。
        *   效果:高光纹理会随着光照移动,类似传统高光,但形状是自定义的(如窗户倒影、特殊的星星形状)。
    2.  **Follow Object (`_GlossTextureFollowObjectRotation`)**:
        *   纹理基于 `mul(unity_WorldToObject, reflectDir)`。
        *   效果:高光像是“画”在物体表面的,随物体旋转,类似 MatCap 但只在高光区出现。
    3.  **Rotate (`_GlossTextureRotate`)**:
        *   纹理自身旋转。适合做魔法效果或流动的光泽。

### Implementation (RT_GLO)
```glsl
// 传统高光 (Blinn-Phong 变体)
half RTD_NDOTH = saturate(dot(halfDirection, normalDirection));
// 使用 smoothstep 切割高光边缘,实现卡通硬高光
half RTD_GLO_MAIN = smoothstep(0.1, RTD_GLO_MAIN_Sof_Sli, pow(RTD_NDOTH, exp2(lerp(-2.0, 15.0, _Glossiness))));

// 纹理高光逻辑
half3 RTD_GT_FL_Sli;
if (!_GlossTextureFollowLight) {
    RTD_GT_FL_Sli = viewDirection; // ? 这里的逻辑似乎是 ViewReflect
} else {
    RTD_GT_FL_Sli = halfDirection;
}
half3 RefGlo = reflect(RTD_GT_FL_Sli, normalDirection);
// ... 采样贴图 ...
```

---

## 2. Rim Light (边缘光)

### Properties (参数)
*   `_RimLigInt` ("Intensity"): 强度。
*   `_RimLightUnfill` ("Unfill"): **[特色]** 控制 Rim Light 向内填充的程度(Fresnel 指数的倒数或类似)。值越大,边缘光越窄。
*   `_RimLightSoftness` ("Softness"): 边缘光的羽化程度。
*   `_RimLightInLight` ("In Light"): 是否允许边缘光出现在受光面。
    *   **Off**: 仅在暗部出现(常用做法,模拟逆光)。
    *   **On**: 亮部暗部都有(类似光环)。
*   `_LightAffectRimLightColor`: 是否受主光颜色影响。

### Implementation (RT_RL)
```glsl
half RT_RL(..., out half RTD_RL_MAIN)
{
    // 计算 Fresnel: 1 - dot(N, V)
    // pow(abs(...), (1.0 - _RimLightUnfill)) : 控制宽窄
    // smoothstep(..., softness, ...) : 控制硬边
    RTD_RL_MAIN = lerp(0.0, 1.0, smoothstep(1.71, RTD_RL_S_Sli, pow(abs(1.0 - max(0, dot(normalDirection, viewDirection))), (1.0 - _RimLightUnfill))));
    
    return RTD_RL_MAIN;
}
```

### Analysis (分析)
*   **硬边边缘光**: 通过 `smoothstep` 处理 Fresnel 结果,RToon 可以产生非常锐利的边缘光,符合赛璐璐风格。
*   **Unfill 参数**: 这个命名比较独特,实际上调节的是 Fresnel 曲线的指数,决定了边缘光是仅仅只有一条细线,还是覆盖到了模型表面。
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall