Drawing QQuickRectangle like Blend.mode="addition" instead of normal alpha blending
Sparr last edited by
I want 3+ overlapping QML
Rectangleitems to add their pixel color values instead of doing alpha blending (also doing alpha would be nice, if that can be preserved).
One idea I had was to send each one to a
ShaderEffectSource, then maintain a list of the
Blendthe first one onto the background, then
Blendthe second one onto that, and so on, only displaying the final result. I wasn't able to get scaling and visibility and transparency to work for this.
Another idea was to make an extra white
Rectanglefor each original
Rectangle, and put all the white ones at the back of the scene, and adjust their alpha in time with their linked original. This greatly increased the gamut of possibilities, but still didn't have the desired effect where bright colors overlap.
My next idea is going to be to dive all the way down into
qtdeclarative/src/*/scenegraphand hack away in hopes of finding a way to do this on one or more platforms, and then exposing that upwards as an abstracted option somewhere.
My hope is that someone here might be able to suggest a less drastic approach.