Skip to content

Disyamee/GlassUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Liquid Glass ImGui

A frosted-glass UI theme and widget library for Dear ImGui, rendered with Direct3D 11. Translucent panels blur the scene behind them in real time using a multi-pass Kawase blur, while custom-drawn widgets add specular highlights, spring-physics animations, and soft shadows — all running in a single lightweight Win32 window.

Screenshots

Main Music Settings
Main tab — widget showcase Music tab — Apple Music-style layout Settings tab — theme controls

Features

  • Real-time Kawase blur — configurable iteration count and offset, applied per-frame on the D3D11 backbuffer
  • Optional edge refraction — displacement shader along window borders for an extra glass feel
  • Custom glass widgets — Button, Toggle, Checkbox, RadioButton, SliderFloat/Int, ProgressBar, TabBar, and glass-styled wrappers for every standard ImGui input, combo, drag, color, tree, table, and menu widget
  • Glass card containersBeginGlassCard / EndGlassCard for grouping content inside blurred panels
  • Animated background — soft floating blobs behind the UI (disabled automatically on weak hardware)
  • Spring-physics interactions — hover scale, press scale, and smooth toggle knob with configurable stiffness and damping
  • Cursor-tracking specular highlight — light spot follows the mouse across each widget
  • Idle throttling — automatically drops to a low FPS after a configurable inactivity timeout
  • Low-power auto-detection — falls back to a simplified render path on WARP / basic display adapters (for VPS)
  • High-DPI support — responds to WM_DPICHANGED for per-monitor DPI scaling
  • Full theme control — every color, alpha, blur parameter, animation speed, and scale factor is exposed in GlassTheme and tweakable at runtime via the Settings tab

Demo Tabs

Tab Description
Main Widget showcase — buttons, toggles, sliders, inputs, tables, trees, color pickers, and more
Music Apple Music-inspired layout with album cards and a "Now Playing" bar (Demo Tab)
Settings Live controls for accent color, blur iterations, glass alpha, rounding, animation speeds, and performance options

Requirements

  • OS — Windows 10 or later
  • Compiler — MSVC with the v143 toolset (Visual Studio 2022 recommended; 2019 works with v143)
  • SDK — Windows 10 SDK
  • Graphics — any GPU that supports Direct3D 11 (falls back to WARP automatically)

All third-party code is vendored in the repository — no package manager or extra downloads needed.

Building

  1. Open GlassUI.sln in Visual Studio.
  2. Select a configuration (Debug or Release) and platform (x86 or x64).
  3. Build the solution (Ctrl+Shift+B or Build → Build Solution).
  4. Run with F5, or find the executable in the output directory (e.g. x64/Release/GlassUI.exe).

Project Structure

GlassUI.sln
GlassUI/
├── GlassUI.cpp          # Win32 entry point, D3D11 setup, main render loop
├── gui.h / gui.cpp      # UI layer — BuildUI, glass cards, demo tab content
├── glass_effect.h       # Kawase blur & edge refraction (D3D11 shaders)
├── glass_widgets.h/cpp  # Custom-drawn glass widgets + ImGui wrappers
├── ui_theme.h           # GlassTheme — all color tokens & tuning parameters
├── ui_style.h           # UIStyle — base Dear ImGui style overrides
├── stb_image.h          # stb_image (vendored)
└── imgui/               # Dear ImGui 1.92.1 with Win32 + DX11 backends

Using the Glass Widgets

Replace ImGui:: calls with GlassUI:: to get glass-styled versions:

#include "glass_widgets.h"

// Custom-drawn glass button with blur, highlights, and spring animation
if (GlassUI::Button("Click me"))
    DoSomething();

// Glass toggle switch
static bool enabled = false;
GlassUI::Toggle("Feature", &enabled);

// Glass slider
static float value = 0.5f;
GlassUI::SliderFloat("Amount", &value, 0.0f, 1.0f);

// Standard ImGui widgets automatically wrapped with glass frame styling
static char buf[128] = "";
GlassUI::InputText("Name", buf, sizeof(buf));

Tuning the Theme

All visual parameters live in GlassTheme (ui_theme.h) and can be changed at runtime:

#include "ui_theme.h"

GlassTheme::g_blurIterations  = 6;      // more blur passes
GlassTheme::g_glassAlpha      = 0.40f;  // more opaque panels
GlassTheme::g_glassRounding   = 24.0f;  // rounder corners
GlassTheme::g_hoverScale      = 1.03f;  // stronger hover pop
GlassTheme::g_springStiffness = 200.0f; // snappier spring

Technologies

Component Details
Dear ImGui v1.92.1 — immediate-mode UI
Direct3D 11 Rendering, blur, and refraction shaders
Win32 Window, input, DPI, drag-and-drop
stb_image JPEG/PNG loading
C++17 Language standard

About

ImGUI based C++ interface with "Liquid Glass" like style with custom styles/elements.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages