Real-Time Glass Shader on Android with AGSL and Jetpack Compose
A designer explores creating a real-time glass shader effect on Android using AGSL (Android Graphics Shading Language) and Jetpack Compose, enabled by AI-assisted 'vibe-coding'. The interactive app features a draggable circular lens that distorts content behind it, simulating refraction and optical properties like Index of Refraction (IOR), Highlight Strength, Radius, Bevel Width, Thickness, and Shadow Intensity. The project uses a RuntimeShader applied to a graphicsLayer, with Compose UI sliders and drag gestures for real-time parameter adjustment. The shader simulates refraction, specular highlights, bevel effects, chromatic aberration, and frosted glass. The designer, not a professional developer, leveraged AI to translate shaders from Shadertoy.com and was inspired by Apple's Liquid Glass. The project is available on GitHub and demonstrated on YouTube.
Key facts
- Real-time glass shader on Android using AGSL and Jetpack Compose
- Interactive draggable lens with refraction and optical property controls
- Adjustable parameters: IOR, Highlight Strength, Radius, Bevel Width, Thickness, Shadow Intensity
- Uses RuntimeShader on a graphicsLayer in Jetpack Compose
- AI-assisted vibe-coding enabled the designer to create the shader
- Inspired by Apple's Liquid Glass effect
- Project available on GitHub: github.com/abduzeedo/SolidGlassShader/
- Demo on YouTube
Entities
Institutions
- Jetpack Compose
- Android
- AGSL
- Shadertoy.com
- Apple
- GitHub
- YouTube