diff options
author | Määttä Antti <antti.maatta@qt.io> | 2017-05-31 11:31:00 +0300 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-06-24 12:59:19 +0000 |
commit | 603663b74a7294c37c17a8ab00e3bd86a46b916e (patch) | |
tree | 9f549ed99867edb33a55edbca2ec19843bedb7ac /tests/manual | |
parent | a75551c90bb9852640f8aabe0cef521024d672f5 (diff) |
Change manual tests using Scene2D to use TextureMaterial
Change render-qml-to-texture-qml and video-texture to use TextureMaterial.
This removes the dependency to the render-qml-to-texture manual test from
these tests. This also fixes the controls in the render-qml-to-texture-qml
test, which were 'upside down'.
Change-Id: I248014decd8f9d06b0e0922d035afe8c0b0f78ff
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/manual')
8 files changed, 6 insertions, 250 deletions
diff --git a/tests/manual/render-qml-to-texture-qml/PlaneMaterial.qml b/tests/manual/render-qml-to-texture-qml/PlaneMaterial.qml deleted file mode 100644 index 6c65de9b3..000000000 --- a/tests/manual/render-qml-to-texture-qml/PlaneMaterial.qml +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later 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 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - - property Texture2D texture - property vector2d textureScale: Qt.vector2d(1,-1) - property vector2d textureBias: Qt.vector2d(0, 1) - - parameters: [ - Parameter { name: "surfaceTexture"; value: texture }, - Parameter { name: "texCoordScale"; value: textureScale }, - Parameter { name: "texCoordBias"; value: textureBias } - ] - - effect: Effect { - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - ShaderProgram { - id: gl2Es2Shader - vertexShaderCode: loadSource("qrc:/shaders/es2/texturing.vert") - fragmentShaderCode: loadSource("qrc:/shaders/es2/texturing.frag") - } - - ShaderProgram { - id: gl3Shader - vertexShaderCode: loadSource("qrc:/shaders/gl3/texturing.vert") - fragmentShaderCode: loadSource("qrc:/shaders/gl3/texturing.frag") - } - techniques: [ - // OpenGL 3.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.CoreProfile - majorVersion: 3 - minorVersion: 1 - } - - renderPasses: RenderPass { - shaderProgram: gl3Shader - } - }, - - // OpenGL 2.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - } - }, - - // OpenGL ES 2 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGLES - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - } - } - ] - } -} diff --git a/tests/manual/render-qml-to-texture-qml/main.qml b/tests/manual/render-qml-to-texture-qml/main.qml index 65a0a8783..38a0259ee 100644 --- a/tests/manual/render-qml-to-texture-qml/main.qml +++ b/tests/manual/render-qml-to-texture-qml/main.qml @@ -41,7 +41,7 @@ import QtQuick 2.0 as QQ2 import QtQuick.Scene3D 2.0 import QtQuick.Scene2D 2.9 import QtQuick.Window 2.0 as QW2 -import Qt3D.Extras 2.0 +import Qt3D.Extras 2.9 QQ2.Item { @@ -120,6 +120,7 @@ QQ2.Item { id: planeMesh width: 4 height: 4 + mirrored: true } Entity { @@ -131,7 +132,7 @@ QQ2.Item { rotation: fromAxisAndAngle(Qt.vector3d(1,0,0), 90) } - property Material material: PlaneMaterial { + property Material material: TextureMaterial { texture: offscreenTexture } diff --git a/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.pro b/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.pro index 23729957c..ad2c3d7dc 100644 --- a/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.pro +++ b/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.pro @@ -2,10 +2,6 @@ error( "Couldn't find the manual.pri file!" ) } -!include ( ../render-qml-to-texture/render-qml-to-texture.pri ) { - error( "Couldn't find the render-qml-to-texture.pri file!") -} - QT += 3dextras 3dcore 3drender 3dinput 3dquick qml quick SOURCES += main.cpp diff --git a/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.qrc b/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.qrc index 51ec4790c..cf03e7842 100644 --- a/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.qrc +++ b/tests/manual/render-qml-to-texture-qml/render-qml-to-texture-qml.qrc @@ -1,7 +1,6 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> - <file>PlaneMaterial.qml</file> <file>InteractiveGui.qml</file> </qresource> </RCC> diff --git a/tests/manual/video-texture-qml/PlaneMaterial.qml b/tests/manual/video-texture-qml/PlaneMaterial.qml deleted file mode 100644 index 6c65de9b3..000000000 --- a/tests/manual/video-texture-qml/PlaneMaterial.qml +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later 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 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - - property Texture2D texture - property vector2d textureScale: Qt.vector2d(1,-1) - property vector2d textureBias: Qt.vector2d(0, 1) - - parameters: [ - Parameter { name: "surfaceTexture"; value: texture }, - Parameter { name: "texCoordScale"; value: textureScale }, - Parameter { name: "texCoordBias"; value: textureBias } - ] - - effect: Effect { - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - ShaderProgram { - id: gl2Es2Shader - vertexShaderCode: loadSource("qrc:/shaders/es2/texturing.vert") - fragmentShaderCode: loadSource("qrc:/shaders/es2/texturing.frag") - } - - ShaderProgram { - id: gl3Shader - vertexShaderCode: loadSource("qrc:/shaders/gl3/texturing.vert") - fragmentShaderCode: loadSource("qrc:/shaders/gl3/texturing.frag") - } - techniques: [ - // OpenGL 3.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.CoreProfile - majorVersion: 3 - minorVersion: 1 - } - - renderPasses: RenderPass { - shaderProgram: gl3Shader - } - }, - - // OpenGL 2.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - } - }, - - // OpenGL ES 2 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGLES - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - } - } - ] - } -} diff --git a/tests/manual/video-texture-qml/main.qml b/tests/manual/video-texture-qml/main.qml index 6a8dff3d5..93110ef2a 100644 --- a/tests/manual/video-texture-qml/main.qml +++ b/tests/manual/video-texture-qml/main.qml @@ -40,7 +40,7 @@ import Qt3D.Input 2.0 import QtQuick 2.2 as QQ2 import QtQuick.Scene2D 2.9 import QtQuick.Window 2.0 as QW2 -import Qt3D.Extras 2.0 +import Qt3D.Extras 2.9 import QtMultimedia 5.6 as QMM import QtQuick.Dialogs 1.0 @@ -121,7 +121,7 @@ Entity { translation: Qt.vector3d(0,0,0) } - property Material material: PlaneMaterial { + property Material material: TextureMaterial { texture: offscreenTexture } diff --git a/tests/manual/video-texture-qml/video-texture-qml.pro b/tests/manual/video-texture-qml/video-texture-qml.pro index 713ef8cfe..44da325aa 100644 --- a/tests/manual/video-texture-qml/video-texture-qml.pro +++ b/tests/manual/video-texture-qml/video-texture-qml.pro @@ -2,10 +2,6 @@ error( "Couldn't find the manual.pri file!" ) } -!include ( ../render-qml-to-texture/render-qml-to-texture.pri ) { - error( "Couldn't find the render-qml-to-texture.pri file!") -} - QT += 3dquickextras 3dcore 3drender 3dinput 3dquick qml quick 3dquickrender SOURCES += main.cpp @@ -16,6 +12,5 @@ RESOURCES += \ OTHER_FILES += \ main.qml -DISTFILES += \ - PlaneMaterial.qml +DISTFILES += diff --git a/tests/manual/video-texture-qml/video-texture-qml.qrc b/tests/manual/video-texture-qml/video-texture-qml.qrc index 6b2a1aef6..5f6483ac3 100644 --- a/tests/manual/video-texture-qml/video-texture-qml.qrc +++ b/tests/manual/video-texture-qml/video-texture-qml.qrc @@ -1,6 +1,5 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> - <file>PlaneMaterial.qml</file> </qresource> </RCC> |