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/04_Special_Effects.md

View on GitHub
# Special Effects

## 1. Glitter
Simulates a multi-faceted sparkling surface.

### Properties
*   **_UseGlitter**: Enable Glitter.
*   **_GlitterColor**: Base color.
*   **_GlitterParams1**, **_GlitterParams2**: Parameters controlling particle size, tiling, contrast, etc.
*   **_GlitterShapeTex**: Optional texture for particle shape.
*   **_GlitterSensitivity**: Sensitivity to light/view angle.

### Implementation Call
Implemented in `lilGlitter` (lil_common_frag.hlsl), called via `OVERRIDE_GLITTER`.

```hlsl
#define OVERRIDE_GLITTER \
    lilGlitter(fd LIL_SAMP_IN(sampler_MainTex));
```

### Principles & Math
1.  **Grid Generation**: Divide UV space into a grid.
2.  **Randomization (Voronoi)**: Assign a random seed to each cell.
3.  **Sparkle Calculation**: Compare view/light angle with a random normal.

**Function (`lilCalcGlitter` Pseudo-Code):**
```hlsl
float3 lilCalcGlitter(float2 uv, float3 N, float3 V, float3 L, ...) {
    float2 pos = uv * Tiling;
    // Voronoi Noise: Get random cell center & seed
    float4 near = lilVoronoi(pos, ...); 
    
    // Random Facet Normal from seed
    float3 sparkleNormal = abs(frac(near.xyz * 14.27 + Time * Speed) * 2.0 - 1.0);
    sparkleNormal = normalize(sparkleNormal * 2.0 - 1.0);
    
    // View Alignment
    float glitter = dot(sparkleNormal, CameraDir);
    glitter = abs(frac(glitter * Sensitivity) - 0.5) * 4.0 - 1.0; // Peak function
    glitter = pow(saturate(glitter), Contrast);
    
    // Lighting Influence
    float3 H = normalize(V + L);
    glitter *= saturate(dot(N, H)); // Mask by specular highlight area

    return Color * glitter;
}
```

## 2. Emission (Blinking & Gradation)
Adds glowing effects with animation.

### Properties
*   **_UseEmission**: Enable Emission.
*   **_EmissionColor**: Color and intensity.
*   **_EmissionMap**: Emission texture.
*   **_EmissionBlink**: Blinking settings (speed, offset, etc.).
*   **_EmissionGradTex**: Gradation texture for animated color changes.

### Implementation Call
Implemented in `lilEmission`, called via `OVERRIDE_EMISSION_1ST`.

```hlsl
#define OVERRIDE_EMISSION_1ST \
    lilEmission(fd LIL_SAMP_IN(sampler_MainTex));
```

### Principles & Math
**Blinking (`lilCalcBlink`)**
Uses a sine wave: $Blink = \sin(Time \times Speed + Offset) \times 0.5 + 0.5$

```hlsl
float lilCalcBlink(float4 blinkParams) {
    float outBlink = sin(Time * blinkParams.z + blinkParams.w) * 0.5 + 0.5;
    if(blinkParams.y > 0.5) outBlink = round(outBlink); // Hard Blink
    return lerp(1.0, outBlink, blinkParams.x); // Blend by strength
}
```

**Gradation**
Samples a 1D gradient texture based on time.
```hlsl
float gradUV = Speed * Time;
EmissionColor *= Sample(GradationTex, gradUV);
```

## 3. Dissolve
Erodes the object based on a mask and a threshold value.

### Properties
*   **_DissolveParams**: Controls mode (Texture, Point, Line), threshold, and edge width.
*   **_DissolveMask**: Texture mask.
*   **_DissolveNoiseMask**: Noise texture to randomize the edge.

### Implementation Call
Implemented in `lilCalcDissolveWithNoise`, called via `OVERRIDE_DISSOLVE`.

```hlsl
#define OVERRIDE_DISSOLVE \
    lilCalcDissolveWithNoise(...);
```

### Principles & Math
Compare Mask vs Threshold.
*   If $Mask < Threshold$, discard pixel.
*   Create border where $Mask \approx Threshold$.

**Pseudo-Code:**
```hlsl
void lilCalcDissolveWithNoise(...) {
    float mask = Sample(DissolveMask, uv);
    float noise = Sample(NoiseMask, uv) - 0.5;
    float combinedMask = mask + noise * Strength;
    
    // Visibility Check
    float visibility = combinedMask > Threshold ? 1.0 : 0.0;
    
    // Border Alpha (Glowing Edge)
    float borderAlpha = 1.0 - saturate(abs(combinedMask - Threshold) / BorderWidth);
    
    FinalAlpha *= visibility;
    OutBorderAlpha = borderAlpha;
}
```

## 4. Parallax Occlusion Mapping (POM)
Simulates depth by raymarching into the height map.

### Properties
*   **_UseParallax**: Enable Parallax.
*   **_UsePOM**: Enable POM.
*   **_ParallaxMap**: Height map.
*   **_Parallax**: Scale.

### Implementation Call
Called via `OVERRIDE_PARALLAX`.

### Principles & Math
Iteratively steps UV coordinates along the view vector projected onto the surface.

**Pseudo-Code (`lilPOM`):**
```hlsl
void lilPOM(...) {
    float3 rayDir = normalize(ViewDirTangentSpace);
    rayDir.z *= -1.0; // Invert Z (looking down)
    
    float stepSize = 1.0 / Steps;
    float currentHeight = 1.0;
    float2 currentUV = originalUV;
    
    for(int i=0; i < Steps; i++) {
        float heightFromMap = Sample(HeightMap, currentUV).r;
        if(currentHeight < heightFromMap) break; // Hit surface
        
        currentUV += rayDir.xy * stepSize * Scale;
        currentHeight -= stepSize;
    }
    modifiedUV = currentUV;
}
```
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