advanced

#33 Sprite Outline

Edge glow and outline for selection

Selection outlines highlight interactive objects — from RTS unit selection to RPG item pickups. This shader demonstrates two approaches: a thin outline that samples the shape mask at offset positions to detect edges, and a thick glow using distance-based falloff from the shape boundary. The outline color cycles and pulses over time to draw attention, a common game UI pattern.

Key Concepts

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous Dissolve Effect Next → Shockwave Distortion

All Tutorials