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/03_Overlays.md

View on GitHub
# Overlay Features (覆盖特性)

SToon 提供了强大的屏幕空间/UV 空间纹理覆盖功能,主要分为 Halftone (网点) 和 Hatching (排线)。

## 1. Halftone (网点)

网点通常用于模拟漫画印刷效果。

### Logic
*   **UV Calculation**:
    *   **Screen Space**: 默认使用屏幕空间 UV ( `ase_grabScreenPosNorm` )。
    *   **Tiling Correct**: 修正屏幕长宽比,保证网点是圆的而不是拉伸的椭圆。
        ```glsl
        float2 appendResult1849 = (float2(( _OverlayUVTilling * ( _ScreenParams.x / _ScreenParams.y ) ) , _OverlayUVTilling));
        ```
    *   **Rotation**: 支持 UV 旋转。
*   **Application**:
    *   使用 `smoothstep` 根据光照强度和 `_HalftoneThreshold` 来决定网点的显示。
    *   `_HalftoneSmoothness` 控制网点边缘的抗锯齿程度。
    *   **Toon Affect**: `_HalftoneToonAffect` 参数控制网点颜色是使用 `_HalftoneColor` 还是混合主光源颜色。

## 2. Hatching (排线)

排线功能使用了两张贴图 (`_Hatch1`, `_Hatch2`) 来模拟素描的明暗层次。

### Constant Scale Hatching (恒定大小排线)

这是一个非常高级的特性。通常纹理贴在物体上,物体离远了纹理就会变小变密。但在手绘风格中,笔触的大小通常是相对于屏幕固定的(就像你在屏幕上画画一样),无论物体多远,线条粗细应该一致。

Shader 中实现了一个 `HatchingConstantScale491` 函数来解决这个问题:

```glsl
float3 HatchingConstantScale491( float2 _uv, ..., float _dist, float _MaxScaleDependingOnCamera )
{
    // 1. 计算距离的对数 (Log Distance)
    float log2_dist = log2(_dist) - 0.2;
    
    // 2. 计算两个相邻的 Mipmap 级别 (Floored Log)
    // 类似于手动实现 Texture Mipmapping 选择
    float2 floored_log_dist = floor( (log2_dist + float2(0.0, 1.0) ) * 0.5) * 2.0 - float2(0.0, 1.0);
    
    // 3. 计算 UV 缩放因子
    // 随着距离变远 (dist 变大),uv_scale 变大,使得采样的纹理范围变大,
    // 从而抵消透视带来的缩小效应。
    float2 uv_scale = min(_MaxScaleDependingOnCamera, pow(2.0, floored_log_dist));
    
    // 4. 计算两个级别的混合权重
    float uv_blend = abs(frac(log2_dist * 0.5) * 2.0 - 1.0);
    
    // 5. 两次采样并混合
    // 采样级别 A
    float2 scaledUVA = _uv / uv_scale.x; 
    float3 hatch0A = tex2D(_Hatch0, scaledUVA).rgb;
    // ...
    // 采样级别 B
    float2 scaledUVB = _uv / uv_scale.y;
    float3 hatch0B = tex2D(_Hatch0, scaledUVB).rgb;
    // ...
    
    // 混合结果
    float3 hatch0 = lerp(hatch0A, hatch0B, uv_blend);
    // ...
}
```

*   **原理**: 它实际上是手动实现了一种类似于 Triplanar 或 Texture Streaming 的逻辑,根据摄像机距离动态调整 UV Tiling。
*   **效果**: 无论物体离摄像机多远,排线的密度和笔触大小在屏幕上看起来基本保持一致,非常符合 2D 手绘的视觉习惯。

## 3. Paper Texture (纸张纹理)

在最终输出前,Shader 还会叠加一层纸张纹理。
*   这层纹理通常也是屏幕空间的。
*   它让画面看起来像是画在粗糙的纸上,而不是光滑的显示器上。
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 CodeCodexUnverifiedInstall
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