summaryrefslogtreecommitdiffstats
path: root/src/quick3d
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-01-16 12:31:17 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-01-18 15:31:16 +0100
commit57f6378bb469924a70cb23c0caf2ce08a78be8a5 (patch)
tree18685b53c09137d9a783d504faade29f7af5ccc4 /src/quick3d
parentefeff9987d5191031231335573610d9ae34173da (diff)
Add ForwardRenderer.qml in the QML defaults
Change-Id: I65bc04c2ba950541e8e72cc06b4368fc915651d0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick3d')
-rw-r--r--src/quick3d/imports/render/defaults/defaults.pri3
-rw-r--r--src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml69
-rw-r--r--src/quick3d/imports/render/qt3dquick3drenderplugin.cpp5
3 files changed, 75 insertions, 2 deletions
diff --git a/src/quick3d/imports/render/defaults/defaults.pri b/src/quick3d/imports/render/defaults/defaults.pri
index d0ede855d..76b67a420 100644
--- a/src/quick3d/imports/render/defaults/defaults.pri
+++ b/src/quick3d/imports/render/defaults/defaults.pri
@@ -10,4 +10,5 @@ QML_FILES = \
$$PWD/qml/DiffuseSpecularMapMaterial.qml \
$$PWD/qml/NormalDiffuseMapMaterial.qml \
$$PWD/qml/NormalDiffuseMapAlphaMaterial.qml \
- $$PWD/qml/NormalDiffuseSpecularMapMaterial.qml
+ $$PWD/qml/NormalDiffuseSpecularMapMaterial.qml \
+ $$PWD/qml/ForwardRenderer.qml \
diff --git a/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml b/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml
new file mode 100644
index 000000000..0b24b3fef
--- /dev/null
+++ b/src/quick3d/imports/render/defaults/qml/ForwardRenderer.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt3D 2.0
+import Qt3D.Render 2.0
+
+TechniqueFilter {
+ // Expose camera to allow user to choose which camera to use for rendering
+ property alias camera: cameraSelector.camera
+ property alias clearColor: viewport.clearColor
+ property alias viewportRect: viewport.rect
+
+ // Select the forward rendering Technique of any used Effect
+ requires: [ Annotation { name: "renderingStyle"; value: "forward" } ]
+
+ // Use the whole viewport
+ Viewport {
+ id: viewport
+ rect: Qt.rect(0.0, 0.0, 1.0, 1.0)
+ clearColor: "white"
+
+ // Use the specified camera
+ CameraSelector {
+ id : cameraSelector
+ ClearBuffer {
+ buffers : ClearBuffer.ColorDepthBuffer
+ }
+ }
+ }
+}
+
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
index abe892d35..c9c389b7b 100644
--- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
+++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp
@@ -117,12 +117,15 @@ static const struct {
const char *type;
int major, minor;
} qmldir [] = {
+ // Materials
{ "PhongMaterial", 2, 0 },
{ "DiffuseMapMaterial", 2, 0 },
{ "DiffuseSpecularMapMaterial", 2, 0 },
{ "NormalDiffuseMapAlphaMaterial", 2, 0 },
{ "NormalDiffuseMapMaterial", 2, 0 },
- { "NormalDiffuseSpecularMapMaterial", 2, 0 }
+ { "NormalDiffuseSpecularMapMaterial", 2, 0 },
+ // FrameGraphs
+ { "ForwardRenderer", 2, 0 }
};
QVariantList QJSValueToVariantListConverter(const QJSValue &jsValue)