This is a custom Additive UI Shader specifically designed for the Unity UI (UGUI) system, with full support for Unity UI Mask and RectMask2D components. Unlike standard additive shaders—which typically do not respect UI masking due to missing stencil buffer integration—this shader is built with proper stencil operations and UI-compatible render settings, allowing it to function seamlessly within masked UI hierarchies.
Key Technical Features:
- Fully compatible with Unity UGUI
- Supports
MaskandRectMask2D - Works correctly inside nested UI hierarchies
- Supports
- Additive blending mode
- Uses
Blend One Onefor true additive rendering - Ideal for glow, highlights, energy effects, and UI VFX overlays
- Uses
- Stencil buffer integration
- Implements Unity’s UI stencil properties (
_Stencil,_StencilComp,_StencilOp, etc.) - Ensures proper interaction with UI masking components
- Implements Unity’s UI stencil properties (
- Optimized for performance
- Designed for mobile and WebGL platforms
- Minimal overdraw impact
- Lightweight fragment operations
- No unnecessary lighting calculations (Unlit shader)
- Canvas-friendly render setup
- Compatible with Screen Space – Overlay and Screen Space – Camera
- Supports batching where applicable
- Cross-platform tested
- Verified on mobile, desktop, and WebGL builds
The shader was generated with the assistance of ChatGPT AI, then refined, integrated, and thoroughly tested across multiple platforms to ensure stability, performance, and compatibility.This shader is ideal for implementing masked additive effects on UI elements, such as glows, animated highlights, magical effects, particles rendered in UI space, or dynamic feedback elements.

















































