Shader-Based Juice: Hit Flash, Dissolve, Outline, and Rim Light
Four essential juice shaders every indie dev should have. Hit flash (full-white emission burst), damage dissolve (noise-based disintegration), selection outline (edge detection), and rim light (depth-cue glow). GLSL and HLSL patterns included.
28 April 2026 ยท 4 min read
Shaders are programs that run on the GPU and determine how every pixel of a surface is rendered. Unlike particles, which are separate game objects with their own transforms and lifecycle, shader effects are applied directly to the material of an existing object. They can create some of the most visually striking and performant juice effects in the game -- at near-zero CPU cost.
The four shader techniques covered here -- hit flash, dissolve, outline, and rim light -- are the most universally applicable to game feel. Each can be implemented in Unity's Shader Graph without writing raw HLSL, making them accessible to developers without deep shader programming experience.
The Hit Flash Shader
The hit flash -- an object briefly rendering as a solid colour on damage -- is the most universally used shader-based juice effect. In Shader Graph: add a Color property ('_FlashColor', default white) and a Float property ('_FlashAmount', range 0-1). In the shader graph, use a Lerp node to blend between the base texture colour and the flash colour, using '_FlashAmount' as the blend weight. Connect to the Base Color output.
From code, use MaterialPropertyBlock to set '_FlashAmount' to 1.0 on hit, then lerp it back to 0.0 over 2-4 frames using a coroutine or Update. MaterialPropertyBlock avoids creating new material instances, which matters when you have many enemies using the same material.
Colour choices matter: white flash is neutral and readable on any base colour; red communicates damage specifically; team-colour flashes (blue for friendly fire) carry additional information. Layer multiple flash colours using parameter blending if your game requires distinct flash types.
Dissolve Shaders
A dissolve shader makes an object appear or disappear by progressively eating away its pixels based on a noise texture threshold. The key nodes: sample a noise texture (Voronoi or Perlin noise works well); compare the noise value to a '_Threshold' parameter using a Step node; use the result to drive the Alpha output (discard pixels where step output = 0).
The iconic burning edge effect: in addition to the basic alpha discard, add an edge glow by detecting pixels where the noise value is within a narrow band just above the threshold (e.g., threshold to threshold + 0.05). In that band, override the colour with a bright emissive colour (orange-white). This makes the dissolve look like the object is burning away from the edges rather than simply disappearing.
Directional dissolve: instead of using noise as the sole threshold input, blend it with a world-space or screen-space position value. This creates a dissolve that sweeps in a direction -- from impact point outward, from bottom to top, or from the point of a sword through the body of an enemy. Much more dramatic than omnidirectional dissolve.
Outline and Silhouette Shaders
Outlines serve three distinct gameplay functions: highlighting interactable objects (hover highlight), identifying enemy types at a glance (colour-coded threat level), and the see-through-wall X-ray effect used in tactical shooters. Each requires a slightly different approach.
Stencil buffer approach: render the object to the stencil buffer normally, then render a slightly scaled-up version of the object with the stencil test inverted (only draws where the original did not). The extra pixels form the outline. Control colour and thickness by adjusting the scale factor and the outline pass's colour. This is performant and works for opaque objects.
X-ray variant: disable the depth test on the outline pass. Now the outline renders through occluding geometry, creating the through-wall glow used by games like Call of Duty, Valorant, and Hollow Knight. The outline appears even when the enemy is fully hidden. Colour-code by threat: red for active threats, yellow for neutral, white for objectives.
Rim Lighting and Fresnel Effects
Rim lighting creates a glow at the silhouette edge of an object by detecting where the surface normal is nearly perpendicular to the view direction. In Shader Graph: use a Fresnel Effect node (which computes this automatically), connect its output to control the blend between the base colour and the rim colour. The power input on Fresnel Effect controls the rim width -- higher values create a narrower, sharper rim.
Rim light juice applications: white or blue rim for the player character communicates protagonist status and visual separation from backgrounds. Red rim for enemies under attack communicates damage. Gold/yellow animated pulsing rim communicates a charged or buffed state. Animated rim (pulsing the power or intensity value over time) communicates energy or readiness without any additional VFX.
Holographic and Glitch Effects
Holographic effects combine several shader techniques: scan-line overlays (tile a horizontal line texture over the surface in UV space, animate its Y offset over time), partial alpha dithering (a checkerboard of opaque and transparent pixels that reads as partial transparency without requiring a transparency pass), and chromatic aberration in UV space (offset the UV coordinates for the red, green, and blue channels slightly, creating colour fringing at edges).
Glitch displacement: add a time-varying noise-based vertex displacement in the vertex shader. On a glitch trigger (an enemy taking a severe hit, a hologram malfunctioning, a player entering a disruption field), increase the noise amplitude dramatically for 3-5 frames then decay back. Objects appear to spatially tear. Combined with the chromatic aberration and scan-line effects, this creates an unmistakable digital-damage visual language.
Part of a series
Advanced & Specialised