aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/shadereffects
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-07-27 11:06:00 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-28 16:44:53 +0200
commit8cc1663ea20725214133d51920c37145a949f80f (patch)
tree504331aa78f7aea38ccffa5024b48ac4a1f61131 /examples/declarative/shadereffects
parent99309c5fcf0821ed4da69796b1a315cff7f48250 (diff)
Renamed ShaderEffectItem to ShaderEffect and some API changes.
The ShaderEffectItem was renamed to ShaderEffect to be consistent with other QML element names. The GLSL uniform variable qt_ModelViewProjectionMatrix was renamed to qt_Matrix which is easier to type and remember. The GridMesh element was removed. The mesh resolution is now specified simply with a QSize. To make the transition easier, the old API will continue to work for some time, but will output warnings if used. Eventually, I will remove the old API completely. Change-Id: Iec4f2aa624a2c76a7db6750c58f73dbcb316ab6a Reviewed-on: http://codereview.qt.nokia.com/2270 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'examples/declarative/shadereffects')
-rw-r--r--examples/declarative/shadereffects/shader-demo.qml20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/declarative/shadereffects/shader-demo.qml b/examples/declarative/shadereffects/shader-demo.qml
index 3f0f704849..66099d8b5c 100644
--- a/examples/declarative/shadereffects/shader-demo.qml
+++ b/examples/declarative/shadereffects/shader-demo.qml
@@ -102,7 +102,7 @@ Image {
}
}
}
- ShaderEffectItem {
+ ShaderEffect {
width: 180
height: 180
property variant source: theSource
@@ -128,19 +128,19 @@ Image {
height: 40
}
}
- ShaderEffectItem {
+ ShaderEffect {
width: 180
height: 180
property variant source: theSource
property variant shadow: ShaderEffectSource {
smooth: true
- sourceItem: ShaderEffectItem {
+ sourceItem: ShaderEffect {
width: theItem.width
height: theItem.height
property variant delta: Qt.size(0.0, 1.0 / height)
property variant source: ShaderEffectSource {
smooth: true
- sourceItem: ShaderEffectItem {
+ sourceItem: ShaderEffect {
width: theItem.width
height: theItem.height
property variant delta: Qt.size(1.0 / width, 0.0)
@@ -196,7 +196,7 @@ Image {
height: 40
}
}
- ShaderEffectItem {
+ ShaderEffect {
width: 180
height: 180
property variant source: theSource
@@ -217,7 +217,7 @@ Image {
gl_FragColor.w = clamp(dot(sqrt(gx * gx + gy * gy), vec4(1.)), 0., 1.) * qt_Opacity;
}"
}
- ShaderEffectItem {
+ ShaderEffect {
width: 180
height: 180
property variant source: theSource
@@ -241,10 +241,10 @@ Image {
height: 40
}
}
- ShaderEffectItem {
+ ShaderEffect {
width: 180
height: 180
- mesh: GridMesh { resolution: Qt.size(10, 10) }
+ mesh: Qt.size(10, 10)
property variant source: theSource
property real bend: 0
property real minimize: 0
@@ -265,7 +265,7 @@ Image {
PauseAnimation { duration: 1300 }
}
vertexShader: "
- uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp mat4 qt_Matrix;
uniform highp float bend;
uniform highp float minimize;
uniform highp float side;
@@ -281,7 +281,7 @@ Image {
highp float t = pos.y / height;
t = (3. - 2. * t) * t * t;
pos.x = mix(qt_Vertex.x, side * width, t * bend);
- gl_Position = qt_ModelViewProjectionMatrix * pos;
+ gl_Position = qt_Matrix * pos;
}"
Slider {
id: genieSlider