LeoYeAI/agent-master-skills / skills/animation-shader
animation-shader
VerifiedREAD 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.
references/PoiyomiShaders/Details/01_Base_Main.md
View on GitHub# Base & Main Features
This document details the base appearance and geometry manipulation features of the Poiyomi Toon Shader.
## 1. Main Appearance
The core visual settings found in the "Main" section.
### Properties
* **Color & Texture**:
* `_Color`: Base color tint.
* **`_MainTex`**: Base Albedo texture.
* **`_BumpMap`**: Normal map.
* **`_BumpScale`**: Normal map intensity.
* **`_Cutoff`**: Alpha cutoff threshold (for Cutout mode).
* **`_AlphaMod`**: Global alpha modifier.
* **Color Adjust**:
* **`_MainHueShift`**: Hue shift amount (0-1).
* **`_Saturation`**: Saturation adjustment (-1 to 1).
* **`_MainBrightness`**: Brightness multiplier.
### Implementation Call
**Fragment Shader**: `frag` function in `Poiyomi.shader`.
The base color is sampled and adjusted early in the fragment pipeline.
**Pseudo-Code:**
```hlsl
float4 mainTexture = SampleTexture(_MainTex, uv);
float3 baseColor = mainTexture.rgb * _Color.rgb;
// Hue Shift
baseColor = HueShift(baseColor, _MainHueShift);
// Saturation/Brightness
baseColor = AdjustSaturation(baseColor, _Saturation);
baseColor *= _MainBrightness;
```
## 2. Vertex Manipulation
Geometric deformations applied in the Vertex Shader. This allows for animating the mesh without changing the actual model data.
### Properties
* **Translation**: `_VertexManipulationLocalTranslation`, `_VertexManipulationWorldTranslation`.
* **Rotation**: `_VertexManipulationLocalRotation` (Euler angles), `_VertexManipulationLocalRotationSpeed`.
* **Scale**: `_VertexManipulationLocalScale`.
* **Rounding**: `_VertexRoundingEnabled`, `_VertexRoundingDivision` (Grid size for retro effect).
* **Distortion**: `_VertexBarrelMode`, `_VertexSphereMode`.
### Implementation Call
**Vertex Shader**: `vert` function in `Poiyomi.shader` (approx line 8920).
**Core Logic (Pseudo-code):**
```hlsl
VertexOut vert(appdata v) {
// 1. AudioLink Data Retrieval
float4 bands = GetAudioLinkBands();
// 2. Calculate Offsets
float3 translation = _VertexManipulationLocalTranslation;
float3 rotation = _VertexManipulationLocalRotation;
if (_VertexAudioLinkEnabled) {
// AudioLink modifies the base transformation values
translation += lerp(_VertexLocalTranslationALMin, _VertexLocalTranslationALMax, bands[BandIndex]);
rotation += bands[RotBand] * _VertexLocalRotationAL;
}
// 3. Apply Rotation & Translation
// Rotate around pivot (usually object center)
v.vertex = Rotate(v.vertex, rotation);
v.vertex.xyz += translation;
// 4. Barrel/Sphere Distortion
if (_VertexBarrelMode) {
// Distort XZ based on height or distance
v.vertex.xz = DistortBarrel(v.vertex.xz, _VertexBarrelWidth);
}
// 5. Rounding (Retro Effect)
if (_VertexRoundingEnabled) {
float grid = _VertexRoundingDivision;
// Snap vertex positions to the nearest grid point
v.vertex.xyz = ceil(v.vertex.xyz / grid) * grid;
}
return o;
}
```
## 3. Vertex Glitching
Simulates digital artifacts by displacing vertices randomly or based on a texture.
### Properties
* **`_VertexGlitchStrength`**: Intensity of the glitch displacement.
* **`_VertexGlitchFrequency`**: Speed of the jitter animation.
* **`_VertexGlitchThreshold`**: Cutoff value to make glitching intermittent.
* **`_VertexGlitchMap`**: Optional texture to mask where glitches happen.
### Principles & Math
Uses a noise function based on time and vertex position (`_Time.y` and `worldPos.y`) to generate a random offset vector.
### Implementation
**Pseudo-Code:**
```hlsl
if (_VertexGlitchingEnabled) {
// Generate noise based on time and position
float time = _Time.y * _VertexGlitchFrequency;
float noise = sin(dot(worldPos.y, 12.9898)) + sin(time);
// Threshold check
if (noise > _VertexGlitchThreshold) {
// Calculate offset direction (orthogonal to view)
float3 direction = normalize(cross(ViewDir, Up));
// Apply offset
float3 offset = direction * _VertexGlitchStrength;
// AudioLink Modulation
if (_VertexAudioLinkEnabled) {
offset *= AudioLinkData(Band).r;
}
v.vertex.xyz += offset;
}
}
```
## 4. Dissolve
Poiyomi supports advanced dissolve effects, including "UV Tile Dissolve".
### Properties
* **`_UVTileDissolveEnabled`**: Toggle for tile-based dissolve.
* **`_DissolveAlpha`**: Progress of the dissolve.
### Implementation
**Vertex Discard Logic:**
```hlsl
if (_UVTileDissolveEnabled) {
// Quantize UVs to create "tiles"
float2 tileUV = floor(v.uv * GridSize);
// Sample noise for this tile
float noise = SampleNoise(tileUV);
// Discard entire tile if below threshold
if (noise < _DissolveAlpha) {
return NAN; // Discard vertex by returning NaN position
}
}
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |