summaryrefslogtreecommitdiff
path: root/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml')
-rw-r--r--examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml41
1 files changed, 0 insertions, 41 deletions
diff --git a/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml b/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml
index a4b5c3f..af44cbe 100644
--- a/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml
+++ b/examples/ivicore/qface-tutorial/instrument-cluster/Dial.qml
@@ -75,45 +75,4 @@ Item {
rotation: min + (max - min) * root.value
source: Qt.resolvedUrl(root.dialCursor)
}
-
- ShaderEffect {
- anchors.fill: meter
- property var pattern: Image {
- source: Qt.resolvedUrl("images/dial_pattern.png")
- }
- property var fill: Image {
- source: Qt.resolvedUrl(root.fillImage)
- }
- property real value: root.value
-
- fragmentShader: "
-#define M_PI 3.141592653589793
-#define INNER " + root.circleRadius + "
-
-varying highp vec2 qt_TexCoord0;
-uniform lowp float qt_Opacity;
-uniform sampler2D pattern;
-uniform sampler2D fill;
-uniform lowp float value;
-
-void main() {
- lowp vec4 pattern = texture2D(pattern, qt_TexCoord0);
- lowp vec4 fill = texture2D(fill, qt_TexCoord0);
-
- lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y);
- lowp float d = length(pos);
- lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI);
- lowp float v = 0.66 * value - 0.33;
-
- // Flare pattern
- lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle));
- // Gradient fill color
- color += mix(fill, vec4(0.0), step(v, angle));
- // Punch out the center hole
- color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d));
- // Fade out below 0
- gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle));
-}
- "
- }
}