A deep dive into implementing motion blur for a spinning Fortune Wheel in Jetpack Compose. Two approaches are covered: a physically accurate rotational blur using AGSL RuntimeShader (API 33+) that samples the rendered layer at multiple rotated positions, and a ghost-layer fallback for older devices that renders the wheel multiple times at slightly offset rotation angles with decreasing opacity. Velocity is measured frame-by-frame via snapshotFlow to derive a blurMultiplier that smoothly fades the effect in and out. Performance considerations for both paths are discussed, including shader compilation costs and ghost-layer GPU overhead.
Table of contents
Drawing the Wheel: The FoundationMeasuring VelocityThe Shader Solution (API 33+)Get Piotr Prus’s stories in your inboxThe Ghost Layer Fallback (API 32 and Below)Sort: