If I wanted to do some sort of Shader where the Sh...
# compose-desktop
If I wanted to do some sort of Shader where the Shader code is dependent on the previous shader result (e.g. in a simulation, or some motion blur). How would I do this? Can I render the shader result in a temporary buffer somehow and load that into the next render frame into a
Yes you can link shaders using uniform shader types.
Thanks, I am aware that is possible. But unless I am misunderstanding it this is subtly different then what I mean. I want a shader that has as a uniform input the shader result from the last frame(s). This way you can do things like motion blur.
Ah, no there’s no easy way to do this
You’d have to render into a bitmap yourself and feed that back to your shader
Getting shader output off of the GPU path and into software-managed bitmaps is not going to be good for performance
If possible, I would suggest using another shader that is a “step behind” your primary one, and use that as a child shader to feed that previous frame
Technically they don’t have to be software managed bitmaps
Not sure what Skiko provides but that’s what volatile images are in Java2D, and Android has hardware buffers
I think I need to understand the pipeline better first before I can do these things. But thanks for your help!