summaryrefslogtreecommitdiffstats
path: root/tutorials
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2012-02-28 18:18:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-29 09:20:32 +0100
commit2cf3bb47c868d018c5afb9c30d93cf73ef906c6e (patch)
tree7d48c833aef19af109aa2974813b2717558e612a /tutorials
parente8daecd6a93557233c6f2a7e5d90b159d9cac5dd (diff)
Fix unit tests + builds on windows.
Some of these unit test problems were not just windows, but the issues manifested most badly on windows. Create a mock view object that is similar to the real QGLView, but more specially designed for unit tests, and setup with sensible defaults. Use this for the main failing unit tests. This fixed some of the issues, but there is also a problem with window geometry on windows, and it is not going to be fixed as part of this change. See https://bugreports.qt-project.org/browse/QTBUG-24539 for more. Also fix a few other minor breaks including tutorials not being packaged properly, and places where literal strings were used. Change-Id: Id4f78823f851c822709208c3793f35a0dd472e5e Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
Diffstat (limited to 'tutorials')
-rw-r--r--tutorials/quick3d/quick3d.pro2
-rw-r--r--tutorials/quick3d/shadertut/main.cpp43
-rw-r--r--tutorials/quick3d/shadertut/qml/TutorialTeapot.qml65
-rw-r--r--tutorials/quick3d/shadertut/qml/meshes/teapot.bez340
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial-1-textures.qml105
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial-2-vertex-shader.qml117
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial-3-transformed-coordinates.qml126
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial-lighting.qml85
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial-varying.qml77
-rw-r--r--tutorials/quick3d/shadertut/qml/shader-tutorial.qml83
-rw-r--r--tutorials/quick3d/shadertut/shadertut.pro41
11 files changed, 1083 insertions, 1 deletions
diff --git a/tutorials/quick3d/quick3d.pro b/tutorials/quick3d/quick3d.pro
index 85436d8c2..b0ba92d11 100644
--- a/tutorials/quick3d/quick3d.pro
+++ b/tutorials/quick3d/quick3d.pro
@@ -1,2 +1,2 @@
TEMPLATE = subdirs
-SUBDIRS += shaders teapot_bounce_qml teapot_qml
+SUBDIRS += shadertut teapot_bounce_qml teapot_qml
diff --git a/tutorials/quick3d/shadertut/main.cpp b/tutorials/quick3d/shadertut/main.cpp
new file mode 100644
index 000000000..cfef8c94f
--- /dev/null
+++ b/tutorials/quick3d/shadertut/main.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../qmlres.h"
+
+QUICK3D_EXAMPLE_MAIN("qml/shader-tutorial.qml")
diff --git a/tutorials/quick3d/shadertut/qml/TutorialTeapot.qml b/tutorials/quick3d/shadertut/qml/TutorialTeapot.qml
new file mode 100644
index 000000000..246aa2675
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/TutorialTeapot.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+
+Item3D {
+ mesh: Mesh { source: "meshes/teapot.bez" }
+ effect: Effect {}
+ property int xRotation : 0.0
+ property int yRotation : 0.0
+ property int zRotation : 0.0
+
+ transform: [
+ Rotation3D {
+ angle: xRotation
+ axis: Qt.vector3d(1, 0, 0)
+ },
+ Rotation3D {
+ angle: yRotation
+ axis: Qt.vector3d(0, 1, 0)
+ },
+ Rotation3D {
+ angle: zRotation
+ axis: Qt.vector3d(0, 0, 1)
+ }
+ ]
+}
diff --git a/tutorials/quick3d/shadertut/qml/meshes/teapot.bez b/tutorials/quick3d/shadertut/qml/meshes/teapot.bez
new file mode 100644
index 000000000..02b2ac447
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/meshes/teapot.bez
@@ -0,0 +1,340 @@
+32
+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
+4,17,18,19,8,20,21,22,12,23,24,25,16,26,27,28
+19,29,30,31,22,32,33,34,25,35,36,37,28,38,39,40
+31,41,42,1,34,43,44,5,37,45,46,9,40,47,48,13
+13,14,15,16,49,50,51,52,53,54,55,56,57,58,59,60
+16,26,27,28,52,61,62,63,56,64,65,66,60,67,68,69
+28,38,39,40,63,70,71,72,66,73,74,75,69,76,77,78
+40,47,48,13,72,79,80,49,75,81,82,53,78,83,84,57
+57,58,59,60,85,86,87,88,89,90,91,92,93,94,95,96
+60,67,68,69,88,97,98,99,92,100,101,102,96,103,104,105
+69,76,77,78,99,106,107,108,102,109,110,111,105,112,113,114
+78,83,84,57,108,115,116,85,111,117,118,89,114,119,120,93
+121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136
+124,137,138,121,128,139,140,125,132,141,142,129,136,143,144,133
+133,134,135,136,145,146,147,148,149,150,151,152,69,153,154,155
+136,143,144,133,148,156,157,145,152,158,159,149,155,160,161,69
+162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177
+165,178,179,162,169,180,181,166,173,182,183,170,177,184,185,174
+174,175,176,177,186,187,188,189,190,191,192,193,194,195,196,197
+177,184,185,174,189,198,199,186,193,200,201,190,197,202,203,194
+204,204,204,204,207,208,209,210,211,211,211,211,212,213,214,215,4
+204,204,204,204,210,217,218,219,211,211,211,211,215,220,221,222,4
+204,204,204,204,219,224,225,226,211,211,211,211,222,227,228,229,4
+204,204,204,204,226,230,231,207,211,211,211,211,229,232,233,212,4
+212,213,214,215,234,235,236,237,238,239,240,241,242,243,244,245
+215,220,221,222,237,246,247,248,241,249,250,251,245,252,253,254
+222,227,228,229,248,255,256,257,251,258,259,260,254,261,262,263
+229,232,233,212,257,264,265,234,260,266,267,238,263,268,269,242
+270,270,270,270,279,280,281,282,275,276,277,278,271,272,273,274,4
+270,270,270,270,282,289,290,291,278,286,287,288,274,283,284,285,4
+270,270,270,270,291,298,299,300,288,295,296,297,285,292,293,294,4
+270,270,270,270,300,305,306,279,297,303,304,275,294,301,302,271,4
+306
+0.700000,0.450000,-0.000000
+0.700000,0.450000,0.392000
+0.392000,0.450000,0.700000
+0.000000,0.450000,0.700000
+0.668750,0.515625,-0.000000
+0.668750,0.515625,0.374500
+0.374500,0.515625,0.668750
+0.000000,0.515625,0.668750
+0.718750,0.515625,-0.000000
+0.718750,0.515625,0.402500
+0.402500,0.515625,0.718750
+0.000000,0.515625,0.718750
+0.750000,0.450000,-0.000000
+0.750000,0.450000,0.420000
+0.420000,0.450000,0.750000
+0.000000,0.450000,0.750000
+-0.392000,0.450000,0.700000
+-0.700000,0.450000,0.392000
+-0.700000,0.450000,-0.000000
+-0.374500,0.515625,0.668750
+-0.668750,0.515625,0.374500
+-0.668750,0.515625,-0.000000
+-0.402500,0.515625,0.718750
+-0.718750,0.515625,0.402500
+-0.718750,0.515625,-0.000000
+-0.420000,0.450000,0.750000
+-0.750000,0.450000,0.420000
+-0.750000,0.450000,-0.000000
+-0.700000,0.450000,-0.392000
+-0.392000,0.450000,-0.700000
+0.000000,0.450000,-0.700000
+-0.668750,0.515625,-0.374500
+-0.374500,0.515625,-0.668750
+0.000000,0.515625,-0.668750
+-0.718750,0.515625,-0.402500
+-0.402500,0.515625,-0.718750
+0.000000,0.515625,-0.718750
+-0.750000,0.450000,-0.420000
+-0.420000,0.450000,-0.750000
+0.000000,0.450000,-0.750000
+0.392000,0.450000,-0.700000
+0.700000,0.450000,-0.392000
+0.374500,0.515625,-0.668750
+0.668750,0.515625,-0.374500
+0.402500,0.515625,-0.718750
+0.718750,0.515625,-0.402500
+0.420000,0.450000,-0.750000
+0.750000,0.450000,-0.420000
+0.875000,0.187500,-0.000000
+0.875000,0.187500,0.490000
+0.490000,0.187500,0.875000
+0.000000,0.187500,0.875000
+1.000000,-0.075000,-0.000000
+1.000000,-0.075000,0.560000
+0.560000,-0.075000,1.000000
+0.000000,-0.075000,1.000000
+1.000000,-0.300000,-0.000000
+1.000000,-0.300000,0.560000
+0.560000,-0.300000,1.000000
+0.000000,-0.300000,1.000000
+-0.490000,0.187500,0.875000
+-0.875000,0.187500,0.490000
+-0.875000,0.187500,-0.000000
+-0.560000,-0.075000,1.000000
+-1.000000,-0.075000,0.560000
+-1.000000,-0.075000,-0.000000
+-0.560000,-0.300000,1.000000
+-1.000000,-0.300000,0.560000
+-1.000000,-0.300000,-0.000000
+-0.875000,0.187500,-0.490000
+-0.490000,0.187500,-0.875000
+0.000000,0.187500,-0.875000
+-1.000000,-0.075000,-0.560000
+-0.560000,-0.075000,-1.000000
+0.000000,-0.075000,-1.000000
+-1.000000,-0.300000,-0.560000
+-0.560000,-0.300000,-1.000000
+0.000000,-0.300000,-1.000000
+0.490000,0.187500,-0.875000
+0.875000,0.187500,-0.490000
+0.560000,-0.075000,-1.000000
+1.000000,-0.075000,-0.560000
+0.560000,-0.300000,-1.000000
+1.000000,-0.300000,-0.560000
+1.000000,-0.525000,-0.000000
+1.000000,-0.525000,0.560000
+0.560000,-0.525000,1.000000
+0.000000,-0.525000,1.000000
+0.750000,-0.637500,-0.000000
+0.750000,-0.637500,0.420000
+0.420000,-0.637500,0.750000
+0.000000,-0.637500,0.750000
+0.750000,-0.675000,-0.000000
+0.750000,-0.675000,0.420000
+0.420000,-0.675000,0.750000
+0.000000,-0.675000,0.750000
+-0.560000,-0.525000,1.000000
+-1.000000,-0.525000,0.560000
+-1.000000,-0.525000,-0.000000
+-0.420000,-0.637500,0.750000
+-0.750000,-0.637500,0.420000
+-0.750000,-0.637500,-0.000000
+-0.420000,-0.675000,0.750000
+-0.750000,-0.675000,0.420000
+-0.750000,-0.675000,-0.000000
+-1.000000,-0.525000,-0.560000
+-0.560000,-0.525000,-1.000000
+0.000000,-0.525000,-1.000000
+-0.750000,-0.637500,-0.420000
+-0.420000,-0.637500,-0.750000
+0.000000,-0.637500,-0.750000
+-0.750000,-0.675000,-0.420000
+-0.420000,-0.675000,-0.750000
+0.000000,-0.675000,-0.750000
+0.560000,-0.525000,-1.000000
+1.000000,-0.525000,-0.560000
+0.420000,-0.637500,-0.750000
+0.750000,-0.637500,-0.420000
+0.420000,-0.675000,-0.750000
+0.750000,-0.675000,-0.420000
+-0.800000,0.262500,-0.000000
+-0.800000,0.262500,0.150000
+-0.750000,0.375000,0.150000
+-0.750000,0.375000,-0.000000
+-1.150000,0.262500,-0.000000
+-1.150000,0.262500,0.150000
+-1.250000,0.375000,0.150000
+-1.250000,0.375000,-0.000000
+-1.350000,0.262500,-0.000000
+-1.350000,0.262500,0.150000
+-1.500000,0.375000,0.150000
+-1.500000,0.375000,-0.000000
+-1.350000,0.150000,-0.000000
+-1.350000,0.150000,0.150000
+-1.500000,0.150000,0.150000
+-1.500000,0.150000,-0.000000
+-0.750000,0.375000,-0.150000
+-0.800000,0.262500,-0.150000
+-1.250000,0.375000,-0.150000
+-1.150000,0.262500,-0.150000
+-1.500000,0.375000,-0.150000
+-1.350000,0.262500,-0.150000
+-1.500000,0.150000,-0.150000
+-1.350000,0.150000,-0.150000
+-1.350000,0.037500,-0.000000
+-1.350000,0.037500,0.150000
+-1.500000,-0.075000,0.150000
+-1.500000,-0.075000,-0.000000
+-1.250000,-0.187500,-0.000000
+-1.250000,-0.187500,0.150000
+-1.325000,-0.281250,0.150000
+-1.325000,-0.281250,-0.000000
+-1.000000,-0.300000,0.150000
+-0.950000,-0.450000,0.150000
+-0.950000,-0.450000,-0.000000
+-1.500000,-0.075000,-0.150000
+-1.350000,0.037500,-0.150000
+-1.325000,-0.281250,-0.150000
+-1.250000,-0.187500,-0.150000
+-0.950000,-0.450000,-0.150000
+-1.000000,-0.300000,-0.150000
+0.850000,-0.037500,-0.000000
+0.850000,-0.037500,0.330000
+0.850000,-0.450000,0.330000
+0.850000,-0.450000,-0.000000
+1.300000,-0.037500,-0.000000
+1.300000,-0.037500,0.330000
+1.550000,-0.337500,0.330000
+1.550000,-0.337500,-0.000000
+1.150000,0.300000,-0.000000
+1.150000,0.300000,0.125000
+1.200000,0.262500,0.125000
+1.200000,0.262500,-0.000000
+1.350000,0.450000,-0.000000
+1.350000,0.450000,0.125000
+1.650000,0.450000,0.125000
+1.650000,0.450000,-0.000000
+0.850000,-0.450000,-0.330000
+0.850000,-0.037500,-0.330000
+1.550000,-0.337500,-0.330000
+1.300000,-0.037500,-0.330000
+1.200000,0.262500,-0.125000
+1.150000,0.300000,-0.125000
+1.650000,0.450000,-0.125000
+1.350000,0.450000,-0.125000
+1.400000,0.487500,-0.000000
+1.400000,0.487500,0.125000
+1.762500,0.496875,0.125000
+1.762500,0.496875,-0.000000
+1.450000,0.487500,-0.000000
+1.450000,0.487500,0.075000
+1.725000,0.506250,0.075000
+1.725000,0.506250,-0.000000
+1.400000,0.450000,-0.000000
+1.400000,0.450000,0.075000
+1.600000,0.450000,0.075000
+1.600000,0.450000,-0.000000
+1.762500,0.496875,-0.125000
+1.400000,0.487500,-0.125000
+1.725000,0.506250,-0.075000
+1.450000,0.487500,-0.075000
+1.600000,0.450000,-0.075000
+1.400000,0.450000,-0.075000
+0.000000,0.825000,-0.000000
+0.000000,0.825000,0.001000
+0.001000,0.825000,-0.000000
+0.400000,0.825000,-0.000000
+0.400000,0.825000,0.225000
+0.225000,0.825000,0.400000
+0.000000,0.825000,0.400000
+0.000000,0.675000,-0.000000
+0.100000,0.600000,-0.000000
+0.100000,0.600000,0.056000
+0.056000,0.600000,0.100000
+0.000000,0.600000,0.100000
+-0.001000,0.825000,-0.000000
+-0.225000,0.825000,0.400000
+-0.400000,0.825000,0.225000
+-0.400000,0.825000,-0.000000
+-0.056000,0.600000,0.100000
+-0.100000,0.600000,0.056000
+-0.100000,0.600000,-0.000000
+0.000000,0.825000,-0.001000
+-0.400000,0.825000,-0.225000
+-0.225000,0.825000,-0.400000
+0.000000,0.825000,-0.400000
+-0.100000,0.600000,-0.056000
+-0.056000,0.600000,-0.100000
+0.000000,0.600000,-0.100000
+0.225000,0.825000,-0.400000
+0.400000,0.825000,-0.225000
+0.056000,0.600000,-0.100000
+0.100000,0.600000,-0.056000
+0.200000,0.525000,-0.000000
+0.200000,0.525000,0.112000
+0.112000,0.525000,0.200000
+0.000000,0.525000,0.200000
+0.650000,0.525000,-0.000000
+0.650000,0.525000,0.364000
+0.364000,0.525000,0.650000
+0.000000,0.525000,0.650000
+0.650000,0.450000,-0.000000
+0.650000,0.450000,0.364000
+0.364000,0.450000,0.650000
+0.000000,0.450000,0.650000
+-0.112000,0.525000,0.200000
+-0.200000,0.525000,0.112000
+-0.200000,0.525000,-0.000000
+-0.364000,0.525000,0.650000
+-0.650000,0.525000,0.364000
+-0.650000,0.525000,-0.000000
+-0.364000,0.450000,0.650000
+-0.650000,0.450000,0.364000
+-0.650000,0.450000,-0.000000
+-0.200000,0.525000,-0.112000
+-0.112000,0.525000,-0.200000
+0.000000,0.525000,-0.200000
+-0.650000,0.525000,-0.364000
+-0.364000,0.525000,-0.650000
+0.000000,0.525000,-0.650000
+-0.650000,0.450000,-0.364000
+-0.364000,0.450000,-0.650000
+0.000000,0.450000,-0.650000
+0.112000,0.525000,-0.200000
+0.200000,0.525000,-0.112000
+0.364000,0.525000,-0.650000
+0.650000,0.525000,-0.364000
+0.364000,0.450000,-0.650000
+0.650000,0.450000,-0.364000
+0.000000,-0.750000,-0.000000
+0.750000,-0.675000,-0.000000
+0.750000,-0.675000,-0.420000
+0.420000,-0.675000,-0.750000
+0.000000,-0.675000,-0.750000
+0.750000,-0.712500,-0.000000
+0.750000,-0.712500,-0.420000
+0.420000,-0.712500,-0.750000
+0.000000,-0.712500,-0.750000
+0.712500,-0.750000,-0.000000
+0.712500,-0.750000,-0.399000
+0.399000,-0.750000,-0.712500
+0.000000,-0.750000,-0.712500
+-0.420000,-0.675000,-0.750000
+-0.750000,-0.675000,-0.420000
+-0.750000,-0.675000,-0.000000
+-0.420000,-0.712500,-0.750000
+-0.750000,-0.712500,-0.420000
+-0.750000,-0.712500,-0.000000
+-0.399000,-0.750000,-0.712500
+-0.712500,-0.750000,-0.399000
+-0.712500,-0.750000,-0.000000
+-0.750000,-0.675000,0.420000
+-0.420000,-0.675000,0.750000
+0.000000,-0.675000,0.750000
+-0.750000,-0.712500,0.420000
+-0.420000,-0.712500,0.750000
+0.000000,-0.712500,0.750000
+-0.712500,-0.750000,0.399000
+-0.399000,-0.750000,0.712500
+0.000000,-0.750000,0.712500
+0.420000,-0.675000,0.750000
+0.750000,-0.675000,0.420000
+0.420000,-0.712500,0.750000
+0.750000,-0.712500,0.420000
+0.399000,-0.750000,0.712500
+0.712500,-0.750000,0.399000
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial-1-textures.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial-1-textures.qml
new file mode 100644
index 000000000..2be310ef1
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial-1-textures.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+
+Viewport {
+ width: 640; height: 480
+
+ TutorialTeapot {
+ effect: program
+ }
+
+ ShaderProgram {
+ id: program
+ texture: "textures/qtlogo.png"
+ property real textureOffsetX : 1.0
+ NumberAnimation on textureOffsetX
+ {
+ running: true; loops: Animation.Infinite
+ from: 0.0; to: 1.0;
+ duration: 1000
+ }
+
+ property string texture2: "textures/basket.jpg"
+ property real interpolationFactor : 1.0
+ SequentialAnimation on interpolationFactor
+ {
+ running: true; loops: Animation.Infinite
+ NumberAnimation { from: 0.0; to: 1.0; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ NumberAnimation { from: 1.0; to: 0.0; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform mediump mat4 qt_ModelViewProjectionMatrix;
+
+ attribute highp vec4 qt_MultiTexCoord0;
+ uniform mediump float textureOffsetX;
+ varying mediump vec4 texCoord;
+
+ void main(void)
+ {
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ texCoord.st = vec2(-qt_MultiTexCoord0.s - textureOffsetX,
+ -qt_MultiTexCoord0.t);
+ texCoord.pq = vec2(-qt_MultiTexCoord0.s + textureOffsetX,
+ -qt_MultiTexCoord0.t);
+ }
+ "
+ fragmentShader: "
+ varying highp vec4 texCoord;
+ uniform sampler2D qt_Texture0;
+ uniform sampler2D texture2;
+ uniform mediump float interpolationFactor;
+
+ void main(void)
+ {
+ mediump vec4 texture1Color = texture2D(qt_Texture0, texCoord.st);
+ mediump vec4 texture2Color = texture2D(texture2, texCoord.pq);
+ mediump vec4 textureColor = mix(texture1Color, texture2Color, interpolationFactor);
+ gl_FragColor = textureColor;
+ }
+ "
+ }
+}
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial-2-vertex-shader.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial-2-vertex-shader.qml
new file mode 100644
index 000000000..49137ea6f
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial-2-vertex-shader.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+
+Viewport {
+ width: 640; height: 480
+
+ TutorialTeapot {
+ id: teapot
+ effect: program
+ xRotation: 30
+ }
+
+ ShaderProgram {
+ id: program
+ texture: "textures/qtlogo.png"
+
+ property real textureOffsetX : 0.0
+ property real squashFactor : 0.0
+ NumberAnimation on textureOffsetX
+ {
+ running: true; loops: Animation.Infinite
+ from: 0.0; to: 1.0;
+ duration: 1000
+ }
+
+ SequentialAnimation on squashFactor
+ {
+ running: true; loops: Animation.Infinite
+ NumberAnimation {
+ from: 0.0; to: 1.0; duration: 1000
+ easing.type: "InQuad"
+ }
+ PauseAnimation {
+ duration: 250
+ }
+ NumberAnimation {
+ from: 1.0; to: 0.0; duration: 1000
+ easing.type: "OutQuad"
+ }
+ }
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform mediump mat4 qt_ModelViewProjectionMatrix;
+
+ attribute highp vec4 qt_MultiTexCoord0;
+ varying highp vec4 texCoord;
+ uniform mediump float textureOffsetX;
+ uniform mediump float squashFactor;
+
+ void main(void)
+ {
+ const float modelSize = 2.0;
+ const float modelBottom = -1.0;
+ float newY = max(qt_Vertex.y - squashFactor * modelSize,
+ qt_Vertex.y * 0.01 + modelBottom);
+ gl_Position = qt_ModelViewProjectionMatrix *
+ vec4(qt_Vertex.x, newY, qt_Vertex.zw);
+
+ texCoord = vec4(-qt_MultiTexCoord0.s
+ - textureOffsetX,
+ -qt_MultiTexCoord0.t,
+ qt_MultiTexCoord0.pq);
+ }
+ "
+ fragmentShader: "
+ varying highp vec4 texCoord;
+ uniform sampler2D qt_Texture0;
+
+ void main(void)
+ {
+ mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
+ gl_FragColor = textureColor;
+ }
+ "
+ }
+}
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial-3-transformed-coordinates.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial-3-transformed-coordinates.qml
new file mode 100644
index 000000000..efe4aabb2
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial-3-transformed-coordinates.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+
+Viewport {
+ width: 640; height: 480
+
+
+ Item3D {
+ z: -8.0
+ transform: [
+ Rotation3D {
+ NumberAnimation on angle {
+ running: true; loops: Animation.Infinite
+ from: 0; to: 360; duration: 5000
+ }
+ axis: Qt.vector3d(0, 0, 1.0)
+ }
+ ]
+
+ TutorialTeapot {id: teapot1; effect: program; y:2.0; x:0.0}
+ TutorialTeapot {id: teapot2; effect: program; y:-1.0; x:-1.732}
+ TutorialTeapot {id: teapot3; effect: program; y:-1.0; x:1.732}
+ }
+
+ ShaderProgram {
+ id: program
+ texture: "textures/qtlogo.png"
+
+ property real textureOffsetX : 0.0
+ property real squashFactor : 0.0
+ NumberAnimation on textureOffsetX
+ {
+ running: true; loops: Animation.Infinite
+ from: 0.0; to: 1.0;
+ duration: 1000
+ }
+
+ SequentialAnimation on squashFactor
+ {
+ running: true; loops: Animation.Infinite
+ NumberAnimation {
+ from: 0.0; to: 1.0; duration: 1000
+ easing.type: "InQuad"
+ }
+ PauseAnimation {
+ duration: 250
+ }
+ NumberAnimation {
+ from: 1.0; to: 0.0; duration: 1000
+ easing.type: "OutQuad"
+ }
+ }
+
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform mediump mat4 qt_ModelViewProjectionMatrix;
+
+ attribute mediump vec4 qt_MultiTexCoord0;
+ varying mediump vec4 texCoord;
+
+ void main(void)
+ {
+ const float modelBottom = -4.0;
+
+ vec4 workingPosition = qt_ModelViewProjectionMatrix * qt_Vertex;
+ float newY = max(workingPosition.y,
+ workingPosition.y * 0.15 + modelBottom);
+ workingPosition.y = newY;
+ gl_Position = workingPosition;
+
+ texCoord = -qt_MultiTexCoord0;
+ }
+ "
+ fragmentShader: "
+ varying mediump vec4 texCoord;
+ uniform sampler2D qt_Texture0;
+
+ void main(void)
+ {
+ mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
+ gl_FragColor = textureColor;
+ }
+ "
+ }
+}
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial-lighting.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial-lighting.qml
new file mode 100644
index 000000000..87a55d613
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial-lighting.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+import Qt3D.Shapes 1.0
+
+Viewport {
+ width: 640; height: 480
+
+
+ Cube {
+ id: teapot
+ effect: program
+// xRotation: 30
+ }
+
+ ShaderProgram {
+ id: program
+ texture: "textures/qtlogo.png"
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+
+ attribute highp vec4 qt_MultiTexCoord0;
+ varying highp vec4 texCoord;
+
+ void main(void)
+ {
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+// texCoord = -qt_MultiTexCoord0;
+ texCoord = qt_Vertex;
+ }
+ "
+ fragmentShader: "
+ varying highp vec4 texCoord;
+ uniform sampler2D qt_Texture0;
+
+ void main(void)
+ {
+ mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
+// gl_FragColor = textureColor;
+ gl_FragColor = vec4(texCoord.xyz , 1.0);
+ }
+ "
+ }
+}
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial-varying.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial-varying.qml
new file mode 100644
index 000000000..fea323167
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial-varying.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt3D 1.0
+
+Viewport {
+ width: 640; height: 480
+
+ Pane {
+ effect: ShaderProgram {
+ id: program
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform mediump mat4 qt_ModelViewProjectionMatrix;
+
+ attribute highp vec4 qt_MultiTexCoord0;
+ varying highp vec4 texCoord;
+
+ void main(void)
+ {
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ texCoord = vec4(qt_MultiTexCoord0.st, 0, 0);
+ }
+ "
+ fragmentShader: "
+ varying highp vec4 texCoord;
+
+ void main(void)
+ {
+ gl_FragColor = vec4(mod(texCoord.x, 1.0),
+ mod(texCoord.y, 1.0),
+ 0.0,
+ 1.0);
+ }
+ "
+ }
+ }
+}
diff --git a/tutorials/quick3d/shadertut/qml/shader-tutorial.qml b/tutorials/quick3d/shadertut/qml/shader-tutorial.qml
new file mode 100644
index 000000000..b5e83227f
--- /dev/null
+++ b/tutorials/quick3d/shadertut/qml/shader-tutorial.qml
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt3D examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//! [1]
+import QtQuick 2.0
+import Qt3D 1.0
+
+Viewport {
+ width: 640; height: 480
+
+
+ TutorialTeapot {
+ id: teapot
+ effect: program
+ xRotation: 30
+ }
+
+ ShaderProgram {
+ id: program
+ texture: "textures/qtlogo.png"
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+
+ attribute highp vec4 qt_MultiTexCoord0;
+ varying highp vec4 texCoord;
+
+ void main(void)
+ {
+ texCoord = qt_MultiTexCoord0;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+ fragmentShader: "
+ varying highp vec4 texCoord;
+ uniform sampler2D qt_Texture0;
+
+ void main(void)
+ {
+ mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
+ gl_FragColor = textureColor;
+ }
+ "
+ }
+}
+//! [1]
diff --git a/tutorials/quick3d/shadertut/shadertut.pro b/tutorials/quick3d/shadertut/shadertut.pro
new file mode 100644
index 000000000..614d697e7
--- /dev/null
+++ b/tutorials/quick3d/shadertut/shadertut.pro
@@ -0,0 +1,41 @@
+TEMPLATE = app
+TARGET = shadertut
+CONFIG += qt warn_on
+QT += declarative quick
+
+SOURCES += main.cpp
+
+ICON_FILE = ../icon.png
+
+QML_FILES = \
+ qml/TutorialTeapot.qml \
+ qml/shader-tutorial-1-textures.qml \
+ qml/shader-tutorial-3-transformed-coordinates.qml \
+ qml/shader-tutorial-varying.qml \
+ qml/shader-tutorial-2-vertex-shader.qml \
+ qml/shader-tutorial-lighting.qml \
+ qml/shader-tutorial.qml
+
+QML_INFRA_FILES = \
+ $$QML_FILES \
+ qml/basket.jpg
+
+QML_MESHES_FILES = \
+ qml/meshes/teapot.bez
+
+CATEGORY = examples
+include(../../../pkg.pri)
+
+INSTALL_DIRS = qml
+mt: INSTALL_FILES = mt.qml
+
+OTHER_FILES += \
+ mt.qml \
+ basket_qml.rc \
+ $$QML_INFRA_FILES
+
+RC_FILE = basket_qml.rc
+
+RESOURCES += \
+ basket.qrc
+