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/lilToon/Details/05_Advanced.md

View on GitHub
# Advanced Features

## 1. AudioLink
Integrates with the AudioLink system to make materials react to music.

### Properties
*   **_UseAudioLink**: Enable AudioLink.
*   **_AudioLinkUVParams**: Selects the frequency band (Bass, Low Mid, High Mid, Treble) and maps it to UVs or effects.
*   **_AudioLink2Emission**, **_AudioLink2Vertex**, etc.: Toggles for specific effects.

### Implementation Call
Implemented in `lilAudioLinkFrag` (lil_common_frag.hlsl), called via `OVERRIDE_AUDIOLINK`.

```hlsl
#define OVERRIDE_AUDIOLINK \
    lilAudioLinkFrag(fd LIL_SAMP_IN(sampler_MainTex));
```

### Principles & Math
AudioLink writes audio amplitude data into a 128x4 texture.
*   **X**: Frequency bins.
*   **Y**: 4 rows (Bass, LowMid, HighMid, Treble) + History.

**Function (`lilAudioLinkFrag` Pseudo-Code):**

```hlsl
void lilAudioLinkFrag(inout lilFragData fd, ...) {
    // 1. Calculate UV
    float2 alUV = float2(0, 0);
    // Select Band Row (0-3)
    alUV.y = (float(_AudioLinkBand) + 0.5) / 4.0; 
    
    // 2. Sample Texture (Global AudioLink Texture)
    float4 audioData = Sample(_AudioLinkTexture, alUV);
    float amplitude = audioData.r; // Red channel typically holds amplitude
    
    // 3. Store
    fd.audioLinkValue = amplitude;
    
    // Example: Modulate Emission
    // Emission *= fd.audioLinkValue * Strength;
}
```

## 2. Outline (Inverted Hull)
Renders a colored outline around the object.

### Properties
*   **_OutlineColor**: Color of the outline.
*   **_OutlineWidth**: Width of the outline.
*   **_OutlineWidthMask**: Mask to control width per-vertex/pixel.
*   **_OutlineLitColor**: Interaction with lighting.

### Implementation Call
**Pass**: `FORWARD_OUTLINE` in `ltspass_opaque.shader`.
**Fragment**: `OVERRIDE_OUTLINE_COLOR` in `lil_common_frag.hlsl`.

```hlsl
#define OVERRIDE_OUTLINE_COLOR \
    LIL_GET_OUTLINE_TEX \
    LIL_APPLY_OUTLINE_TONECORRECTION \
    LIL_APPLY_OUTLINE_COLOR
```

### Principles & Math
**Vertex Shader (Extrusion)**
1.  Render mesh with Front Face Culling (Inside out).
2.  Move vertices along normal: $Pos_{new} = Pos + Normal \times Width$.

**Function (`lilCalcOutlinePosition` Pseudo-Code):**

```hlsl
void lilCalcOutlinePosition(...) {
    float width = _OutlineWidth * Sample(WidthMask, uv).r;
    
    // Distance scaling (Fixed Width in screen space)
    float dist = distance(CameraPos, positionWS);
    width *= lerp(1.0, dist, _OutlineFixWidth);
    
    positionOS += normalOS * width;
}
```

## 3. ID Mask
Efficiently hides parts of a mesh using a mask map or vertex IDs.

### Properties
*   **_IDMaskCompile**: Compile-time switch.
*   **_IDMask1** to **_IDMask8**: Toggles for specific ID ranges.
*   **_IDMaskIndex...**: The value to match.

### Principles & Math
*   **Vertex ID**: Checks `SV_VertexID` against a range $[Min, Max)$.
*   **Texture**: Checks pixel value against threshold.

**Function (`IDMask` Pseudo-Code):**

```hlsl
bool IDMask(uint vertexID, int indices[8], float flags[8]) {
    // Check if ID is in a disabled range
    if (vertexID >= indices[0] && vertexID < indices[1] && flags[0] == 1) return true; // Hide
    // ... check other ranges ...
    return false; // Show
}
```
If true, vertex is collapsed (moved to NaN or infinity) or pixel is discarded.

## 4. UDIM Discard
Optimized texture atlas usage. Discards pixels based on UV tile coordinates.

### Properties
*   **_UDIMDiscardMode**: Vertex or Pixel discard.
*   **_UDIMDiscardRow...**: Toggles for specific UV tiles.

### Implementation Call
Called via `OVERRIDE_UDIMDISCARD`.

```hlsl
#define OVERRIDE_UDIMDISCARD \
    if(_UDIMDiscardMode == 1 && LIL_CHECK_UDIMDISCARD(fd)) discard;
```

### Principles & Math
Tile Index = $(\text{floor}(u), \text{floor}(v))$.

**Function (`lilUDIMDiscard` Pseudo-Code):**

```hlsl
bool lilUDIMDiscard(float2 uv) {
    int u = (int)floor(uv.x);
    int v = (int)floor(uv.y);
    
    // Check against enabled tiles
    if (u == 0 && v == 0 && _UDIMDiscardRow0_0) return true; // Discard
    // ...
    return false;
}
```
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