summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorRobert Brock <robert.brock@kdab.com>2016-05-09 11:59:38 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-05-15 13:45:06 +0000
commitbf6cb216007ec6b5cebccbd8505edd28e9371507 (patch)
tree295dfb3e4593ac5334b1d9f64bad842b473163c0 /examples
parent5dfc7b06b0bf17fa68ecf5786e11d569fff89cd4 (diff)
Moved plasma example to manual test
Part of an examples cleanup Change-Id: I234ae5587242b3ec61f4c4d37bd5e6c92a7e95b8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/plasma/main.cpp68
-rw-r--r--examples/qt3d/plasma/main.qml98
-rw-r--r--examples/qt3d/plasma/plasma.frag45
-rw-r--r--examples/qt3d/plasma/plasma.pro18
-rw-r--r--examples/qt3d/plasma/plasma.qrc7
-rw-r--r--examples/qt3d/plasma/plasma.vert9
-rw-r--r--examples/qt3d/qt3d.pro1
7 files changed, 0 insertions, 246 deletions
diff --git a/examples/qt3d/plasma/main.cpp b/examples/qt3d/plasma/main.cpp
deleted file mode 100644
index 7b2c4041b..000000000
--- a/examples/qt3d/plasma/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 <Qt3DQuickExtras/qt3dquickwindow.h>
-#include <Qt3DQuick/QQmlAspectEngine>
-#include <QGuiApplication>
-#include <QQmlEngine>
-#include <QQmlContext>
-
-int main(int argc, char* argv[])
-{
- QGuiApplication app(argc, argv);
- Qt3DExtras::Quick::Qt3DQuickWindow view;
-
- // Expose the window as a context property so we can set the aspect ratio
- view.engine()->qmlEngine()->rootContext()->setContextProperty("_window", &view);
- view.setSource(QUrl("qrc:/main.qml"));
- view.show();
-
- return app.exec();
-}
diff --git a/examples/qt3d/plasma/main.qml b/examples/qt3d/plasma/main.qml
deleted file mode 100644
index 0a01f699b..000000000
--- a/examples/qt3d/plasma/main.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 Qt3D.Core 2.0
-import Qt3D.Render 2.0
-import Qt3D.Extras 2.0
-
-Entity {
- components: RenderSettings {
- ForwardRenderer {}
- renderPolicy: RenderSettings.Always
- }
-
- Entity {
- components: [
- PlaneMesh {
- width: 2.0
- height: 2.0
- meshResolution: Qt.size(2, 2)
- },
-
- Transform { // Rotate the plane so that it faces us
- rotation: fromAxisAndAngle(Qt.vector3d(1.0, 0.0, 0.0), 90)
- },
-
- Material {
- parameters: Parameter { name: "winsize"; value: Qt.vector2d(_window.width, _window.height) }
-
- effect: Effect {
- techniques: Technique {
- filterKeys: [ FilterKey{ name: "renderingStyle"; value: "forward" } ]
-
- graphicsApiFilter {
- minorVersion: 3
- majorVersion: 2
- api: GraphicsApiFilter.OpenGL
- profile: GraphicsApiFilter.CoreProfile
- }
-
- renderPasses: RenderPass {
- shaderProgram: ShaderProgram {
- vertexShaderCode: loadSource("qrc:/plasma.vert")
- fragmentShaderCode: loadSource("qrc:/plasma.frag")
- }
- }
- }
- }
- }
- ]
- }
-}
diff --git a/examples/qt3d/plasma/plasma.frag b/examples/qt3d/plasma/plasma.frag
deleted file mode 100644
index 1e3c7155d..000000000
--- a/examples/qt3d/plasma/plasma.frag
+++ /dev/null
@@ -1,45 +0,0 @@
-#version 150
-
-uniform vec2 winsize;
-uniform float time;
-
-out vec4 fragColor;
-
-float displacement(vec3 p)
-{
- float cosT = cos(time);
- float sinT = sin(time);
-
- mat2 mat = mat2(cosT, -sinT, sinT, cosT);
- p.xz *= mat;
- p.xy *= mat;
- vec3 q = 1.75 * p;
-
- return length(p + vec3(sinT)) *
- log(length(p) + 1.0) +
- sin(q.x + sin(q.z + sin(q.y))) * 0.25 - 1.0;
-}
-
-void main()
-{
- vec3 color;
- float d = 2.5;
- vec2 screenPos = gl_FragCoord.xy / winsize.xy - vec2(0.6, 0.4);
- vec3 pos = normalize(vec3(screenPos, -1.0));
- float sinT = sin(time) * 0.2;
-
- // compute plasma color
- for (int i = 0; i < 8; ++i) {
- vec3 p = vec3(0.0, 0.0, 5.0) + pos * d;
-
- float positionFactor = displacement(p);
- d += min(positionFactor, 1.0);
-
- float clampFactor = clamp((positionFactor- displacement(p + 0.1)) * 0.5, -0.1, 1.0);
- vec3 l = vec3(0.2 * sinT, 0.35, 0.4) + vec3(5.0, 2.5, 3.25) * clampFactor;
- color = (color + (1.0 - smoothstep(0.0, 2.5, positionFactor)) * 0.7) * l;
- }
-
- // background color + plasma color
- fragColor = vec4(screenPos * (vec2(1.0, 0.5) + sinT), 0.5 + sinT, 1.0) + vec4(color, 1.0);
-}
diff --git a/examples/qt3d/plasma/plasma.pro b/examples/qt3d/plasma/plasma.pro
deleted file mode 100644
index 0e2e9cdb3..000000000
--- a/examples/qt3d/plasma/plasma.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-!include( ../examples.pri ) {
- error( "Couldn't find the examples.pri file!" )
-}
-
-QT += 3dcore 3drender 3dquick qml quick 3dquickextras
-
-HEADERS += \
-
-SOURCES += \
- main.cpp
-
-OTHER_FILES += \
- main.qml \
- plasma.frag \
- plasma.vert
-
-RESOURCES += \
- plasma.qrc
diff --git a/examples/qt3d/plasma/plasma.qrc b/examples/qt3d/plasma/plasma.qrc
deleted file mode 100644
index 5874b2c5c..000000000
--- a/examples/qt3d/plasma/plasma.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>plasma.vert</file>
- <file>plasma.frag</file>
- </qresource>
-</RCC>
diff --git a/examples/qt3d/plasma/plasma.vert b/examples/qt3d/plasma/plasma.vert
deleted file mode 100644
index 2ed46a471..000000000
--- a/examples/qt3d/plasma/plasma.vert
+++ /dev/null
@@ -1,9 +0,0 @@
-#version 150
-
-in vec4 vertexPosition;
-uniform mat4 modelMatrix;
-
-void main()
-{
- gl_Position = modelMatrix * vertexPosition;
-}
diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro
index 20aa09180..eb9f2c632 100644
--- a/examples/qt3d/qt3d.pro
+++ b/examples/qt3d/qt3d.pro
@@ -16,7 +16,6 @@ SUBDIRS += \
anaglyph-rendering \
simple-shaders-qml \
planets-qml \
- plasma \
transparency-qml \
transparency-qml-scene3d \
scene3d-loader \