Liquid Glass: Real-Time Glass UI & Refraction Shader (URP)


Up to 16 shapes per group, drawn as one shape in one draw call 3D version for world-space glass quads (Liquid Glass Mesh Group) ... Four material presets: Clear, Dark, Chromatic and Mesh


by hardartcore


Price History +

Liquid glass for Unity UI and 3D: lens refraction, frosted blur, rim light and shapes that melt together. One shared capture, one draw call. URP, mobile ready.

• Unity 6 (tested on 6000.6), URP 17 (Render Graph) with the Universal Renderer

• Assemblies: HardArtcore.LiquidGlass (runtime), HardArtcore.LiquidGlass.Editor, HardArtcore.LiquidGlass.Demo

• Components: LiquidGlassFeature (URP renderer feature), LiquidGlassUI, LiquidGlassGroup, LiquidGlassMeshGroup

• Shaders: "HardArtcore/Liquid Glass/UI", "HardArtcore/Liquid Glass/Mesh", a hidden dual Kawase blur

• Capture: persistent per-camera textures; downsample 1 to 4; 1 to 6 blur iterations; refresh every 1 to 30 frames

• Shape: analytic rounded-rectangle SDF; refraction offsets mapped to the screen with screen-space derivatives

• Merging: polynomial smooth minimum of up to 16 shapes per group, with blended normals and settings

• UI glass: per-element settings in vertex streams (TEXCOORD1/2), so all elements share one material

• Mesh glass: SRP Batcher compatible, GPU instancing

• Demo content: 2 scenes, 4 glass materials, a procedural wallpaper texture, Nunito font

• Includes full C# and shader source and documentation

Real-time liquid glass for Unity UI and 3D, in the style of iOS Liquid Glass.


Liquid Glass turns any uGUI Image, quad, mesh or sprite into a piece of curved glass. The background bends at the rim like a real lens, blurs from clear to frosted, picks up a bright specular rim and a touch of vibrancy, and glass shapes melt into each other when they get close. Everything is live: move the camera, animate the content behind, drag the glass, and it all refracts in real time.


It is built for mobile first. The camera image is captured once per frame at reduced resolution and blurred with a dual Kawase pyramid, and every glass element on screen reads that one shared capture. Adding more glass costs only the pixels it covers. All UI glass shares one material and batches into a single draw call.


THE GLASS

• Lens refraction from an analytic rounded-rectangle shape: rectangles, pills and circles, with crisp one-pixel anti-aliasing at any scale

• Clear to frosted: blend between a sharp and a blurred background per element

• Specular rim light that favours a light direction, edge glow, saturation, brightness and tint

• Optional chromatic aberration at the rim (a shader keyword: it costs nothing when off)

• Works under any rotation, scale, Canvas Scaler or perspective camera


SHAPES THAT MERGE

• Liquid Glass Group: child glass shapes melt together as they get close, like iOS toolbars and buttons

• Drag, animate or tween the shapes: clicks and drags keep working, and the merge follows live

• Each shape keeps its own corner radius, rim, refraction and blur; where shapes meet, the settings blend

• Up to 16 shapes per group, drawn as one shape in one draw call

• 3D version for world-space glass quads (Liquid Glass Mesh Group)


UI AND 3D

• UI: any uGUI Graphic with the LiquidGlassUI component; RectMask2D (with softness), Mask, CanvasGroup fades and the Image color are supported

• 3D and 2D world space: quads, meshes and SpriteRenderers with the Mesh shader; size follows the object's scale

• Separate world capture, so world-space glass never refracts itself


PERFORMANCE

• One background capture and blur per camera, shared by every glass element

• Capture at 1/2 to 1/4 resolution, 1 to 6 blur iterations, blur spread at no extra cost

• 2 texture samples per glass pixel (6 with chromatic aberration), no loops outside merging groups

• All UI glass in one draw call; the Mesh shader is SRP Batcher compatible and supports GPU instancing

• Refresh the capture every N frames for static screens, or skip all work while no glass UI is enabled


EASY SETUP

• GameObject > UI > Liquid Glass Panel and Liquid Glass Group, GameObject > 3D Object > Liquid Glass Group

• The URP renderer feature is added for you; inspectors warn and fix missing setup with one click

• Four material presets: Clear, Dark, Chromatic and Mesh

• Two demo scenes: a glass UI over moving 3D objects (draggable card, frosted search bar, clear lens, buttons, tab bar, merging group) and a 3D scene with rotating and merging glass


FOR PROGRAMMERS

• Clean, commented C# in its own assembly definitions; public properties for every per-element setting

• A Render Graph renderer feature (no compatibility mode needed)

• Full shader source, with the glass shading shared in one HLSL include


REQUIREMENTS

• Unity 6 with the Universal Render Pipeline (Render Graph). Tested on Unity 6000.6 with URP 17.6

• uGUI for the UI components

• Not supported: the Built-in Render Pipeline and HDRP


THIRD-PARTY

The demo scenes use the Nunito font (SIL Open Font License 1.1). See the Third-party notices in the package's Documentation.html.


Support: support@hardartcore.com