본문으로 건너뛰기
CHOI HONGSU
1 min read

Glitch Shader

A UI glitch shader implemented with a 3-layer combination of RGB Split, texture-based UV distortion, and Mask layers

Period
2026.2
Engine
Unity 6 (6000.3.14f1) / URP 17.3.0
Platforms
AOS · iOS
Team
TA
My contribution
UI Glitch Shader

UI Glitch Shader

Implementation

  1. 01

    RGB Split (chromatic aberration)

    Sample only the R and B channels offset in each direction → G stays at the original. If the offset is 0, no branching — same as the original.

     
  2. 02

    2. Discrete time stepping (choppy glitch feel)

    floor quantizes time into steps so UV jumps abruptly → an analog tape glitch feel.

     
  3. 03

    3. Texture × Texture UV distortion

    GlitchTexture (spatial pattern) × WiggleTexture (temporal variation) → swapping the two textures gives a completely different pattern.

     
  4. 04

    4. Branchless Mask (Flip Blink + RGB Channel Cycle)

    Handled with step/lerp combinations, no GPU branches. #pragma target 2.0 Mobile target — branching cost minimized.

     

Tradeoffs & Future Work

Tradeoffs

  • Up to 4 texture samples (Main×3 + Glitch + Wiggle + Mask) — overkill for simple UI, so usage must be limited
  • No early-z benefit due to discard — pixels with mask 0 are explicitly discarded // however, this project uses no MSAA and uses FXAA

Future Work

  • Atlas support — added ST transform so GlitchTexture / WiggleTexture can be sliced and used from a Sprite Atlas

Tags

UIShaderGlitchRGB-SplitBranchless