Documentation v2.0

Sprite Shaders Animated — 2D

128 combinable shader effects for sprites, UI, and particles — with SDF outlines, a built-in animation system, runtime API, effect presets, and SRP batching. Works on Built-in, URP, and HDRP out of the box.

128Effects
25Shader Variants
8Render Groups
1Setup Step
🍃
Leafo Studio

Made by leafousio — YouTuber, game developer, and asset creator.
Developer of Xenophobia, Rocky Path, Mark in Space.

Try 120+ basic effects

First Steps 🚀

  1. Import the package

    Drag the .unitypackage into your project. Everything lives under Assets/AnimatedSprite/.

  2. Add the component

    Select a SpriteRenderer, click Add Component → Animated Sprite Shader. The correct shader variant is auto-assigned based on your render pipeline.

  3. Turn on effects

    Open any category section, tick an effect, and tweak its sliders. That's it — no materials to create, no prefabs to set up.

💡
First time? Open the EffectShowcaseCarousel demo scene to see every effect running live with animated parameters.

Render Pipelines ⚙

Every shader variant ships for all three pipelines. Pick the right one and you're good to go. Open Master Setup (Window → Animated Sprite → Master Setup) to set your active pipeline — it patches all .shader files with the correct #define and configures the batching strategy.

● Built-in — 11 variants ● URP — 10 variants ● HDRP — 4 variants

All 17 Shader Variants

Built-inStandard
Built-inAdditive
Built-inMultiply
Built-inGUI
Built-inGUI Additive
Built-inStandard Premultiply
Built-inAdditive Soft
Built-inGUI Premultiply
Built-inScreen Space Overlay
Built-in3D Lit
Built-in3D Lit Cutout
URPstandard
URPadditive
URPpremultiply
URPGUI
URPGUIAdditive
URP2D Lit
URP2D Lit Additive
URP3D Lit
URP3D Lit Cutout
URP3D Lit Additive
HDRPUnlit
HDRPAdditive
HDRPLit
HDRPGUI
⚠️
URP shaders in a Built-in project = pink materials. Use Master Setup → Pipeline Migration to batch-swap all sprites in your scenes to the correct variants.

All 128 Effects ✦

Every effect listed below with a short description of what it does and what it's best used for. The colored dot next to each name shows its performance class: ● lightweight ● moderate ● heavy.

Color

36
Strong TintAdd ColorAlpha TintHit EffectNegativeGreyscaleBloomColor ReplaceLUT ReplaceHue ShiftAdd HueSaturationBrightnessContrastSplit ToningPosterizePoisonFrozenMetalCamouflageRainbowBlack TintChromatic AberrationPalette SwapDitheringCRT ScanlinesVignetteColor GradingSepiaThermal VisionRecolor RGBPing Pong GlowColor CycleGradientRadial GradientColor Ramp
Strong Tint
Paints over the sprite with a solid color while keeping transparency. Great for damage flashes, frozen states, or solid silhouettes.
Add Color
Brightens the sprite by adding a color tint on top. Perfect for glowing, magical, or 'supercharged' states.
Alpha Tint
Tints the sprite while keeping dark areas dark. Excellent for ambient mood lighting or underwater scenes.
Hit Effect
A harsh, flat color override. Essential for that classic arcade-style white 'damage flash' when an enemy is struck.
Negative
Inverts the colors. Gives a spooky, corrupted, or 'phase-shifted' look.
Greyscale
Drains all color to black and white. Perfect for death states, petrification, or cinematic flashbacks.
Bloom
Makes the bright areas of your sprite glow softly. Essential for neon signs, energy cores, or dreamy atmospheres.
Color Replace
Swaps up to 4 specific colors for new ones. The best tool for making alternate character skins or palette swaps.
LUT Replace
Replaces the sprite's color palette using a lookup texture. Feed it a gradient strip to completely remap the tonal range.
Hue Shift
Slides the sprite's colors around the rainbow. Good for psychedelic effects or rapid 'invincibility' color-cycling.
Add Hue
Adds hue, saturation, and brightness in HSV space. More precise than Hue Shift for targeted color adjustments.
Saturation
Boosts or drains color intensity. Push it high for a vibrant, punchy look, or drop it low for a muted, gloomy vibe.
Brightness
Lightens or darkens the entire sprite uniformly.
Contrast
Makes darks darker and lights lighter. Good for making a washed-out sprite 'pop' with more definition.
Split Toning
Tints highlights and shadows with different colors. A cinematic grading technique for stylized mood.
Posterize
Reduces the number of colors, creating chunky, distinct bands. Gives a retro, low-bit, or cel-shaded style.
Poison
Adds a sickly, bubbling, multi-colored noise overlay. Perfect for toxic, radioactive, or infected status effects.
Frozen
Covers the sprite in an icy, crystalline texture with bright, frosty highlights. Great for 'chilled' status effects.
Metal
Gives the sprite a shiny, reflective, metallic sheen that catches the light as it moves.
Camouflage
Overlays a procedural camo pattern on the sprite. Adjustable scale, colors, and blend.
Rainbow
Washes the sprite in a scrolling rainbow gradient. Classic visual for invincibility stars or ultimate abilities.
Black Tint
Tints only the dark areas of the sprite, leaving highlights untouched. Useful for subtle mood shifts.
Chromatic Aberration
Splits the red and blue color channels. Creates a glitchy '3D glasses' look or a heavy impact effect.
Palette Swap
Remaps colors through a 1D palette texture. Source pixel position maps to target color — classic retro recoloring.
Dithering
Adds a retro ordered-dithering pattern over the sprite. Screen-space mode keeps the pattern stable during movement.
CRT Scanlines
Applies CRT TV scanlines with optional barrel distortion for a retro monitor look.
Vignette
Darkens the edges of the sprite, drawing the eye to the center.
Color Grading
Exposure, gamma, and lift/gain controls. Quick per-sprite color correction without post-processing.
Sepia
Tints everything a warm, vintage brown. Gives the look of an antique photograph.
Thermal Vision
Remaps the sprite to a heat-map color scheme (cold=blue, hot=white).
Recolor RGB
Remaps each RGB channel individually. Swap red for blue, green for red — total channel control.
Ping Pong Glow
Smoothly pulses a glowing color on and off. Great for idle alarms, 'ready' states, or glowing runes.
Color Cycle
Smoothly crossfades through four custom colors over time. Great for enchanted items or shifting elemental states.
Gradient
Washes a smooth two-color gradient across the sprite at any angle. Good for lighting shifts or stylized shading.
Radial Gradient
Adds a circular gradient radiating outward from a center point. Good for a localized glow or darkening the edges.
Color Ramp
Completely recolors the sprite using a custom gradient map. Amazing for extreme stylized lighting or 'thermal vision' looks.

Edge

14
OutlineInner OutlineTexture OutlineRainbow OutlineDistort OutlineGlowShadowSoft ShadowRim LightOutline OnlyGradient OutlineAnim Outline ThicknessSelection HighlightFake Lighting
Outline
Adds a solid border around the sprite. Essential to make characters pop against backgrounds. Use SDF mode for smooth, scalable outlines.
Inner Outline
Draws a border inside the sprite. Good for subtle selection highlights that don't change the outer footprint.
Texture Outline
Uses a custom texture for the outline. Imagine a border made of scrolling fire, starry space, or flowing water.
Rainbow Outline
A solid outline that constantly cycles through rainbow colors.
Distort Outline
A wobbly, wavy, unstable outline. Great for jittery energy fields, slimes, or underwater borders.
Glow
Adds a soft, fuzzy, luminous aura around the outside of the sprite. Perfect for magical items or glowing auras.
Shadow
Drops a crisp, solid shadow offset behind the sprite. Gives a classic 2D UI or retro paper-craft feel.
Soft Shadow
Drops a blurred, realistic shadow behind the sprite to add depth and separate it from the background.
Rim Light
Highlights only the edges facing a certain direction. Perfect for faking a rim-light from a sun, moon, or torch.
Outline Only
Renders only the outline — the sprite interior becomes invisible. Good for wireframe or blueprint looks.
Gradient Outline
An outline that fades smoothly between two colors from one side to the other.
Anim Outline Thickness
Animates the outline thickness between a min and max value over time. Pulsing border effect.
Selection Highlight
An animated, dashed 'marching ants' outline. The standard 'this unit is selected' strategy game look.
Fake Lighting
Simulates a simple directional light with specular highlights. Adds depth to flat sprites without real lights.

UV / Distortion

28
PixelateWaveTwistUV DistortFull DistortDirectional DistortUV ScrollRotateSqueezeSquishWiggleWindSharpenGaussian BlurDirectional BlurWorld TilingUV Scale OffsetCurl NoiseFBM NoiseUV Scroll OverlayShockwaveSine ScaleHeartbeatBreathingLiquid WobbleFlip Book BlendSmooth Pixel ArtUV Bend Point
Pixelate
Makes the sprite blocky and low-res. Great for censoring, retro-demakes, or transitioning into a digital world.
Wave
Makes the sprite ripple gently. Perfect for a flag flapping in the wind or a reflection in water.
Twist
Swirls the sprite around a center point, like it's being sucked into a vortex or a black hole.
UV Distort
Warps the sprite using a custom noise texture. Good for heavy heat haze, underwater wobbles, or messy glitches.
Full Distort
A built-in, chaotic, bubbly distortion. Looks like boiling liquid, heavy heat shimmer, or chaotic energy.
Directional Distort
Smudges the sprite back and forth along a specific angle. Good for faking fast, vibrating movement.
UV Scroll
Slides the sprite's texture continuously. Essential for animating conveyor belts, flowing water, or laser beams.
Rotate
Spins the texture around its center point continuously or sets it to a fixed angle.
Squeeze
Pinches and stretches the sprite repeatedly. Good for a cartoonish 'breathing' or 'squishy' idle animation.
Squish
A classic squash-and-stretch effect. Use it for heavy impacts, jump wind-ups, or bouncing.
Wiggle
Shakes the sprite rapidly side-to-side. Perfect for 'about to explode', 'frozen shivering', or 'taking damage' states.
Wind
Bends the top of the sprite while keeping the bottom planted. Perfect for grass, trees, or hair blowing in the breeze.
Sharpen
Enhances the crispness of edges. Good for making slightly blurry assets pop with more definition.
Gaussian Blur
Blurs the sprite out of focus smoothly. Use for background elements, depth of field, or faking fast movement.
Directional Blur
Blurs the sprite only in one direction. The classic 'speed lines' motion blur look for fast dashes.
World Tiling
Repeats the sprite infinitely across the world. Great for making seamless backgrounds out of a single small sprite.
UV Scale Offset
Zooms in or shifts the texture around inside its bounding box.
Curl Noise
A smooth, swirling, magical-looking distortion that warps the image without tearing it.
FBM Noise
A cloudy, smoky, complex distortion that makes the sprite look like it's dissolving into gas.
UV Scroll Overlay
Slides a secondary texture over the sprite. Good for adding moving TV static, rain, or flowing energy.
Shockwave
Creates a ripple that pushes the sprite outward like a sonic boom or an explosion shockwave.
Sine Scale
Smoothly pulses the entire size of the sprite up and down.
Heartbeat
A sharp, rhythmic double-pulse. Literally mimics a beating heart.
Breathing
A slow, gentle vertical stretch, simulating a character calmly inhaling and exhaling.
Liquid Wobble
A jiggly, gelatinous movement. Essential for animating slimes, jellies, or water elementals.
Flip Book Blend
Smoothly crossfades between animation frames to make choppy, low-framerate animations look fluid.
Smooth Pixel Art
Keeps pixel art crisp but allows smooth sub-pixel movement/rotation without shimmering or jiggling edges.
UV Bend Point
Sucks the sprite inwards towards a specific point (like a black hole) or pushes it away (like magnetic repulsion).

Dissolve / Fade

19
DissolveGlow DissolveSource DissolveDirectional FadeDir Glow FadeFull Alpha DissolveHalftoneAlpha CutoffRadial WipeIris WipeBlindsDiamond DissolveScanline DissolveSpread FadePixel DissolveSpiral WipeHex DissolveBurn DirectionDash Shader
Dissolve
The classic 'burn away' effect using a noise texture. Leaves a colored, crusty edge where it burns.
Glow Dissolve
Like normal Dissolve, but the burning edge glows brightly. Great for magical creatures fading away.
Source Dissolve
Erases the sprite starting from a specific point and spreading outward, like a growing hole burning through paper.
Directional Fade
Wipes the sprite away cleanly in a straight line from any angle.
Dir Glow Fade
Wipes the sprite away, but leaves a glowing laser-like edge sweeping along the wipe.
Full Alpha Dissolve
Simply fades the whole sprite to transparent smoothly.
Halftone
Dissolves the sprite into comic-book style dots that shrink away into nothing.
Alpha Cutoff
Hard alpha threshold — pixels below the cutoff become fully transparent. Good for dithered transparency.
Radial Wipe
Wipes the sprite away in a circle, like a clock hand sweeping around. Good for cooldown timers.
Iris Wipe
Closes a circle on the sprite, shrinking to the center like a classic Looney Tunes ending.
Blinds
Slices the sprite into horizontal or vertical strips that smoothly disappear.
Diamond Dissolve
Dissolves the sprite into little shrinking diamond or rhombus shapes.
Scanline Dissolve
Dissolves the sprite by erasing horizontal TV scanlines one by one.
Spread Fade
Erases the sprite outward from a center point, leaving soft, smooth edges.
Pixel Dissolve
Dissolves the sprite into chunky, 8-bit style blocks. Great for retro teleports or digital deaths.
Spiral Wipe
Erases the sprite in a swirling galaxy pattern.
Hex Dissolve
Dissolves the sprite into a high-tech honeycomb/hexagonal grid. Great for sci-fi shields or holograms.
Burn Direction
A directional wipe that leaves a vivid, flickering fire and charcoal edge as it burns the sprite away.
Dash Shader
Quick dash/teleport dissolve — the sprite smears in the movement direction and fades.

Special Effects

31
HologramGlitchFlickerShineSmokeFlameEnchantedShiftingShift RainbowOverlayCheckerboardUV VisualizeHealth TintX-Ray SilhouetteMinimap PingDialogue EmphasisVoronoi CrackleWater ReflectionMotion SmearDepth ParallaxEnergy AuraGlobal SmokeHolographic CardCloud ShadowsTrail - Speed ColorTrail - AfterimageTrail - RainbowCharging AbilityBlueprintGhostingRetro Palette
Hologram
Adds scrolling scanlines, transparency, and signal jitter for a classic sci-fi hologram look.
Glitch
Slices the sprite horizontally and misaligns the color channels to look like a broken digital broadcast.
Flicker
Flashes the sprite completely invisible and visible rapidly. The classic 'invincibility frames' effect.
Shine
Sweeps a bright, angled glare across the sprite. Good for shiny rare cards, gems, or unsheathing a clean sword.
Smoke
Billows an animated, volumetric-looking smoke texture over the sprite.
Flame
Wraps the sprite in a flickering fire effect. Show the fire over the sprite, or make the sprite itself look like fire.
Enchanted
Sprinkles glittering, magical sparkles over the sprite.
Shifting
Smoothly pulses the sprite's brightness or color between two tones. Good for idle magical items.
Shift Rainbow
Washes a smoothly animated rainbow gradient over the sprite's lighting.
Overlay
Places any custom texture on top of the sprite with scrolling UVs and blend control.
Checkerboard
Covers the sprite in a racing or chess-board pattern that can lock to screen or world space.
UV Visualize
A technical debug tool that shows the underlying UV coordinates as Red and Green.
Health Tint
Automatically shifts the sprite's color to a 'danger' tint as health drops, with optional panic noise at low health.
X-Ray Silhouette
Shows a flat colored cutout of the sprite only when hidden behind a wall. Essential for tracking the player.
Minimap Ping
Emits a radar-like expanding ring from the sprite. Good for highlighting objectives or unit locations.
Dialogue Emphasis
A bouncy, joyful up-and-down hop. Used in RPGs when a character is talking excitedly.
Voronoi Crackle
Cracks the sprite like shattered glass, dry earth, or lava rock, leaving glowing fissures between chunks.
Water Reflection
Mirrors the top half of the sprite downward with animated ripples for a water reflection.
Motion Smear
Stretches the sprite backwards along its movement path to fake fast, snappy animation smearing.
Depth Parallax
Offsets a secondary layer based on view angle for a faux-3D parallax depth effect.
Energy Aura
Radiates a pulsing, luminous energy field around the sprite.
Global Smoke
Adds a layer of smoke that stays consistent across the whole screen, not locked to the sprite.
Holographic Card
Recreates the shiny, iridescent foil look of a rare physical trading card.
Cloud Shadows
Casts soft, moving shadows over the sprite, like clouds passing overhead in a sunny top-down game.
Trail - Speed Color
Leaves a color trail that changes hue based on how fast the sprite is moving.
Trail - Afterimage
Leaves a 'ghosting' trail of fading clones behind the moving sprite. A classic ninja/dash effect.
Trail - Rainbow
Leaves a vibrant, rainbow-colored ribbon trail behind the sprite as it dashes.
Charging Ability
Draws pulsing energy rings and electric static around the center. Perfect for 'charging up an attack' visuals.
Blueprint
Turns the sprite into a technical drawing, pulling out edges as sketchy lines on a blueprint grid.
Ghosting
Creates persistent fading afterimages that follow the sprite like an echo.
Retro Palette
Forces the sprite to only use colors from a specific limited palette (GameBoy, NES, etc.), with optional dithering.

Inspector 🔧

The custom inspector auto-generates UI for all 128 effects from the central registry. No manual wiring — if it's in the registry, it shows up.

🔍
Search

Type any effect name, keyword, or category to instantly filter the list down.

Perf Dots

Green / yellow / red dot next to every effect shows its GPU cost at a glance.

Keyframe Buttons

Click ♫ next to any float, color, or vector to open the one-click keyframe editor.

C#
Code Gen

Click C# on any effect (or the global button) to copy ready-to-paste setup code to your clipboard.

📋
Copy / Paste / Reset

Copy an effect's settings, paste them onto another sprite, or reset to defaults. Per-effect.

👁
Live Preview

96px preview thumbnail next to each expanded effect updates in real-time as you tweak sliders.

Outline Modes & SDF ◻

All outline and edge effects share a configurable sampling mode. Pick the one that fits your quality/performance needs.

ModeHow It WorksBest For
Classic 3×3 ● FastSamples 8 neighbors at the given size. Simple and cheap.Low-res sprites, mobile, large batches.
Multi-Ring ● ModerateSamples 8 directions × N rings for smoother, rounder outlines.Mid-res sprites, configurable quality via ring count.
SDF ● FastPre-baked signed distance field. Single texture sample per pixel. Smooth at any width.High-quality outlines, glow, any resolution. Best visual quality.

SDF Baking

Click Bake SDF Texture in the Edge Effects section to generate a float-precision signed distance field from your sprite. The bake uses the Jump Flood Algorithm and produces a 32-bit float .exr texture — 0.5 = sprite edge, above 0.5 = inside, below 0.5 = outside.

ℹ️
The Alpha Threshold slider controls which pixels count as "solid" during baking. Lower values (0.01) include semi-transparent edges. Higher values (0.5) only count fully opaque pixels.
⚠️
Set your sprite's Mesh Type to Full Rect so outlines can extend beyond the sprite bounds. Tight meshes will clip SDF outlines.

Tools 🛠

Quick actions right from the inspector — no digging through menus.

ToolWhat it does
Deactivate AllTurns off every effect at once. Clean slate.
Apply ChildrenCopies the shared material to all child renderers.
Atlas SetupReads sprite UV bounds from the atlas so edge effects stay within bounds.
Bake PNGRenders the sprite with all active effects into a PNG (1×, 2×, or 4× resolution).
Bake SDFGenerates a signed distance field texture (32-bit float EXR) for SDF outline mode.
Pack MasksCombines up to 4 grayscale masks into a single RGBA texture.
Setup AnimatorAdds an Animator component and opens the Animation window.
Save / Load PresetSave all effect settings as a ScriptableObject. Load it onto any other sprite.
Copy All Active (C#)Generates and copies C# code for every currently enabled effect's settings.

Effect Masks 🎭

Assign up to 4 grayscale textures as mask channels (R, G, B, A). They auto-pack into a single RGBA texture. Each effect can target a specific channel through the colored buttons below its parameters.

ℹ️
Masks auto-pack when you assign or remove a texture. The result is stored as packedMasks and sent to the shader as a single sample. There's also a global Effect Mask texture that affects all effects at once.

Global Settings 🌐

SettingDescription
Effect FadeMaster fade for all effects (0 = none, 1 = full).
Edge CleanupSnaps semi-transparent edge pixels to fully opaque or transparent. Kills dirty edges on pixel art.
Alpha CutoffHard alpha threshold for transparency. Pixels below the cutoff become invisible.
Effect MaskGlobal mask texture affecting all effects simultaneously.
Pixel Art SnapSnaps effect coordinates to a pixel grid — preserves crispness on low-res sprites.
Premultiplied AlphaPremultiplies RGB by alpha in the final output. Required by some blend modes and Canvas UI.
Flip X / Flip YMirrors the UV space. Auto-Detect button reads the SpriteRenderer's flip state.
Time ScaleSpeed multiplier for all animated effects.
Time FPSCaps animation to a specific frame rate (0 = unlimited). Great for retro looks.
Custom TimeReplace Unity time with a manual value. Useful for pausing or scrubbing effects.
UV ExpandExpands the vertex quad outward so edge effects like outlines and glow render outside sprite bounds.
Stencil BufferFull stencil control: ref, compare, pass, read/write masks. Useful for X-Ray Silhouette setups.
ShadowsCast/receive shadows and shadow alpha clip threshold (3D Lit variants only).

Performance ⚡

Every effect has a performance class shown as a colored dot in the inspector.

LevelMeaningExamples
● LightweightSmall math ops, no texture lookupsStrong Tint, Hit Effect, Negative, Brightness, Flicker
● ModerateA couple of cheap texture samplesOutline, UV Distort, Chromatic, Dissolve, Shine
● HeavyMultiple samples + heavy mathBloom, Gaussian Blur, Soft Shadow, Ghosting, Motion Smear
Disabled effects cost exactly zero. The shader uses shader_feature_local — Unity's compiler strips unused variants at build time. For maximum mobile performance, stick to green-dot effects and use Bake PNG to flatten complex setups into a single texture.

Sampler Packing

20 effect textures share 8 samplers to stay within mobile/DX11/OpenGL limits. Effects with similar sampling needs (linear clamp vs. linear repeat) are grouped onto shared samplers. You don't need to configure anything — it's automatic.

Animation System ♫

Every property is animatable through Unity's Animation window. The built-in keyframe editor generates curves without touching the timeline manually.

One-Click Keyframes

Click ♫ next to any property to open the editor with From / Mid / To values and easing curves.

Mid-Point Curves

Toggle mid-point for smooth loops (dim → bright → dim). Two-segment curve with independent easing.

📂
Clip Picker

Add curves to any AnimationClip from a dropdown, or target the currently active clip in the Animation window.

Keyframe Editor 🎹

Click ♫ next to any float, color, or vector property to open it.

FieldDescription
From / Mid / ToStart, optional midpoint, and end values. Mid creates a smooth two-segment loop.
Duration0.05 – 10 seconds.
EasingLinear, Ease In, Ease Out, Ease In-Out, Bounce, Elastic.
Bake FPSKeyframes per second baked into the curve (12 – 60).
Loop / Ping PongWhether the clip loops and bounces (from→to→from).

Animation Browser 📂

In the Tools section — shows all clips in the Animator Controller, lists animated shader properties with their value ranges. Click Open to jump to that clip in the Animation window.

C# Scripting API { }

Every effect can be enabled, configured, and animated from code. All public fields on AnimatedSpriteShader are yours to set.

Enable / Disable

C#
var mgr = GetComponent<AnimatedSpriteShader>();

mgr.outlineEnabled = true;
mgr.outlineColor = Color.cyan;
mgr.outlineSize = 0.02f;

mgr.dissolveEnabled = true;
mgr.dissolveAmount = 0.5f;

mgr.MarkDirty();  // always call after changing values from code

Switch Shader Variant

C#
mgr.ChangeShaderVariant(AnimatedSpriteShader.ShaderVariant.Lit2D_URP);

Incremental Push

C#
// Mark only what changed — avoids pushing all 128 effects every frame
mgr.MarkEffectDirty(EffectId.Dissolve);
mgr.MarkGlobalsDirty();
mgr.IncrementalPush();  // pushes only dirty groups to the GPU
ℹ️
MarkDirty() marks everything dirty and pushes on the next LateUpdate. For tighter control, use MarkEffectDirty(id) + IncrementalPush() to only push the groups that actually changed.

Combo Examples 🎨

C# — Frozen enemy that shatters
mgr.frozenEnabled = true;
mgr.frozenContrast = 2f;
mgr.frozenHighlight = 1.5f;
mgr.outlineEnabled = true;
mgr.outlineColor = new Color(0.5f, 0.85f, 1f);
mgr.outlineSize = 0.015f;
mgr.hexDissolveEnabled = true;
mgr.hexDissolveAmount = 0f; // animate 0→1 to shatter
mgr.MarkDirty();
C# — Holographic card with shine
mgr.holographicCardEnabled = true;
mgr.shineEnabled = true;
mgr.shineWidth = 0.15f;
mgr.shineGlow = 2f;
mgr.outlineEnabled = true;
mgr.outlineColor = Color.white;
mgr.outlineSize = 0.008f;
mgr.MarkDirty();
C# — Damage flash with screen shake vibe
mgr.hitEffectEnabled = true;
mgr.hitEffectColor = Color.white;
mgr.hitEffectBlend = 1f;
mgr.wiggleEnabled = true;
mgr.wiggleAmount = 0.05f;
mgr.wiggleFrequency = 25f;
mgr.MarkDirty();
// Then lerp hitEffectBlend and wiggleAmount back to 0 over ~0.15s

Effect Presets 💾

Save any sprite's complete effect setup as a ScriptableObject and load it onto other sprites. The preset stores every enabled effect plus all its parameters.

C# — Load a preset at runtime
var preset = Resources.Load<AnimSpriteEffectPreset>("MyPreset");
preset.ApplyTo(mgr);
mgr.MarkDirty();

Architecture 🧠

Understanding how the pieces fit together helps when extending the system or debugging edge cases.

C#
EffectRegistry.cs

Static array of EffectDef structs. The single source of truth — maps each effect's ID, keyword, C# field name, shader property name, category, group, and parameter metadata.

C#
AnimatedSpriteShader.cs

Runtime MonoBehaviour. Holds all 128 effect fields. Pushes values to the GPU via MaterialPropertyBlock. Handles SDF baking, atlas setup, variant switching, and incremental dirty tracking.

Editor
AnimatedSpriteShaderEditor.cs

Custom inspector. Reads the registry to auto-generate UI: categories, search, perf dots, sliders, keyframe buttons, code-gen, copy/paste, and live previews.

HLSL
AllInOneProperties.hlsl

Declares every shader property, texture sampler, and _En toggle float. 20 textures share 8 samplers via aliasing. Shared across all 17 variants.

HLSL
AllInOneKeywords.hlsl

All shader_feature_local pragmas. One keyword per effect — Unity strips unused ones at build time, so disabled effects cost exactly zero.

HLSL
AllInOneEffects.hlsl

The effect pipeline. Functions organized as: UV → Color → Edge → Dissolve → VFX → Gameplay. Each wrapped in #ifdef blocks.

Editor
AnimSpriteMasterSetup.cs

Editor window for project-wide settings: active pipeline, shader patching, keyword mode, effect group ordering, and pipeline migration tools.

C#
AnimSpriteProjectSettings.cs

ScriptableObject singleton storing the active pipeline, group render order, and per-group effect ordering. Shared between Master Setup and the editor.

C#
ShaderPropertyAnimator.cs

Drives the ♫ keyframe editor. Bakes AnimationCurves with configurable easing, mid-points, and ping-pong loops. Writes directly to AnimationClips.

Shader Internals ⚙

The fragment shader processes effects in a strict order inside the dispatch groups:

Simplified Pipeline — AllInOneEffects.hlsl
// 1. UV effects (wave, twist, distort, pixelate, scroll…)
uv = ApplyUVGroup(uv, time, worldPos);

// 2. Sample main texture + edge cleanup
half4 col = STEX(_MainTex, sampler_MainTex, uv);

// 3. Filter effects (sharpen, blur, flipbook blend…)
col = ApplyFilterGroup(col, uv, time);

// 4. Color effects (tint, bloom, hue, posterize…)
col = ApplyColorGroup(col, uv, time, worldPos);

// 5. Extended color (gradient, radial gradient, color ramp…)
col = ApplyColorExtGroup(col, uv, time);

// 6. Edge effects (outline, glow, shadow, rim…)
col = ApplyEdgeGroup(col, uv, time, masks);

// 7. Dissolve effects (fade, wipe, dissolve…)
col = ApplyDissolveGroup(col, uv, time, masks);

// 8. VFX effects (hologram, glitch, shine, flame…)
col = ApplyVFXGroup(col, uv, time, masks);

// 9. Gameplay effects (health tint, x-ray, trails…)
col = ApplyGameGroup(col, uv, time, masks);

Each effect block checks its _En float, optionally samples the effect mask, computes the effect, and composites via lerp or alpha blending. The order within each group is configurable through Master Setup.

SDF Pipeline ◈

The SDF system uses a signed distance field for outline and glow rendering. Here's how it works end-to-end.

Bake Process (C#)

BakeOutlineSDF() reads the sprite's texture rect, pads it by a configurable amount (default 16px), and computes inner + outer distance fields using the Jump Flood Algorithm. The result is a signed distance normalized into [0, 1]:

SDF normalization
signedDist = isSolid ? -innerDist : outerDist;
normalized = 0.5 - signedDist / (2 * spread);

Output is a 32-bit float RFloat texture saved as .exr — smooth gradients without banding. The spread value is stored on the component and pushed to the shader as _OutlineSDFSpread.

Outline Band Extraction (Shader)

The outline is carved from two one-sided smoothsteps to prevent overlap at small widths:

HLSL — Outline from SDF
sdfWidth = sizePx / (spread * 2);
outerEdge = 0.5 - sdfWidth;
outer = smoothstep(outerEdge - softness, outerEdge, sdf);
inner = smoothstep(0.5, 0.5 + softness, sdf);
outline = outer * (1.0 - inner);

This avoids the classic "surge at zero width" bug where symmetric smoothsteps overlap at their tails.

Adding a Custom Effect ➕

The system is designed to be extended. Add your own effects following this pattern:

  1. Write the Shader Code

    Add your effect function in AllInOneEffects.hlsl inside a #ifdef YOUR_KEYWORD block. Declare properties in AllInOneProperties.hlsl (both CBUFFER paths) and the keyword in AllInOneKeywords.hlsl.

  2. Register in EffectRegistry

    Add a new entry to the All array using M() or MG(). Define EffectId, name, keyword, enable field, category, group, and parameters.

  3. Add C# Fields

    Add matching public fields to AnimatedSpriteShader.cs — the enable bool plus any parameters. Field names must match the registry exactly.

  4. Wire up Push()

    In Push(), add the keyword toggle and property block calls. Follow the pattern of existing effects.

EffectRegistry.cs — example entry
M(EffectId.MyEffect, "My Effect", "_MYEFFECT_ON",
    "myEffectEnabled", "_MyEffect_En", EffectCategory.Special,
    "myEffectMaskCh", "_MyEffectMaskCh",
    F("myEffectAmount", "_MyEffectAmount", "Amount", 0, 1, "0.5"),
    C("myEffectColor", "_MyEffectColor", "Color")),
ℹ️
Once registered, the inspector, animation system, code generator, presets, copy/paste, and the showcase carousel all discover your effect automatically. No extra wiring.

Batching & MaterialPropertyBlock 📊

One shared material per shader variant. Per-instance values go through MaterialPropertyBlock — no batch breaks for parameter changes.

Batches together: same variant + same enabled effects (same keyword set).

Doesn't break batches: different colors, amounts, intensities, textures in the property block.

Breaks batches: different variants or different sets of enabled effects.

💡
For max batching, enable the same effects on grouped sprites and set unused parameters to zero instead of disabling. Keeps the keyword set identical across all instances.

Support & Effect Requests 💬

Got an idea for a new effect? Found a bug? Need help?

💬
Discord Community

Quick help, effect requests, showing off what you've built, and chatting with other users.

Join the Discord
✉️
Email

For private issues, business, offers

🎯 Requesting a New Effect

We actively build effects based on community requests. When describing what you want, it helps to include:

→  A description or reference image / video of the effect

→  What you'd use it for (combat, transitions, environment, UI…)

→  Whether it needs to be animatable, maskable, or pipeline-specific

Popular requests get prioritized in upcoming updates.

🐛
Found a bug? Include your Unity version, render pipeline, shader variant, and a screenshot of the inspector. Helps us fix it way faster.

FAQ ❓

My sprite turns pink / magenta

Shader variant doesn't match your render pipeline. Switch to the right one in the dropdown, or use Master Setup → Pipeline Migration to batch-fix all sprites.

Outline / glow bleeds into atlas neighbors

Click Atlas Setup in Tools. It writes UV bounds so edge effects stay inside your sprite's region.

SDF outline is clipped at sprite edges

Set your sprite's Mesh Type to Full Rect in the import settings. Tight meshes clip anything outside the silhouette.

SDF outline looks wrong after re-importing a sprite

Re-bake the SDF. The distance field is computed from the texture — if the sprite changes, the SDF needs regenerating.

Effects don't update in play mode

Call MarkDirty() after changing values from code. In the editor, changes push automatically.

Works with Spine / 2D Animation?

Yes. Color effects work on skeletal sprites out of the box. Edge effects apply per sub-sprite mesh.

How many effects can I stack?

No hard limit. Unity 2021.2+ supports 65,534 local keywords. Stack as many as you want.

Works with UI / Canvas?

Yes — use the GUI, GUI Additive, GUI Premultiply, or Screen Space Overlay variants.

Mobile performance?

Disabled effects = zero cost. On mobile, stick to green-dot (lightweight) effects. Use Bake PNG for complex setups — renders everything into a flat texture at export time.

How does batching work?

One shared material per variant. Per-instance data goes through MaterialPropertyBlock. Sprites with the same variant and same enabled effects batch together. Different parameter values (colors, amounts) don't break batches.

⭐⭐⭐⭐⭐

Enjoying the Asset?

Your review helps other devs find FlexiSprite and keeps us motivated to add more effects. Thank you! 🍃

⭐  Leave a Review on the Asset Store

Need help instead? Discord

🍃

FlexiSprite: Animated Sprite Shaders 2D  ·  by Leafo Studio

Unity 2021.3+  ·  Built-in / URP / HDRP