Skip to content

How to Dissolve a Sprite in Unity: Burn, Fade and Disintegrate

A dissolve compares a noise texture against an amount you raise from 0 to 1. Every pixel whose noise value is below the amount disappears, and a thin band just above it is painted as a glowing, burning edge. Change the noise and the same effect burns like paper, cracks like stone or breaks into pixels.

The soldier burns away from the edges in with a glowing orange edge, then burns back in, driven by the Dissolve script further down this page

Three things decide the look:

  • The noise texture. Its dark parts go first and its bright parts last. Soft clouds give a smoke-like fade, Voronoi cells give cracks, a gradient gives a wipe from one side.
  • The amount. A single number. Animating it from “nothing gone” to “everything gone” is the dissolve.
  • The edge. The pixels just about to go, coloured and usually made to glow. Without an edge it reads as a fade; with one, as burning.

The graph is short: a noise, a Step for the cut, a second Step a little further on for the edge, and the sprite’s alpha multiplied by the cut. It is built and recorded step by step, on a Sprite Unlit graph, in A Shader Graph dissolve.

A Sprite Unlit graph made of Unity's nodes only. Simple Noise at Scale 30 goes into two Step nodes: one with Dissolve Amount as its Edge, one with Dissolve Amount plus Edge Width. Subtract takes the second from the first, leaving a thin white band in its preview; Multiply colours the band with Edge Color, and Add puts it on the sprite's colour into Base Color. Another Multiply takes the sprite's alpha times the first Step into Alpha

On a sprite, two things to know:

  • The renderer’s Color works without a Vertex Color node. URP’s sprite targets multiply the graph’s result by the SpriteRenderer’s Color on their own; a Vertex Color node in the graph would apply it twice.
  • Leave room for the edge. The edge is drawn inside the sprite’s shape, so it needs no extra space, but a glow under Bloom spreads past it. A sprite cropped tight to its pixels clips that halo; see Textures Setup.

Don’t own it yet? → Get it on the Unity Asset Store

Add the AllIn1Shader component to the sprite or UI Image (Add Component → AllIn1SpriteShader → AddAllIn1Shader) and tick Fade in the material’s Color Effects.

2.Fade ticked in the material's Color Effects, at its defaults: Fade Texture seamlessNoise, Fade Amount -0.1, Fade Burn Width 0.025, Burn Transition 0.075, Fade Burn Color yellow, a fiery Fade Burn Texture and Fade Burn Glow 2
  • Fade Texture (_FadeTex) is the noise. The shader reads its red channel. It starts as seamlessNoise.png, one of the textures in the asset’s Textures folder; flameNoise.png and fire.png give a more ragged edge. The asset window’s Tileable Noise Creator makes more: Perlin, Voronoi, Cellular and others (Asset Window).
  • Fade Amount (_FadeAmount) runs from -0.1, the whole sprite, to 1, nothing left. At 0 the darkest parts of the texture are already gone, which is why it starts below 0.
  • Fade Burn Width (_FadeBurnWidth) is how wide the burning edge is, 0.025 by default.
  • Burn Transition (_FadeBurnTransition) is how soft the cut is, from 0.01 (hard) to 0.5 (a long fade).
  • Fade Burn Color (_FadeBurnColor) and Fade Burn Texture (_FadeBurnTex) colour the edge.
  • Fade Burn Glow (_FadeBurnGlow), from 1 to 250, makes the edge brighter than white. It glows only with Bloom; see How to Make a Sprite Glow.
The same dissolve on three Fade Textures. seamlessNoise eats the soldier in small ragged flakes, flameNoise opens large round holes, and a Voronoi texture from the Tileable Noise Creator breaks it along cell walls
The same dissolve three times. At Fade Burn Glow 1 the edge is a dark, burnt line. At 20 it burns bright yellow and orange, with a soft halo under Bloom and none with Bloom off

The edge only appears once Fade Amount is above 0, so a sprite at rest shows no burn at all.

The noise textures that ship with the asset are imported as sRGB colour textures. In a project set to Linear colour space, Unity darkens such a texture before the shader reads it, so the sprite loses more of itself early in the slider. For an even sweep from -0.1 to 1, untick sRGB (Color Texture) in the fade texture’s import settings.

Sprites inside an atlas need Sprite inside an atlas? ticked in Advanced Configuration and the SetAtlasUvs component, or the noise is spread across the whole atlas rather than the sprite; see Sprite Atlases.

Leave Fade ticked and move only Fade Amount: up to dissolve, down to bring the sprite back. On a sprite, the Animation window can key it (How to Animate Effects). From code:

using System.Collections;
using UnityEngine;
public class Dissolve : MonoBehaviour
{
private static readonly int FadeAmount = Shader.PropertyToID("_FadeAmount");
[SerializeField] private float duration = 0.8f;
private Material mat;
private void Awake()
{
mat = GetComponent<Renderer>().material;
}
public void DissolveOut() => Play(-0.1f, 1f);
public void DissolveIn() => Play(1f, -0.1f);
private void Play(float from, float to)
{
StopAllCoroutines();
StartCoroutine(Run(from, to));
}
private IEnumerator Run(float from, float to)
{
for (float t = 0f; t < duration; t += Time.deltaTime)
{
mat.SetFloat(FadeAmount, Mathf.Lerp(from, to, t / duration));
yield return null;
}
mat.SetFloat(FadeAmount, to);
}
}

With DOTween it is one line, mat.DOFloat(1f, "_FadeAmount", 0.8f);, and the way back is the same call to -0.1.

If an Animator also keys Fade Amount, the Animator wins. It writes the property every frame its clip plays, so a script that sets the amount at the same time is overwritten. A heal that should bring a burned sprite back from code has to stop the clip first, or play a clip that runs the other way.

Fade works on a UI Image the same way, for a card that burns when it is played or a panel that dissolves away. Two things change:

  • UI materials are shared, so every card with the same material dissolves together. Give each Image its own copy on Awake (UI Images).
  • The Animator cannot animate UI materials; use code or DOTween (why).

A burning edge with Fade Burn Glow needs Bloom, which never reaches a Screen Space Overlay canvas (Glow on UI Images). Without Bloom the edge still shows, in its colour, without a halo.

Each sprite reads the noise across its own texture. So when a character or a scene is built from separate sprites (a body, a weapon, a shield, a prop), each one dissolves in its own pattern, even with the same Fade Amount on all of them. For a quick death that is rarely noticed. Set the amount on every sprite at once, as in Scripting, and they burn away together.

For one pattern across the whole group, burn a picture of it instead:

  1. Put the group where a second camera sees it and the main camera does not: out of the main camera’s view, as in the clip below, or on a layer of its own left out of the main camera’s Culling Mask.
  2. Give that camera a Render Texture as its Output Texture, with Background Type set to a solid colour whose alpha is 0, so the texture keeps only the group’s shape.
  3. Show the Render Texture on a quad with the shader’s material, Fade ticked, in the main camera’s view. A Render Texture can’t be a sprite, so it goes on a quad, a Mesh Renderer.
  4. Move Fade Amount on the quad’s material, and the whole group burns as one.
The three steps. The group, a monster, the soldier and a coin, as the second camera sees it. The Render Texture it draws, shown over grey squares where it is transparent. The quad with that texture and the Fade material, starting to burn
A monster, the soldier and a coin, three separate sprites, burning with one Fade Amount: each burns in its own pattern, the small coin riddled with tiny holes. Next to it the same group drawn into a Render Texture on one quad: one large pattern runs across all three, cutting through the monster, the soldier and the coin alike
  • One pattern across separate sprites. Each renderer dissolves in its own texture’s space.
  • Burn on its own. Something has to move Fade Amount: a clip, a script or a tween.
  • Leave the sprite’s space. The dissolve happens inside the sprite’s shape; it does not throw off ash or embers. Pair it with a particle effect for that.