| 1 |
import QtQuick 2.0 |
| 2 |
|
| 3 |
Item { |
| 4 |
width: 320 |
| 5 |
height: 480 |
| 6 |
|
| 7 |
Text { |
| 8 |
id: text |
| 9 |
anchors.centerIn: parent |
| 10 |
font.pixelSize: 80 |
| 11 |
text: "Shaderz!" |
| 12 |
visible: false |
| 13 |
|
| 14 |
Rectangle { |
| 15 |
width: 50 |
| 16 |
height: 50 |
| 17 |
color: "red" |
| 18 |
anchors.centerIn: parent |
| 19 |
transform: Rotation{ angle: 90 } |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
ShaderEffectSource { |
| 24 |
id: source1 |
| 25 |
sourceItem: text |
| 26 |
smooth: true |
| 27 |
} |
| 28 |
|
| 29 |
ShaderEffectSource { |
| 30 |
id: source2 |
| 31 |
sourceItem: text |
| 32 |
smooth: true |
| 33 |
} |
| 34 |
|
| 35 |
ShaderEffect{ |
| 36 |
width: parent.width |
| 37 |
height: parent.height / 2 |
| 38 |
|
| 39 |
property variant source: source1 |
| 40 |
|
| 41 |
fragmentShader: "qrc:shaders/gradient4.frag" |
| 42 |
} |
| 43 |
|
| 44 |
ShaderEffect { |
| 45 |
y: parent.height / 2 |
| 46 |
width: parent.width |
| 47 |
height: parent.height / 2 |
| 48 |
|
| 49 |
property variant source: source2 |
| 50 |
|
| 51 |
fragmentShader: "qrc:shaders/gradient3.frag" |
| 52 |
} |
| 53 |
} |
| 54 |
|