aboutsummaryrefslogtreecommitdiffstats
path: root/examples
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
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')
-rw-r--r--examples/declarative/flickr/content/ImageDetails.qml6
-rw-r--r--examples/declarative/particles/allsmiles/smile.qml4
-rw-r--r--examples/declarative/particles/custom/blurparticles.qml8
-rw-r--r--examples/declarative/particles/custom/shader.qml4
-rw-r--r--examples/declarative/shadereffects/shader-demo.qml20
5 files changed, 21 insertions, 21 deletions
diff --git a/examples/declarative/flickr/content/ImageDetails.qml b/examples/declarative/flickr/content/ImageDetails.qml
index 456b348cd9..d45f8e80e9 100644
--- a/examples/declarative/flickr/content/ImageDetails.qml
+++ b/examples/declarative/flickr/content/ImageDetails.qml
@@ -195,7 +195,7 @@ Flipable {
bigImage.visible = true;
}
}
- ShaderEffectItem{
+ ShaderEffect{
id: noiseIn
anchors.fill: parent
property real t: 0
@@ -262,7 +262,7 @@ Flipable {
uniform highp float maxWidth;
uniform highp float maxHeight;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp mat4 qt_Matrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
@@ -286,7 +286,7 @@ Flipable {
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
- gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
+ gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
diff --git a/examples/declarative/particles/allsmiles/smile.qml b/examples/declarative/particles/allsmiles/smile.qml
index 6b122e7be5..3eb57617ec 100644
--- a/examples/declarative/particles/allsmiles/smile.qml
+++ b/examples/declarative/particles/allsmiles/smile.qml
@@ -79,7 +79,7 @@ Rectangle{
uniform highp float maxWidth;
uniform highp float maxHeight;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp mat4 qt_Matrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
@@ -105,7 +105,7 @@ Rectangle{
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
- gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
+ gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
diff --git a/examples/declarative/particles/custom/blurparticles.qml b/examples/declarative/particles/custom/blurparticles.qml
index 15da9ba9db..7974c6ab7c 100644
--- a/examples/declarative/particles/custom/blurparticles.qml
+++ b/examples/declarative/particles/custom/blurparticles.qml
@@ -76,7 +76,7 @@ Rectangle{
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp mat4 qt_Matrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
@@ -101,7 +101,7 @@ Rectangle{
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
- gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
+ gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 10., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
@@ -113,13 +113,13 @@ Rectangle{
property variant source: theSource
property variant blurred: 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)
diff --git a/examples/declarative/particles/custom/shader.qml b/examples/declarative/particles/custom/shader.qml
index d83e7864c4..329eaf226b 100644
--- a/examples/declarative/particles/custom/shader.qml
+++ b/examples/declarative/particles/custom/shader.qml
@@ -35,7 +35,7 @@ ParticleSystem{
attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
attribute highp float r;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp mat4 qt_Matrix;
uniform highp float timestamp;
uniform lowp float qt_Opacity;
@@ -60,7 +60,7 @@ ParticleSystem{
+ vVec.xy * t * vData.y // apply speed vector..
+ 0.5 * vVec.zw * pow(t * vData.y, 2.);
- gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
+ gl_Position = qt_Matrix * vec4(pos.x, pos.y, 0, 1);
highp float fadeIn = min(t * 20., 1.);
highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
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