Demystifying Pixel Shaders (AGSL)
summary
Shows how to write AGSL pixel shaders that run compiled on the GPU and integrate into Jetpack Compose via a runtime shader → brush created in drawWithCache and set with setFloatUniform (example: float2 uniform size). Covers distance functions (circle, box), smoothstep and mix to anti‑alias edges, animations driven by a time uniform (example uses 24 rectangles in a rotating animation), a 31‑line shader sample, live reload in Android Studio, Android 13 requirement, and a try/catch pattern for shader compilation failures.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:48Pixel shaders and uses
- 3:20AGSL and Android role
- 9:05Integrating shaders in Compose
- 12:20Drawing shapes with shaders
- 18:23Combining shapes in shaders
- 23:25Animated effects with shaders
- 27:04Optimizing shader code
- 31:09Debugging shaders in Android Studio
- 33:23Backward compatibility
- 35:30Advanced shader experiments
- 37:18Summary
related talks
46mDemystifying Pixel Shaders (AGSL)
34mUnlocking the Power of Shaders in Android with AGSL and Jetpack Compose
43mPixel with Superpowers: Modern Android UI with AGSL Shaders
16mAndroid Graphics
36mCreative Coding with Compose
36mPractical implementations of powerful UI expressions using Jetpack Compose
38mGPU. The journey from code to pixel
42mAndroid Graphics: the Path to [UI] Riches
