diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-07-11 12:45:26 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-07-11 12:45:26 +0000 |
commit | 82a5efc7c9862aab0962a59824568d3b6fe16f10 (patch) | |
tree | a67c52b981968c4e32627caea8546a7f63cb3a6f /tests/manual | |
parent | a61bc1bd653559637146d9e0ba0884de3e3f1a12 (diff) | |
parent | 2dd6aa017685bd76f3a315871d07fdaef0e6d5f1 (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'tests/manual')
16 files changed, 28 insertions, 270 deletions
diff --git a/tests/manual/deferred-renderer-cpp/final_gl2.frag b/tests/manual/deferred-renderer-cpp/final_gl2.frag index a1309112a..f6cc9e957 100644 --- a/tests/manual/deferred-renderer-cpp/final_gl2.frag +++ b/tests/manual/deferred-renderer-cpp/final_gl2.frag @@ -32,7 +32,7 @@ void main() vec3 pos = texture2D(position, texCoord).xyz; vec3 norm = texture2D(normal, texCoord).xyz; - vec3 lightColor; + vec3 lightColor = vec3(0.0); vec3 s; for (int i = 0; i < lightCount; ++i) { diff --git a/tests/manual/deferred-renderer-cpp/final_gl3.frag b/tests/manual/deferred-renderer-cpp/final_gl3.frag index d760e9844..9dc8754e1 100644 --- a/tests/manual/deferred-renderer-cpp/final_gl3.frag +++ b/tests/manual/deferred-renderer-cpp/final_gl3.frag @@ -34,7 +34,7 @@ void main() vec3 pos = texture(position, texCoord).xyz; vec3 norm = texture(normal, texCoord).xyz; - vec3 lightColor; + vec3 lightColor = vec3(0.0); vec3 s; for (int i = 0; i < lightCount; ++i) { diff --git a/tests/manual/deferred-renderer-cpp/gbuffer.cpp b/tests/manual/deferred-renderer-cpp/gbuffer.cpp index 984dbb1f2..d2d6c2aab 100644 --- a/tests/manual/deferred-renderer-cpp/gbuffer.cpp +++ b/tests/manual/deferred-renderer-cpp/gbuffer.cpp @@ -55,8 +55,10 @@ GBuffer::GBuffer(Qt3DCore::QNode *parent) { const Qt3DRender::QAbstractTexture::TextureFormat formats[AttachmentsCount] = { Qt3DRender::QAbstractTexture::RGBA32F, - Qt3DRender::QAbstractTexture::RGB32F, - Qt3DRender::QAbstractTexture::RGB16F, + // We use RGBA32F for the following two instead of a more fitting format because + // OpenGL vendors might not support other formats + Qt3DRender::QAbstractTexture::RGBA32F, + Qt3DRender::QAbstractTexture::RGBA32F, Qt3DRender::QAbstractTexture::D32F }; diff --git a/tests/manual/deferred-renderer-cpp/geometry_gl3.frag b/tests/manual/deferred-renderer-cpp/geometry_gl3.frag index 7d9c7d64e..101d55c60 100644 --- a/tests/manual/deferred-renderer-cpp/geometry_gl3.frag +++ b/tests/manual/deferred-renderer-cpp/geometry_gl3.frag @@ -5,12 +5,12 @@ in vec3 position0; in vec3 normal0; out vec4 color; -out vec3 position; -out vec3 normal; +out vec4 position; +out vec4 normal; void main() { color = color0; - position = position0; - normal = normal0; + position = vec4(position0, 0.0); + normal = vec4(normal0, 0.0); } diff --git a/tests/manual/deferred-renderer-qml/GBuffer.qml b/tests/manual/deferred-renderer-qml/GBuffer.qml index bf43c66b5..dc2857f32 100644 --- a/tests/manual/deferred-renderer-qml/GBuffer.qml +++ b/tests/manual/deferred-renderer-qml/GBuffer.qml @@ -84,9 +84,9 @@ RenderTarget { id : positionAttachment width : 1024 height : 1024 - // This texture format may not be supported by - // some OpenGL vendors when used as a color attachment - format : Texture.RGB32F + // We use RGBA32F here instead of a more fitting format because + // OpenGL vendors might not support other formats + format : Texture.RGBA32F generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear @@ -103,9 +103,9 @@ RenderTarget { id : normalAttachment width : 1024 height : 1024 - // This texture format may not be supported by - // some OpenGL vendors when used as a color attachment - format : Texture.RGB16F + // We use RGBA32F here instead of a more fitting format because + // OpenGL vendors might not support other formats + format : Texture.RGBA32F generateMipMaps : false magnificationFilter : Texture.Linear minificationFilter : Texture.Linear diff --git a/tests/manual/deferred-renderer-qml/SceneEffect.qml b/tests/manual/deferred-renderer-qml/SceneEffect.qml index 5dbfdae63..3ec1983fe 100644 --- a/tests/manual/deferred-renderer-qml/SceneEffect.qml +++ b/tests/manual/deferred-renderer-qml/SceneEffect.qml @@ -92,14 +92,14 @@ Effect { in vec3 normal0; out vec4 color; - out vec3 position; - out vec3 normal; + out vec4 position; + out vec4 normal; void main() { color = color0; - position = position0; - normal = normal0; + position = vec4(position0, 0.0); + normal = vec4(normal0, 0.0); } " } diff --git a/tests/manual/deferred-renderer-qml/final_es2.frag b/tests/manual/deferred-renderer-qml/final_es2.frag index a1309112a..f6cc9e957 100644 --- a/tests/manual/deferred-renderer-qml/final_es2.frag +++ b/tests/manual/deferred-renderer-qml/final_es2.frag @@ -32,7 +32,7 @@ void main() vec3 pos = texture2D(position, texCoord).xyz; vec3 norm = texture2D(normal, texCoord).xyz; - vec3 lightColor; + vec3 lightColor = vec3(0.0); vec3 s; for (int i = 0; i < lightCount; ++i) { diff --git a/tests/manual/deferred-renderer-qml/final_gl3.frag b/tests/manual/deferred-renderer-qml/final_gl3.frag index d760e9844..9dc8754e1 100644 --- a/tests/manual/deferred-renderer-qml/final_gl3.frag +++ b/tests/manual/deferred-renderer-qml/final_gl3.frag @@ -34,7 +34,7 @@ void main() vec3 pos = texture(position, texCoord).xyz; vec3 norm = texture(normal, texCoord).xyz; - vec3 lightColor; + vec3 lightColor = vec3(0.0); vec3 s; for (int i = 0; i < lightCount; ++i) { 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> |