1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
import QtQuick 2.0
Rectangle {
width: 320
height: 480
color: "skyblue"
ShaderEffect {
anchors.centerIn: parent
width: 16 * 16
height: 24 * 16
property variant source: ShaderEffectSource {
sourceItem: Rectangle {
width: 22 * 20
height: 16 * 20
color: "#EF2B2D"
Rectangle {
y: 6 * 20
height: 4 * 20
width: 22 * 20
color: "white"
}
Rectangle {
x: 6 * 20
width: 4 * 20
height: 16 * 20
color: "white"
}
Rectangle {
y: 7 * 20
height: 2 * 20
width: 22 * 20
color: "#002868"
}
Rectangle {
x: 7 * 20
width: 2 * 20
height: 16 * 20
color: "#002868"
}
}
smooth: true
}
vertexShader: "
uniform highp mat4 qt_Matrix;
attribute highp vec4 qt_Vertex;
attribute highp vec2 qt_MultiTexCoord0;
varying highp vec2 qt_TexCoord0;
void main() {
highp vec4 pos = qt_Vertex;
pos.x += sin(qt_Vertex.y * 0.02) * 20.;
pos.y += sin(qt_Vertex.x * 0.02) * 20.;
gl_Position = qt_Matrix * pos;
qt_TexCoord0 = qt_MultiTexCoord0;
}"
mesh: GridMesh {
property int r: 8
resolution: Qt.size(r, r)
}
}
}
|