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/SToon/Details/02_Outline.md

View on GitHub
# Dynamic Outline (动态描边)

SToon 的描边功能通过一个专门的 Pass (`Pass "ExtraPrePass"`) 实现。它不仅支持传统的背面膨胀,还引入了基于柏林噪点(Perlin Noise)的动态抖动,模拟手绘线条的不稳定性。

## 1. Implementation Approach (实现方式)

*   **Technique**: Inverted Hull (背面膨胀)。
*   **Cull**: `Cull Front` (剔除正面,只渲染背面)。
*   **ZWrite**: `On`。
*   **Blend**: `One Zero` (覆盖)。

## 2. Dynamic Noise Logic (动态噪点逻辑)

这是该 Shader 最独特的部分。它在 Vertex Shader 中使用噪点函数偏移顶点位置或法线,使描边线条看起来在“抖动”或“游动”。

### Code Analysis (Vertex Function)
```glsl
VertexOutput VertexFunction( VertexInput v )
{
    // ...
    // 1. 计算时间偏移 UV
    // _OutlineDynamicSpeed 控制噪点滚动的速度
    float2 temp_cast_1 = (( ( _TimeParameters.x ) * _OutlineDynamicSpeed )).xx;
    float2 texCoord591 = v.ase_texcoord.xy * float2( 1,1 ) + temp_cast_1;
    
    // 2. 采样单纯形噪点 (Simplex Noise)
    // snoise 返回 -1 到 1,这里重映射到 0 到 1
    float simplePerlin2D590 = snoise( texCoord591 * _OutlineNoiseScale );
    simplePerlin2D590 = simplePerlin2D590 * 0.5 + 0.5;
    
    // 3. 应用噪点强度
    // staticSwitch606 是应用了噪点后的挤出方向向量
    #ifdef _USEDYNAMICOUTLINE_ON
        // 噪点值 * 强度 * 原始法线/位置
        float3 staticSwitch606 = ( ( simplePerlin2D590 * _OutlineNoiseIntesity ) * staticSwitch57 );
    #else
        float3 staticSwitch606 = staticSwitch57;
    #endif

    // 4. 应用距离自适应和宽度
    // lerpResult59 是基于 Adaptive Thickness 的缩放因子
    float3 staticSwitch365 = ( lerpResult59 * ( staticSwitch606 * _Thicnkess ) );

    // 5. 应用到顶点位置
    v.vertex.xyz += staticSwitch365;
    
    // ...
}
```

### Key Parameters (关键参数)
*   `_OutlineDynamicSpeed`: 控制 UV 滚动的速度。如果为 0,噪点是静止的(像一张固定的皱纸)。如果不为 0,线条会像 boiling lines (沸腾线) 动画一样动起来。
*   `_OutlineNoiseScale`: 噪点的频率。值越高,线条抖动越细碎;值越低,线条波浪越宽。
*   `_OutlineNoiseIntesity`: 抖动的幅度。

## 3. Outline Types (挤出类型)
通过 `_OutlineType` 关键字控制挤出方向 `staticSwitch57`:
1.  **Normal**: 沿法线方向挤出(最常用,适合平滑物体)。
2.  **Position**: 沿顶点位置方向挤出(适合原点在中心的球体状物体)。
3.  **UVBaked**: 使用 `TEXCOORD3` 的 xy 作为挤出方向。这允许美术在建模软件中将平滑法线烘焙到 UV3 中,从而解决硬边模型断裂的问题。

## 4. Fragment Shader
*   描边颜色 `_OutlineColor` 可以叠加纹理 `_MainTex` (通过 `_OutlineTextureStrength` 控制),让描边不仅仅是纯色,可以带有材质原本的纹理细节。
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated 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: 322kUpdated Claude CodeCodexVerifiedInstall