import QtQuick 2.0 Rectangle { width: 800 height: 600 MouseArea { anchors.fill: parent onClicked: { Qt.quit(); } } Flow { anchors.fill: parent Repeater { model: 180 ShaderEffect { width: 50; height: 50 property variant source: ShaderEffectSource { width: 100; height: 100 sourceItem: Item { width: 100; height: 100 Rectangle { opacity: 1.0; x: 5; y: 5; width: 60; height: 60; color: "red" } Rectangle { opacity: 0.75; x: 20; y: 20; width: 60; height: 60; color: "orange" } Rectangle { opacity: 0.5; x: 35; y: 35; width: 60; height: 60; color: "yellow" } } } property real amplitude: 0.04 property real frequency: 20 property real time: 0 NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 } //! [fragment] fragmentShader: "uniform lowp float qt_Opacity;" + "uniform highp float amplitude;" + "uniform highp float frequency;" + "uniform highp float time;" + "uniform sampler2D source;" + "varying highp vec2 qt_TexCoord0;" + "void main() {" + " highp vec2 p = sin(time + frequency * qt_TexCoord0);" + " gl_FragColor = texture2D(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x)) * qt_Opacity;" + "}" //! [fragment] } } } }