Closing the functionality gap with Android T / Compose on Android for shader-backed render effects that can run on any node in Compose hierarchy.
This Skiko issue has a bit more technical detail. Once the PR linked in it is merged, and Compose Desktop picks up that version of Skiko, it will be made available for all supported desktop platforms.
This demo is a simpler one, applying a static shader render effect.
This demo is a bit more complex (see attached video). It shows a dynamic shader that "combines" two child shaders, one that blurs the left part of the button, and another that colorizes the right part of the button to be red-tinted. The slider under the button is wired to change the horizontal boundary between the two child shaders, showing how to combine
remember { mutableStateOf }
together with the newly added binding to the underlying
SkRuntimeShaderBuilder::uniform
. When the mouse is moved over the button, the amount of blur and red tinting goes down, showing how to combine
derivedStateOf
with the same
SkRuntimeShaderBuilder::uniform
.
Apart from the more demo-ey nature of this video, this should enable not only
the things done in Android (stretch overscroll, content blur, fancy ripples), but also things like image editing with quick live previews of effects, introduction tutorials that blur / highlight relevant parts of the UI, and many more.