is it possible to make blur effect like this?:
s
is it possible to make blur effect like this?:
👀 2
s
You can check new blurring modifier, but it is available only for Android 12. It is currently not possible to create this for older versions of Android with Compose (at least without performance penalties and hacking).
s
bluring modifier as i understand blur content inside container, but i need blur content behind container
🙌 1
s
In any case, blur doesn't exist on Compose below Android 12 and probably won't. 🥴
s
so sad..
s
In fact, it has good reasons why this is so. It is impossible to maintain blur without switching the UI renderer to software mode, which is terrible for performance. Compose uses a fully HW accelerated canvas. If you would like to discuss this(or other questions) in your native language, you can join the
android_declarative
telegram channel. 🙂
👍 1
m
how about rendering a pseudo-blur gradient above the list? From the screen, it seems to have a fixed position ?
t
It is impossible to maintain blur without switching the UI renderer to software mode
Can you explain why?
s
pseudo-blur
explain please
s
@Tin Tran Very superficially. For Android 12, the blur feature is implemented in the graphics rendering pipeline (as a GPU shader). It is the fastest way as it has direct access to the UI textures, and GPUs are perfect for pixel manipulation. Speaking of older versions of Android. To implement blurring of the view, you first need to render a View to a bitmap (a complete software operation, which means that the CPU will be involved here, not the GPU). Then you had to process this bitmap using one of the blur functions (direct iteration and convolution of pixels, render script, or C++ code). And only then upload this bitmap into the GPU to display it on the screen.
😮 1
*but I don't know enough about graphical programming
t
Thanks. Obviously you know better then me lol
b
@Sergey Y. But a GPU can easily blur an image without right? No matter what kind of GPU you're using, a blurring effect is a very simple matrix operation. Why would it be so hard to do everything on the GPU?
s
Not sure I understand you. What do you mean? I never said that blurring is hard for GPU.
234 Views