diff options
Diffstat (limited to 'src/quick3d/imports/extras')
23 files changed, 944 insertions, 2315 deletions
diff --git a/src/quick3d/imports/extras/defaults/defaults.pri b/src/quick3d/imports/extras/defaults/defaults.pri deleted file mode 100644 index 98f542fd6..000000000 --- a/src/quick3d/imports/extras/defaults/defaults.pri +++ /dev/null @@ -1,26 +0,0 @@ - -# When adding new QML files that should be built into the plugin, -# add them to this variable and they will be listed into a generated -# resource file. -# -# To have the plugin register them as types, add an entries to the -# qmldir array in qt3dquick3dextrasplugin.cpp -QML_FILES = \ - $$PWD/qml/DefaultEffect.qml \ - $$PWD/qml/DefaultAlphaEffect.qml \ - $$PWD/qml/PhongMaterial.qml \ - $$PWD/qml/DiffuseMapMaterial.qml \ - $$PWD/qml/DiffuseSpecularMapMaterial.qml \ - $$PWD/qml/NormalDiffuseMapMaterial.qml \ - $$PWD/qml/NormalDiffuseMapAlphaMaterial.qml \ - $$PWD/qml/NormalDiffuseSpecularMapMaterial.qml \ - $$PWD/qml/ForwardRenderer.qml \ - $$PWD/qml/PerVertexColorMaterial.qml \ - $$PWD/qml/SkyboxEntity.qml \ - $$PWD/qml/GoochMaterial.qml \ - $$PWD/qml/PhongAlphaMaterial.qml \ - $$PWD/qml/TextureMaterial.qml \ - $$PWD/qml/OrbitCameraController.qml \ - $$PWD/qml/FirstPersonCameraController.qml \ - $$PWD/qml/NormalDiffuseMapAlphaEffect.qml \ - $$PWD/qml/LevelOfDetailLoader.qml diff --git a/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml b/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml deleted file mode 100644 index c28fda4d1..000000000 --- a/src/quick3d/imports/extras/defaults/qml/DefaultAlphaEffect.qml +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Effect { - property string vertexES: "qrc:/shaders/es2/phong.vert" - property string fragmentES: "qrc:/shaders/es2/phongalpha.frag" - property string vertex: "qrc:/shaders/gl3/phong.vert" - property string fragment: "qrc:/shaders/gl3/phongalpha.frag" - property int sourceRgbArg: BlendEquationArguments.SourceAlpha - property int destinationRgbArg: BlendEquationArguments.OneMinusSourceAlpha - property int sourceAlphaArg: BlendEquationArguments.One - property int destinationAlphaArg: BlendEquationArguments.Zero - property int blendFunctionArg: BlendEquation.Add - - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - ShaderProgram { - id: gl2Es2Shader - vertexShaderCode: loadSource(vertexES) - fragmentShaderCode: loadSource(fragmentES) - } - - ShaderProgram { - id: gl3Shader - vertexShaderCode: loadSource(vertex) - fragmentShaderCode: loadSource(fragment) - } - - techniques: [ - // OpenGL 3.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.CoreProfile - majorVersion: 3 - minorVersion: 1 - } - renderPasses: RenderPass { - shaderProgram: gl3Shader - renderStates: [ - BlendEquationArguments { - sourceRgb: sourceRgbArg - destinationRgb: destinationRgbArg - sourceAlpha: sourceAlphaArg - destinationAlpha: destinationAlphaArg - }, - BlendEquation { - blendFunction: blendFunctionArg - } - ] - } - }, - - // OpenGL 2.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - renderStates: [ - BlendEquationArguments { - sourceRgb: sourceRgbArg - destinationRgb: destinationRgbArg - sourceAlpha: sourceAlphaArg - destinationAlpha: destinationAlphaArg - }, - BlendEquation { - blendFunction: blendFunctionArg - } - ] - } - }, - - // OpenGL ES 2 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGLES - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - renderStates: [ - BlendEquationArguments { - sourceRgb: sourceRgbArg - destinationRgb: destinationRgbArg - sourceAlpha: sourceAlphaArg - destinationAlpha: destinationAlphaArg - }, - BlendEquation { - blendFunction: blendFunctionArg - } - ] - } - } - ] -} diff --git a/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml b/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml deleted file mode 100644 index fed87c94d..000000000 --- a/src/quick3d/imports/extras/defaults/qml/DefaultEffect.qml +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Effect { - property string vertexES: "qrc:/shaders/es2/phong.vert" - property string fragmentES: "qrc:/shaders/es2/phong.frag" - property string vertex: "qrc:/shaders/gl3/phong.vert" - property string fragment: "qrc:/shaders/gl3/phong.frag" - - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - ShaderProgram { - id: gl2Es2Shader - vertexShaderCode: loadSource(vertexES) - fragmentShaderCode: loadSource(fragmentES) - } - - ShaderProgram { - id: gl3Shader - vertexShaderCode: loadSource(vertex) - fragmentShaderCode: loadSource(fragment) - } - - 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/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml deleted file mode 100644 index 4b49d76de..000000000 --- a/src/quick3d/imports/extras/defaults/qml/DiffuseMapMaterial.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property alias diffuse: diffuseTextureImage.source - property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 ) - property real shininess: 150.0 - property real textureScale: 1.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { - name: "diffuseTexture" - value: Texture2D { - id: diffuseTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage; } - } - }, - Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) }, - Parameter { name: "shininess"; value: root.shininess }, - Parameter { name: "texCoordScale"; value: textureScale } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/diffusemap.vert" - fragmentES: "qrc:/shaders/es2/diffusemap.frag" - vertex: "qrc:/shaders/gl3/diffusemap.vert" - fragment: "qrc:/shaders/gl3/diffusemap.frag" - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml deleted file mode 100644 index 629cb6d11..000000000 --- a/src/quick3d/imports/extras/defaults/qml/DiffuseSpecularMapMaterial.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property alias diffuse: diffuseTextureImage.source - property alias specular: specularTextureImage.source - property real shininess: 150.0 - property real textureScale: 1.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { - name: "diffuseTexture" - value: Texture2D { - id: diffuseTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage; } - } - }, - Parameter { name: "specularTexture"; - value: Texture2D { - id: specularTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: specularTextureImage; } - } - }, - Parameter { name: "shininess"; value: root.shininess }, - Parameter { name: "texCoordScale"; value: textureScale } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/diffusemap.vert" - fragmentES: "qrc:/shaders/es2/diffusespecularmap.frag" - vertex: "qrc:/shaders/gl3/diffusemap.vert" - fragment: "qrc:/shaders/gl3/diffusespecularmap.frag" - } -} diff --git a/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml b/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml deleted file mode 100644 index 1003c0ea0..000000000 --- a/src/quick3d/imports/extras/defaults/qml/FirstPersonCameraController.qml +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Paul Lemire <paul.lemire350@gmail.com> -** 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.Input 2.0 -import Qt3D.Logic 2.0 -import QtQml 2.2 - -Entity { - id: root - property Camera camera - property real linearSpeed: 10.0 - property real lookSpeed: 180.0 - property real acceleration: -1.0 - property real deceleration: -1.0 - - QtObject { - id: d - readonly property vector3d firstPersonUp: Qt.vector3d(0, 1, 0) - readonly property bool leftMouseButtonPressed: leftMouseButtonAction.active - readonly property real vx: txAxis.value * linearSpeed; - readonly property real vy: tyAxis.value * linearSpeed; - readonly property real vz: tzAxis.value * linearSpeed; - readonly property real dx: rxAxis.value * lookSpeed - readonly property real dy: ryAxis.value * lookSpeed - readonly property bool fineMotion: fineMotionAction.active - } - - KeyboardDevice { - id: keyboardSourceDevice - } - - MouseDevice { - id: mouseSourceDevice - sensitivity: d.fineMotion ? 0.01 : 0.1 - } - - components: [ - - LogicalDevice { - enabled: root.enabled - actions: [ - Action { - id: leftMouseButtonAction - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.LeftButton] - } - }, - Action { - id: fineMotionAction - ActionInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Shift] - } - } - ] // actions - - axes: [ - // Rotation - Axis { - id: rxAxis - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.X - } - }, - Axis { - id: ryAxis - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.Y - } - }, - // Translation - Axis { - id: txAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Left] - scale: -1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Right] - scale: 1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - }, - Axis { - id: tzAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Up] - scale: 1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Down] - scale: -1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - }, - Axis { - id: tyAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_PageUp] - scale: 1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_PageDown] - scale: -1.0 - acceleration: root.acceleration - deceleration: root.deceleration - } - } - ] // axes - }, - - FrameAction { - onTriggered: { - // The time difference since the last frame is passed in as the - // argument dt. It is a floating point value in units of seconds. - root.camera.translate(Qt.vector3d(d.vx, d.vy, d.vz).times(dt)) - - if (d.leftMouseButtonPressed) { - root.camera.pan(d.dx * dt, d.firstPersonUp) - root.camera.tilt(d.dy * dt) - } - } - } - ] // components -} diff --git a/src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml b/src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml deleted file mode 100644 index b7ad3188c..000000000 --- a/src/quick3d/imports/extras/defaults/qml/ForwardRenderer.qml +++ /dev/null @@ -1,77 +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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 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: clearBuffer.clearColor - property alias viewportRect: viewport.normalizedRect - property alias window: surfaceSelector.surface - property alias externalRenderTargetSize: surfaceSelector.externalRenderTargetSize - property alias frustumCulling: frustumCulling.enabled - - // Select the forward rendering Technique of any used Effect - matchAll: [ FilterKey { name: "renderingStyle"; value: "forward" } ] - - RenderSurfaceSelector { - id: surfaceSelector - - // Use the whole viewport - Viewport { - id: viewport - normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0) - - // Use the specified camera - CameraSelector { - id : cameraSelector - FrustumCulling { - id: frustumCulling - ClearBuffers { - id: clearBuffer - clearColor: "white" - buffers : ClearBuffers.ColorDepthBuffer - } - } - } - } - } -} diff --git a/src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml b/src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml deleted file mode 100644 index fffa2284d..000000000 --- a/src/quick3d/imports/extras/defaults/qml/GoochMaterial.qml +++ /dev/null @@ -1,71 +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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color diffuse: Qt.rgba( 0.0, 0.0, 0.0, 1.0 ) - property color specular: Qt.rgba( 0.0, 0.0, 0.0, 1.0 ) - property color coolColor: Qt.rgba( 0.0, 0.0, 0.4, 1.0 ) - property color warmColor: Qt.rgba( 0.4, 0.4, 0.0, 1.0 ) - property real alpha: 0.25 - property real beta: 0.5 - property real shininess: 100.0 - - parameters: [ - Parameter { name: "kd"; value: root.diffuse }, - Parameter { name: "ks"; value: root.specular }, - Parameter { name: "kblue"; value: root.coolColor }, - Parameter { name: "kyellow"; value: root.warmColor }, - Parameter { name: "alpha"; value: root.alpha }, - Parameter { name: "beta"; value: root.beta }, - Parameter { name: "shininess"; value: root.shininess } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/gooch.vert" - fragmentES: "qrc:/shaders/es2/gooch.frag" - vertex: "qrc:/shaders/gl3/gooch.vert" - fragment: "qrc:/shaders/gl3/gooch.frag" - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml b/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml deleted file mode 100644 index 83655a7bc..000000000 --- a/src/quick3d/imports/extras/defaults/qml/LevelOfDetailLoader.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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.2 - -Entity { - id:root - - property var sources: [] - readonly property alias entity: loader.entity - readonly property alias source: loader.source - - property alias camera: lod.camera - property alias currentIndex: lod.currentIndex - property alias thresholdType: lod.thresholdType - property alias thresholds: lod.thresholds - property alias volumeOverride: lod.volumeOverride - - EntityLoader { - id: loader - components: [ - LevelOfDetail { - id: lod - enabled: root.enabled - currentIndex: -1 - onCurrentIndexChanged: if (currentIndex >= 0 && currentIndex < root.sources.length) - loader.source = root.sources[currentIndex] - } - ] - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml deleted file mode 100644 index e4f038642..000000000 --- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaEffect.qml +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Effect { - property string vertexES: "qrc:/shaders/es2/normaldiffusemap.vert" - property string fragmentES: "qrc:/shaders/es2/normaldiffusemapalpha.frag" - property string vertex: "qrc:/shaders/gl3/normaldiffusemap.vert" - property string fragment: "qrc:/shaders/gl3/normaldiffusemapalpha.frag" - - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - ShaderProgram { - id: gl2Es2Shader - vertexShaderCode: loadSource(vertexES) - fragmentShaderCode: loadSource(fragmentES) - } - - ShaderProgram { - id: gl3Shader - vertexShaderCode: loadSource(vertex) - fragmentShaderCode: loadSource(fragment) - } - - AlphaCoverage { id: alphaCoverage } - - techniques: [ - // OpenGL 3.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.CoreProfile - majorVersion: 3 - minorVersion: 1 - } - renderPasses: RenderPass { - shaderProgram: gl3Shader - renderStates: [ alphaCoverage ] - } - }, - - // OpenGL 2.1 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - renderStates: [ alphaCoverage ] - } - }, - - // OpenGL ES 2 - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGLES - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2Es2Shader - renderStates: [ alphaCoverage ] - } - } - ] -} diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml deleted file mode 100644 index 421cc3aa9..000000000 --- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapAlphaMaterial.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property alias diffuse: diffuseTextureImage.source - property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 ) - property alias normal: normalTextureImage.source - property real shininess: 150.0 - property real textureScale: 1.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { - name: "diffuseTexture" - value: Texture2D { - id: diffuseTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage; } - } - }, - Parameter { - name: "normalTexture" - value: Texture2D { - id: normalTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: normalTextureImage; } - } - }, - Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) }, - Parameter { name: "shininess"; value: root.shininess }, - Parameter { name: "texCoordScale"; value: textureScale } - ] - - effect: NormalDiffuseMapAlphaEffect { } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml deleted file mode 100644 index 0724cf597..000000000 --- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseMapMaterial.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property alias diffuse: diffuseTextureImage.source - property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 ) - property alias normal: normalTextureImage.source - property real shininess: 150.0 - property real textureScale: 1.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { - name: "diffuseTexture" - value: Texture2D { - id: diffuseTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage; } - } - }, - Parameter { - name: "normalTexture" - value: Texture2D { - id: normalTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: normalTextureImage; } - } - }, - Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) }, - Parameter { name: "shininess"; value: root.shininess }, - Parameter { name: "texCoordScale"; value: textureScale } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/normaldiffusemap.vert" - fragmentES: "qrc:/shaders/es2/normaldiffusemap.frag" - vertex: "qrc:/shaders/gl3/normaldiffusemap.vert" - fragment: "qrc:/shaders/gl3/normaldiffusemap.frag" - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml b/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml deleted file mode 100644 index 497209c32..000000000 --- a/src/quick3d/imports/extras/defaults/qml/NormalDiffuseSpecularMapMaterial.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property alias diffuse: diffuseTextureImage.source - property alias specular: specularTextureImage.source - property alias normal: normalTextureImage.source - property real shininess: 150.0 - property real textureScale: 1.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { - name: "diffuseTexture" - value: Texture2D { - id: diffuseTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: diffuseTextureImage; } - } - }, - Parameter { name: "specularTexture"; - value: Texture2D { - id: specularTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: specularTextureImage; } - } - }, - Parameter { - name: "normalTexture" - value: Texture2D { - id: normalTexture - minificationFilter: Texture.LinearMipMapLinear - magnificationFilter: Texture.Linear - wrapMode { - x: WrapMode.Repeat - y: WrapMode.Repeat - } - generateMipMaps: true - maximumAnisotropy: 16.0 - TextureImage { id: normalTextureImage; } - } - }, - Parameter { name: "shininess"; value: root.shininess }, - Parameter { name: "texCoordScale"; value: textureScale } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/normaldiffusemap.vert" - fragmentES: "qrc:/shaders/es2/normaldiffusespecularmap.frag" - vertex: "qrc:/shaders/gl3/normaldiffusemap.vert" - fragment: "qrc:/shaders/gl3/normaldiffusespecularmap.frag" - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml b/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml deleted file mode 100644 index ae8869473..000000000 --- a/src/quick3d/imports/extras/defaults/qml/OrbitCameraController.qml +++ /dev/null @@ -1,236 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Paul Lemire <paul.lemire350@gmail.com> -** 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.Input 2.0 -import Qt3D.Logic 2.0 -import QtQml 2.2 - -Entity { - id: root - property Camera camera - property real linearSpeed: 10.0 - property real lookSpeed: 180.0 - property real zoomLimit: 2.0 - - QtObject { - id: d - readonly property vector3d firstPersonUp: Qt.vector3d(0, 1, 0) - readonly property bool leftMouseButtonPressed: leftMouseButtonAction.active - readonly property bool rightMouseButtonPressed: rightMouseButtonAction.active - readonly property bool shiftPressed: shiftAction.active - readonly property bool altPressed: altAction.active - property real translationX: clampInputs(leftMouseButtonPressed ? mouseXAxis.value : 0, keyboardXAxis.value) * linearSpeed; - property real translationY: clampInputs(leftMouseButtonPressed ? mouseYAxis.value : 0, keyboardYAxis.value) * linearSpeed; - property real translationZ: keyboardZAxis.value * linearSpeed; - property real orbitX: clampInputs(rightMouseButtonPressed ? mouseXAxis.value : 0, keyboardXAxis.value) * lookSpeed; - property real orbitY: clampInputs(rightMouseButtonPressed ? mouseYAxis.value : 0, keyboardYAxis.value) * lookSpeed; - } - - function clampInputs(input1, input2) { - var axisValue = input1 + input2; - return (axisValue < -1) ? -1 : (axisValue > 1) ? 1 : axisValue; - } - - function zoomDistance(firstPoint, secondPoint) { - var u = secondPoint.minus(firstPoint); u = u.times(u); - return u.x + u.y + u.z; - } - - KeyboardDevice { - id: keyboardSourceDevice - } - - MouseDevice { - id: mouseSourceDevice - sensitivity: 0.1 - } - - components: [ - - LogicalDevice { - enabled: root.enabled - actions: [ - Action { - id: leftMouseButtonAction - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.LeftButton] - } - }, - Action { - id: rightMouseButtonAction - ActionInput { - sourceDevice: mouseSourceDevice - buttons: [MouseEvent.RightButton] - } - }, - Action { - id: shiftAction - ActionInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Shift] - } - }, - Action { - id: altAction - ActionInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Alt] - } - } - ] // actions - - axes: [ - // Mouse - Axis { - id: mouseXAxis - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.X - } - }, - Axis { - id: mouseYAxis - AnalogAxisInput { - sourceDevice: mouseSourceDevice - axis: MouseDevice.Y - } - }, - // Keyboard - Axis { - id: keyboardXAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Left] - scale: -1.0 - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Right] - scale: 1.0 - } - }, - Axis { - id: keyboardZAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_PageUp] - scale: 1.0 - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_PageDown] - scale: -1.0 - } - }, - Axis { - id: keyboardYAxis - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Up] - scale: 1.0 - } - ButtonAxisInput { - sourceDevice: keyboardSourceDevice - buttons: [Qt.Key_Down] - scale: -1.0 - } - } - ] // axes - }, - - FrameAction { - onTriggered: { - // The time difference since the last frame is passed in as the - // argument dt. It is a floating point value in units of seconds. - - // Mouse input - if (d.leftMouseButtonPressed) { - if (d.rightMouseButtonPressed) { - if (zoomDistance(root.camera.position, root.camera.viewCenter) > root.zoomLimit * root.zoomLimit) { - // Dolly up to limit - root.camera.translate(Qt.vector3d(0, 0, d.translationY).times(dt), Camera.DontTranslateViewCenter); - } else { - // Too close, Dolly backwards - root.camera.translate(Qt.vector3d(0, 0, -1).times(dt), Camera.DontTranslateViewCenter); - } - } else { - // Translate - root.camera.translate(Qt.vector3d(d.translationX, d.translationY, 0).times(dt)); - } - return - } else if (d.rightMouseButtonPressed) { - // Orbit - root.camera.panAboutViewCenter(d.orbitX * dt, d.firstPersonUp); - root.camera.tiltAboutViewCenter(d.orbitY * dt); - } - // Keyboard input - if (d.altPressed) { - // Orbit - root.camera.panAboutViewCenter(d.orbitX * dt, d.firstPersonUp); - root.camera.tiltAboutViewCenter(d.orbitY * dt); - } else if (d.shiftPressed) { - if (zoomDistance(root.camera.position, root.camera.viewCenter) > root.zoomLimit * root.zoomLimit) { - // Dolly up to limit - root.camera.translate(Qt.vector3d(0, 0, d.translationY).times(dt), Camera.DontTranslateViewCenter); - } else { - // Too close, Dolly backwards - root.camera.translate(Qt.vector3d(0, 0, -1).times(dt), Camera.DontTranslateViewCenter); - } - } else { - // Translate - root.camera.translate(Qt.vector3d(d.translationX, d.translationY, d.translationZ).times(dt)); - } - } - } - ] // components -} diff --git a/src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml b/src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml deleted file mode 100644 index 70c461edd..000000000 --- a/src/quick3d/imports/extras/defaults/qml/PerVertexColorMaterial.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Lorenz Esch (TU Ilmenau). -** Contact: https://www.qt.io/licensing/ -** -** 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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/pervertexcolor.vert" - fragmentES: "qrc:/shaders/es2/pervertexcolor.frag" - vertex: "qrc:/shaders/gl3/pervertexcolor.vert" - fragment: "qrc:/shaders/gl3/pervertexcolor.frag" - } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml b/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml deleted file mode 100644 index 87373242d..000000000 --- a/src/quick3d/imports/extras/defaults/qml/PhongAlphaMaterial.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Paul Lemire -** Contact: https://www.qt.io/licensing/ -** -** 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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property color diffuse: Qt.rgba( 0.7, 0.7, 0.7, 1.0 ) - property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 ) - property real shininess: 150.0 - property real alpha: 0.5 - - property alias sourceRgbArg: alphaEffect.sourceRgbArg - property alias destinationRgbArg: alphaEffect.destinationRgbArg - property alias sourceAlphaArg: alphaEffect.sourceAlphaArg - property alias destinationAlphaArg: alphaEffect.destinationAlphaArg - property alias blendFunctionArg: alphaEffect.blendFunctionArg - - parameters: [ - Parameter { name: "alpha"; value: root.alpha }, - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { name: "kd"; value: Qt.vector3d(root.diffuse.r, root.diffuse.g, root.diffuse.b) }, - Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) }, - Parameter { name: "shininess"; value: root.shininess } - ] - - effect: DefaultAlphaEffect { id: alphaEffect } -} - diff --git a/src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml b/src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml deleted file mode 100644 index 5b770a56d..000000000 --- a/src/quick3d/imports/extras/defaults/qml/PhongMaterial.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id:root - property color ambient: Qt.rgba( 0.05, 0.05, 0.05, 1.0 ) - property color diffuse: Qt.rgba( 0.7, 0.7, 0.7, 1.0 ) - property color specular: Qt.rgba( 0.01, 0.01, 0.01, 1.0 ) - property real shininess: 150.0 - - parameters: [ - Parameter { name: "ka"; value: Qt.vector3d(root.ambient.r, root.ambient.g, root.ambient.b) }, - Parameter { name: "kd"; value: Qt.vector3d(root.diffuse.r, root.diffuse.g, root.diffuse.b) }, - Parameter { name: "ks"; value: Qt.vector3d(root.specular.r, root.specular.g, root.specular.b) }, - Parameter { name: "shininess"; value: root.shininess } - ] - - effect: DefaultEffect {} -} - diff --git a/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml b/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml deleted file mode 100644 index 00bff6f10..000000000 --- a/src/quick3d/imports/extras/defaults/qml/SkyboxEntity.qml +++ /dev/null @@ -1,151 +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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 -import Qt3D.Extras 2.0 - -Entity { - property string baseName: ""; - property string extension: ".png" - - property TextureCubeMap skyboxTexture: TextureCubeMap { - generateMipMaps: false - magnificationFilter: Texture.Linear - minificationFilter: Texture.Linear - wrapMode { - x: WrapMode.ClampToEdge - y: WrapMode.ClampToEdge - } - TextureImage { mirrored: false; face: Texture.CubeMapPositiveX; source: baseName + "_posx" + extension } - TextureImage { mirrored: false; face: Texture.CubeMapPositiveY; source: baseName + "_posy" + extension } - TextureImage { mirrored: false; face: Texture.CubeMapPositiveZ; source: baseName + "_posz" + extension } - TextureImage { mirrored: false; face: Texture.CubeMapNegativeX; source: baseName + "_negx" + extension } - TextureImage { mirrored: false; face: Texture.CubeMapNegativeY; source: baseName + "_negy" + extension } - TextureImage { mirrored: false; face: Texture.CubeMapNegativeZ; source: baseName + "_negz" + extension } - } - - ShaderProgram { - id: gl3SkyboxShader - vertexShaderCode: loadSource("qrc:/shaders/gl3/skybox.vert") - fragmentShaderCode: loadSource("qrc:/shaders/gl3/skybox.frag") - } - - ShaderProgram { - id: gl2es2SkyboxShader - vertexShaderCode: loadSource("qrc:/shaders/es2/skybox.vert") - fragmentShaderCode: loadSource("qrc:/shaders/es2/skybox.frag") - } - - CuboidMesh { - id: cuboidMesh - yzMeshResolution: Qt.size(2, 2) - xzMeshResolution: Qt.size(2, 2) - xyMeshResolution: Qt.size(2, 2) - } - - Material { - id: skyboxMaterial - parameters: Parameter { name: "skyboxTexture"; value: skyboxTexture} - - effect: Effect { - FilterKey { - id: forward - name: "renderingStyle" - value: "forward" - } - - techniques: [ - // GL3 Technique - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.CoreProfile - majorVersion: 3 - minorVersion: 1 - } - renderPasses: RenderPass { - shaderProgram: gl3SkyboxShader - renderStates: [ - // cull front faces - CullFace { mode: CullFace.Front }, - DepthTest { depthFunction: DepthTest.LessOrEqual } - ] - } - }, - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGL - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2es2SkyboxShader - renderStates: [ - CullFace { mode: CullFace.Front }, - DepthTest { depthFunction: DepthTest.LessOrEqual } - ] - } - }, - Technique { - filterKeys: [ forward ] - graphicsApiFilter { - api: GraphicsApiFilter.OpenGLES - profile: GraphicsApiFilter.NoProfile - majorVersion: 2 - minorVersion: 0 - } - renderPasses: RenderPass { - shaderProgram: gl2es2SkyboxShader - renderStates: [ - CullFace { mode: CullFace.Front }, - DepthTest { depthFunction: DepthTest.LessOrEqual } - ] - } - } - ] - } - } - - components: [cuboidMesh, skyboxMaterial] -} - diff --git a/src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml b/src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml deleted file mode 100644 index 387d8d4aa..000000000 --- a/src/quick3d/imports/extras/defaults/qml/TextureMaterial.qml +++ /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: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 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. -** -** 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.LGPL3 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-3.0.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 (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt3D.Core 2.0 -import Qt3D.Render 2.0 - -Material { - id: root - - property Texture2D texture: Texture2D {} - property alias textureOffset: texCoordOffset.offset - - parameters: [ - Parameter { - name: "diffuseTexture" - value: root.texture - }, - Parameter { - id: texCoordOffset - property vector2d offset: Qt.vector2d(0, 0) - name: "texCoordOffset" - value: offset - } - ] - - effect: DefaultEffect { - vertexES: "qrc:/shaders/es2/unlittexture.vert" - fragmentES: "qrc:/shaders/es2/unlittexture.frag" - vertex: "qrc:/shaders/gl3/unlittexture.vert" - fragment: "qrc:/shaders/gl3/unlittexture.frag" - } -} diff --git a/src/quick3d/imports/extras/importsextras.pro b/src/quick3d/imports/extras/importsextras.pro index 6a70238f4..22f753ee0 100644 --- a/src/quick3d/imports/extras/importsextras.pro +++ b/src/quick3d/imports/extras/importsextras.pro @@ -14,32 +14,6 @@ HEADERS += \ SOURCES += \ qt3dquick3dextrasplugin.cpp -load(qml_plugin) - -include(./defaults/defaults.pri) - -OTHER_FILES += \ - qmldir \ - $$QML_FILES - -# Create a resource file for qml files that need to be registered by the plugin -GENERATED_RESOURCE_FILE = $$OUT_PWD/defaults.qrc -INCLUDED_RESOURCE_FILES = $$QML_FILES -RESOURCE_CONTENT = \ - "<RCC>" \ - "<qresource prefix=\"/qt-project.org/imports/Qt3D/Extras/\">" +OTHER_FILES += qmldir -for(resourcefile, INCLUDED_RESOURCE_FILES) { - resourcefileabsolutepath = $$absolute_path($$resourcefile) - relativepath_in = $$relative_path($$resourcefileabsolutepath, $$_PRO_FILE_PWD_) - relativepath_out = $$relative_path($$resourcefileabsolutepath, $$OUT_PWD) - RESOURCE_CONTENT += "<file alias=\"$$relativepath_in\">$$relativepath_out</file>" -} - -RESOURCE_CONTENT += \ - "</qresource>" \ - "</RCC>" - -write_file($$GENERATED_RESOURCE_FILE, RESOURCE_CONTENT)|error("Aborting.") - -RESOURCES += $$GENERATED_RESOURCE_FILE +load(qml_plugin) diff --git a/src/quick3d/imports/extras/plugins.qmltypes b/src/quick3d/imports/extras/plugins.qmltypes index 6a7e1203d..a623f385c 100644 --- a/src/quick3d/imports/extras/plugins.qmltypes +++ b/src/quick3d/imports/extras/plugins.qmltypes @@ -4,10 +4,31 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.0' +// 'qmlplugindump -nonrelocatable Qt3D.Extras 2.9' Module { dependencies: ["Qt3D.Logic 2.0"] + Component { name: "Qt3DCore::QEntity"; prototype: "Qt3DCore::QNode" } + Component { + name: "Qt3DExtras::Extras::Quick::Quick3DLevelOfDetailLoader" + prototype: "Qt3DCore::QEntity" + exports: ["Qt3D.Extras/LevelOfDetailLoader 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "sources"; type: "QVariantList" } + Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true } + Property { name: "currentIndex"; type: "int" } + Property { name: "thresholdType"; type: "Qt3DRender::QLevelOfDetail::ThresholdType" } + Property { name: "thresholds"; type: "QVector<qreal>" } + Property { name: "volumeOverride"; type: "Qt3DRender::QLevelOfDetailBoundingSphere" } + Property { name: "entity"; type: "QObject"; isReadonly: true; isPointer: true } + Property { name: "source"; type: "QUrl"; isReadonly: true } + Method { + name: "createBoundingSphere" + type: "Qt3DRender::QLevelOfDetailBoundingSphere" + Parameter { name: "center"; type: "QVector3D" } + Parameter { name: "radius"; type: "float" } + } + } Component { name: "Qt3DExtras::QConeGeometry" prototype: "Qt3DRender::QGeometry" @@ -429,6 +450,723 @@ Module { } } Component { + name: "Qt3DExtras::QDiffuseMapMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/DiffuseMapMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "shininess"; type: "float" } + Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "textureScale"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "textureScaleChanged" + Parameter { name: "textureScale"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "color"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setTextureScale" + Parameter { name: "textureScale"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QDiffuseSpecularMapMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/DiffuseSpecularMapMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "shininess"; type: "float" } + Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "textureScale"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "textureScaleChanged" + Parameter { name: "textureScale"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setTextureScale" + Parameter { name: "textureScale"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QExtrudedTextGeometry" + prototype: "Qt3DRender::QGeometry" + exports: ["Qt3D.Extras/ExtrudedTextGeometry 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "text"; type: "string" } + Property { name: "font"; type: "QFont" } + Property { name: "extrusionLength"; type: "float" } + Property { + name: "positionAttribute" + type: "Qt3DRender::QAttribute" + isReadonly: true + isPointer: true + } + Property { + name: "normalAttribute" + type: "Qt3DRender::QAttribute" + isReadonly: true + isPointer: true + } + Property { + name: "indexAttribute" + type: "Qt3DRender::QAttribute" + isReadonly: true + isPointer: true + } + Signal { + name: "textChanged" + Parameter { name: "text"; type: "string" } + } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "depthChanged" + Parameter { name: "extrusionLength"; type: "float" } + } + Method { + name: "setText" + Parameter { name: "text"; type: "string" } + } + Method { + name: "setFont" + Parameter { name: "font"; type: "QFont" } + } + Method { + name: "setDepth" + Parameter { name: "extrusionLength"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QExtrudedTextMesh" + prototype: "Qt3DRender::QGeometryRenderer" + exports: ["Qt3D.Extras/ExtrudedTextMesh 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "text"; type: "string" } + Property { name: "font"; type: "QFont" } + Property { name: "depth"; type: "float" } + Signal { + name: "textChanged" + Parameter { name: "text"; type: "string" } + } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "depthChanged" + Parameter { name: "depth"; type: "float" } + } + Method { + name: "setText" + Parameter { name: "text"; type: "string" } + } + Method { + name: "setFont" + Parameter { name: "font"; type: "QFont" } + } + Method { + name: "setDepth" + Parameter { name: "depth"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QFirstPersonCameraController" + prototype: "Qt3DCore::QEntity" + exports: ["Qt3D.Extras/FirstPersonCameraController 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true } + Property { name: "linearSpeed"; type: "float" } + Property { name: "lookSpeed"; type: "float" } + Property { name: "acceleration"; type: "float" } + Property { name: "deceleration"; type: "float" } + Signal { + name: "accelerationChanged" + Parameter { name: "acceleration"; type: "float" } + } + Signal { + name: "decelerationChanged" + Parameter { name: "deceleration"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QForwardRenderer" + prototype: "Qt3DRender::QTechniqueFilter" + exports: ["Qt3D.Extras/ForwardRenderer 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "surface"; type: "QObject"; isPointer: true } + Property { name: "window"; type: "QObject"; isPointer: true } + Property { name: "viewportRect"; type: "QRectF" } + Property { name: "clearColor"; type: "QColor" } + Property { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true } + Property { name: "externalRenderTargetSize"; type: "QSize" } + Property { name: "frustumCulling"; type: "bool" } + Property { name: "gamma"; revision: 9; type: "float" } + Signal { + name: "viewportRectChanged" + Parameter { name: "viewportRect"; type: "QRectF" } + } + Signal { + name: "clearColorChanged" + Parameter { name: "clearColor"; type: "QColor" } + } + Signal { + name: "cameraChanged" + Parameter { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true } + } + Signal { + name: "surfaceChanged" + Parameter { name: "surface"; type: "QObject"; isPointer: true } + } + Signal { + name: "externalRenderTargetSizeChanged" + Parameter { name: "size"; type: "QSize" } + } + Signal { + name: "frustumCullingEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Signal { + name: "gammaChanged" + Parameter { name: "gamma"; type: "float" } + } + Method { + name: "setViewportRect" + Parameter { name: "viewportRect"; type: "QRectF" } + } + Method { + name: "setClearColor" + Parameter { name: "clearColor"; type: "QColor" } + } + Method { + name: "setCamera" + Parameter { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true } + } + Method { + name: "setSurface" + Parameter { name: "surface"; type: "QObject"; isPointer: true } + } + Method { + name: "setExternalRenderTargetSize" + Parameter { name: "size"; type: "QSize" } + } + Method { + name: "setFrustumCullingEnabled" + Parameter { name: "enabled"; type: "bool" } + } + Method { + name: "setGamma" + Parameter { name: "gamma"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QGoochMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/GoochMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "diffuse"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "cool"; type: "QColor" } + Property { name: "warm"; type: "QColor" } + Property { name: "alpha"; type: "float" } + Property { name: "beta"; type: "float" } + Property { name: "shininess"; type: "float" } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "QColor" } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "coolChanged" + Parameter { name: "cool"; type: "QColor" } + } + Signal { + name: "warmChanged" + Parameter { name: "warm"; type: "QColor" } + } + Signal { + name: "alphaChanged" + Parameter { name: "alpha"; type: "float" } + } + Signal { + name: "betaChanged" + Parameter { name: "beta"; type: "float" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setCool" + Parameter { name: "cool"; type: "QColor" } + } + Method { + name: "setWarm" + Parameter { name: "warm"; type: "QColor" } + } + Method { + name: "setAlpha" + Parameter { name: "alpha"; type: "float" } + } + Method { + name: "setBeta" + Parameter { name: "beta"; type: "float" } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QMetalRoughMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/MetalRoughMaterial 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "baseColor"; type: "QColor" } + Property { name: "metalness"; type: "float" } + Property { name: "roughness"; type: "float" } + Signal { + name: "baseColorChanged" + Parameter { name: "baseColor"; type: "QColor" } + } + Signal { + name: "metalnessChanged" + Parameter { name: "metalness"; type: "float" } + } + Signal { + name: "roughnessChanged" + Parameter { name: "roughness"; type: "float" } + } + Method { + name: "setBaseColor" + Parameter { name: "baseColor"; type: "QColor" } + } + Method { + name: "setMetalness" + Parameter { name: "metalness"; type: "float" } + } + Method { + name: "setRoughness" + Parameter { name: "roughness"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QMorphPhongMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/MorphPhongMaterial 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "diffuse"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "shininess"; type: "float" } + Property { name: "interpolator"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "QColor" } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "interpolatorChanged" + Parameter { name: "interpolator"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setInterpolator" + Parameter { name: "interpolator"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QNormalDiffuseMapAlphaMaterial" + prototype: "Qt3DExtras::QNormalDiffuseMapMaterial" + exports: ["Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0"] + exportMetaObjectRevisions: [0] + } + Component { + name: "Qt3DExtras::QNormalDiffuseMapMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/NormalDiffuseMapMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "shininess"; type: "float" } + Property { name: "textureScale"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "normalChanged" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "textureScaleChanged" + Parameter { name: "textureScale"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setNormal" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setTextureScale" + Parameter { name: "textureScale"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QNormalDiffuseSpecularMapMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "shininess"; type: "float" } + Property { name: "textureScale"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "normalChanged" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "textureScaleChanged" + Parameter { name: "textureScale"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setNormal" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setTextureScale" + Parameter { name: "textureScale"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QOrbitCameraController" + prototype: "Qt3DCore::QEntity" + exports: ["Qt3D.Extras/OrbitCameraController 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true } + Property { name: "linearSpeed"; type: "float" } + Property { name: "lookSpeed"; type: "float" } + Property { name: "zoomInLimit"; type: "float" } + } + Component { + name: "Qt3DExtras::QPerVertexColorMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/PerVertexColorMaterial 2.0"] + exportMetaObjectRevisions: [0] + } + Component { + name: "Qt3DExtras::QPhongAlphaMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/PhongAlphaMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "diffuse"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "shininess"; type: "float" } + Property { name: "alpha"; type: "float" } + Property { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + Property { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + Property { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + Property { + name: "destinationAlphaArg" + type: "Qt3DRender::QBlendEquationArguments::Blending" + } + Property { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "QColor" } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Signal { + name: "alphaChanged" + Parameter { name: "alpha"; type: "float" } + } + Signal { + name: "sourceRgbArgChanged" + Parameter { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Signal { + name: "destinationRgbArgChanged" + Parameter { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Signal { + name: "sourceAlphaArgChanged" + Parameter { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Signal { + name: "destinationAlphaArgChanged" + Parameter { + name: "destinationAlphaArg" + type: "Qt3DRender::QBlendEquationArguments::Blending" + } + } + Signal { + name: "blendFunctionArgChanged" + Parameter { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setAlpha" + Parameter { name: "alpha"; type: "float" } + } + Method { + name: "setSourceRgbArg" + Parameter { name: "sourceRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Method { + name: "setDestinationRgbArg" + Parameter { name: "destinationRgbArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Method { + name: "setSourceAlphaArg" + Parameter { name: "sourceAlphaArg"; type: "Qt3DRender::QBlendEquationArguments::Blending" } + } + Method { + name: "setDestinationAlphaArg" + Parameter { + name: "destinationAlphaArg" + type: "Qt3DRender::QBlendEquationArguments::Blending" + } + } + Method { + name: "setBlendFunctionArg" + Parameter { name: "blendFunctionArg"; type: "Qt3DRender::QBlendEquation::BlendFunction" } + } + } + Component { + name: "Qt3DExtras::QPhongMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/PhongMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "ambient"; type: "QColor" } + Property { name: "diffuse"; type: "QColor" } + Property { name: "specular"; type: "QColor" } + Property { name: "shininess"; type: "float" } + Signal { + name: "ambientChanged" + Parameter { name: "ambient"; type: "QColor" } + } + Signal { + name: "diffuseChanged" + Parameter { name: "diffuse"; type: "QColor" } + } + Signal { + name: "specularChanged" + Parameter { name: "specular"; type: "QColor" } + } + Signal { + name: "shininessChanged" + Parameter { name: "shininess"; type: "float" } + } + Method { + name: "setAmbient" + Parameter { name: "ambient"; type: "QColor" } + } + Method { + name: "setDiffuse" + Parameter { name: "diffuse"; type: "QColor" } + } + Method { + name: "setSpecular" + Parameter { name: "specular"; type: "QColor" } + } + Method { + name: "setShininess" + Parameter { name: "shininess"; type: "float" } + } + } + Component { name: "Qt3DExtras::QPlaneGeometry" prototype: "Qt3DRender::QGeometry" exports: ["Qt3D.Extras/PlaneGeometry 2.0"] @@ -525,6 +1263,39 @@ Module { } } Component { + name: "Qt3DExtras::QSkyboxEntity" + prototype: "Qt3DCore::QEntity" + exports: ["Qt3D.Extras/SkyboxEntity 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "baseName"; type: "string" } + Property { name: "extension"; type: "string" } + Property { name: "gammaCorrect"; revision: 9; type: "bool" } + Signal { + name: "baseNameChanged" + Parameter { name: "path"; type: "string" } + } + Signal { + name: "extensionChanged" + Parameter { name: "extension"; type: "string" } + } + Signal { + name: "gammaCorrectEnabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Method { + name: "setBaseName" + Parameter { name: "path"; type: "string" } + } + Method { + name: "setExtension" + Parameter { name: "extension"; type: "string" } + } + Method { + name: "setGammaCorrectEnabled" + Parameter { name: "enabled"; type: "bool" } + } + } + Component { name: "Qt3DExtras::QSphereGeometry" prototype: "Qt3DRender::QGeometry" exports: ["Qt3D.Extras/SphereGeometry 2.0"] @@ -639,6 +1410,112 @@ Module { } } Component { + name: "Qt3DExtras::QText2DEntity" + prototype: "Qt3DCore::QEntity" + exports: ["Qt3D.Extras/Text2DEntity 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "font"; type: "QFont" } + Property { name: "text"; type: "string" } + Property { name: "color"; type: "QColor" } + Property { name: "width"; type: "float" } + Property { name: "height"; type: "float" } + Signal { + name: "fontChanged" + Parameter { name: "font"; type: "QFont" } + } + Signal { + name: "colorChanged" + Parameter { name: "color"; type: "QColor" } + } + Signal { + name: "textChanged" + Parameter { name: "text"; type: "string" } + } + Signal { + name: "widthChanged" + Parameter { name: "width"; type: "float" } + } + Signal { + name: "heightChanged" + Parameter { name: "height"; type: "float" } + } + } + Component { + name: "Qt3DExtras::QTextureMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/TextureMaterial 2.0"] + exportMetaObjectRevisions: [0] + Property { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "textureOffset"; type: "QVector2D" } + Signal { + name: "textureChanged" + Parameter { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "textureOffsetChanged" + Parameter { name: "textureOffset"; type: "QVector2D" } + } + Method { + name: "setTexture" + Parameter { name: "texture"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setTextureOffset" + Parameter { name: "textureOffset"; type: "QVector2D" } + } + } + Component { + name: "Qt3DExtras::QTexturedMetalRoughMaterial" + prototype: "Qt3DRender::QMaterial" + exports: ["Qt3D.Extras/TexturedMetalRoughMaterial 2.9"] + exportMetaObjectRevisions: [0] + Property { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Property { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + Signal { + name: "baseColorChanged" + Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "metalnessChanged" + Parameter { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "roughnessChanged" + Parameter { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "ambientOcclusionChanged" + Parameter { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Signal { + name: "normalChanged" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setBaseColor" + Parameter { name: "baseColor"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setMetalness" + Parameter { name: "metalness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setRoughness" + Parameter { name: "roughness"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setAmbientOcclusion" + Parameter { name: "ambientOcclusion"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + Method { + name: "setNormal" + Parameter { name: "normal"; type: "Qt3DRender::QAbstractTexture"; isPointer: true } + } + } + Component { name: "Qt3DExtras::QTorusGeometry" prototype: "Qt3DRender::QGeometry" exports: ["Qt3D.Extras/TorusGeometry 2.0"] @@ -746,6 +1623,7 @@ Module { Parameter { name: "minorRadius"; type: "float" } } } + Component { name: "Qt3DRender::QFrameGraphNode"; prototype: "Qt3DCore::QNode" } Component { name: "Qt3DRender::QGeometry" prototype: "Qt3DCore::QNode" @@ -883,306 +1761,8 @@ Module { } } Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/DefaultAlphaEffect 2.0" - exports: ["Qt3D.Extras/DefaultAlphaEffect 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "vertexES"; type: "string" } - Property { name: "fragmentES"; type: "string" } - Property { name: "vertex"; type: "string" } - Property { name: "fragment"; type: "string" } - Property { name: "sourceRgbArg"; type: "int" } - Property { name: "destinationRgbArg"; type: "int" } - Property { name: "sourceAlphaArg"; type: "int" } - Property { name: "destinationAlphaArg"; type: "int" } - Property { name: "blendFunctionArg"; type: "int" } - } - Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/DefaultEffect 2.0" - exports: ["Qt3D.Extras/DefaultEffect 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "vertexES"; type: "string" } - Property { name: "fragmentES"; type: "string" } - Property { name: "vertex"; type: "string" } - Property { name: "fragment"; type: "string" } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/DiffuseMapMaterial 2.0" - exports: ["Qt3D.Extras/DiffuseMapMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "textureScale"; type: "double" } - Property { name: "diffuse"; type: "QUrl" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/DiffuseSpecularMapMaterial 2.0" - exports: ["Qt3D.Extras/DiffuseSpecularMapMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "textureScale"; type: "double" } - Property { name: "diffuse"; type: "QUrl" } - Property { name: "specular"; type: "QUrl" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/FirstPersonCameraController 2.0" - exports: ["Qt3D.Extras/FirstPersonCameraController 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true } - Property { name: "linearSpeed"; type: "double" } - Property { name: "lookSpeed"; type: "double" } - Property { name: "acceleration"; type: "double" } - Property { name: "deceleration"; type: "double" } - } - Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/ForwardRenderer 2.0" - exports: ["Qt3D.Extras/ForwardRenderer 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "camera"; type: "Qt3DCore::QEntity"; isPointer: true } - Property { name: "clearColor"; type: "QColor" } - Property { name: "viewportRect"; type: "QRectF" } - Property { name: "window"; type: "QObject"; isPointer: true } - } - Component { + name: "Qt3DRender::QMaterial" prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/GoochMaterial 2.0" - exports: ["Qt3D.Extras/GoochMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "diffuse"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "coolColor"; type: "QColor" } - Property { name: "warmColor"; type: "QColor" } - Property { name: "alpha"; type: "double" } - Property { name: "beta"; type: "double" } - Property { name: "shininess"; type: "double" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/NormalDiffuseMapAlphaEffect 2.0" - exports: ["Qt3D.Extras/NormalDiffuseMapAlphaEffect 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "vertexES"; type: "string" } - Property { name: "fragmentES"; type: "string" } - Property { name: "vertex"; type: "string" } - Property { name: "fragment"; type: "string" } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0" - exports: ["Qt3D.Extras/NormalDiffuseMapAlphaMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "textureScale"; type: "double" } - Property { name: "diffuse"; type: "QUrl" } - Property { name: "normal"; type: "QUrl" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/NormalDiffuseMapMaterial 2.0" - exports: ["Qt3D.Extras/NormalDiffuseMapMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "textureScale"; type: "double" } - Property { name: "diffuse"; type: "QUrl" } - Property { name: "normal"; type: "QUrl" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0" - exports: ["Qt3D.Extras/NormalDiffuseSpecularMapMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "textureScale"; type: "double" } - Property { name: "diffuse"; type: "QUrl" } - Property { name: "specular"; type: "QUrl" } - Property { name: "normal"; type: "QUrl" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QNode" - name: "Qt3D.Extras/OrbitCameraController 2.0" - exports: ["Qt3D.Extras/OrbitCameraController 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "camera"; type: "Qt3DRender::QCamera"; isPointer: true } - Property { name: "linearSpeed"; type: "double" } - Property { name: "lookSpeed"; type: "double" } - Property { name: "zoomLimit"; type: "double" } - Method { - name: "clampInputs" - type: "QVariant" - Parameter { name: "input1"; type: "QVariant" } - Parameter { name: "input2"; type: "QVariant" } - } - Method { - name: "zoomDistance" - type: "QVariant" - Parameter { name: "firstPoint"; type: "QVariant" } - Parameter { name: "secondPoint"; type: "QVariant" } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/PerVertexColorMaterial 2.0" - exports: ["Qt3D.Extras/PerVertexColorMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/PhongAlphaMaterial 2.0" - exports: ["Qt3D.Extras/PhongAlphaMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "diffuse"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "alpha"; type: "double" } - Property { name: "sourceRgbArg"; type: "int" } - Property { name: "destinationRgbArg"; type: "int" } - Property { name: "sourceAlphaArg"; type: "int" } - Property { name: "destinationAlphaArg"; type: "int" } - Property { name: "blendFunctionArg"; type: "int" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/PhongMaterial 2.0" - exports: ["Qt3D.Extras/PhongMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "ambient"; type: "QColor" } - Property { name: "diffuse"; type: "QColor" } - Property { name: "specular"; type: "QColor" } - Property { name: "shininess"; type: "double" } - Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } - Signal { - name: "effectChanged" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - Method { - name: "setEffect" - Parameter { name: "effect"; type: "QEffect"; isPointer: true } - } - } - Component { - prototype: "Qt3DCore::QComponent" - name: "Qt3D.Extras/TextureMaterial 2.0" - exports: ["Qt3D.Extras/TextureMaterial 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "texture"; type: "Qt3DRender::QTexture2D"; isPointer: true } - Property { name: "textureOffset"; type: "QVector2D" } Property { name: "effect"; type: "Qt3DRender::QEffect"; isPointer: true } Signal { name: "effectChanged" @@ -1193,4 +1773,5 @@ Module { Parameter { name: "effect"; type: "QEffect"; isPointer: true } } } + Component { name: "Qt3DRender::QTechniqueFilter"; prototype: "Qt3DRender::QFrameGraphNode" } } diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp index 55af6432b..879b79294 100644 --- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp +++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp @@ -38,69 +38,76 @@ ****************************************************************************/ #include "qt3dquick3dextrasplugin.h" -#include <Qt3DExtras/qcuboidmesh.h> + +#include <Qt3DExtras/qconegeometry.h> #include <Qt3DExtras/qconemesh.h> +#include <Qt3DExtras/qcuboidgeometry.h> +#include <Qt3DExtras/qcuboidmesh.h> +#include <Qt3DExtras/qcylindergeometry.h> #include <Qt3DExtras/qcylindermesh.h> +#include <Qt3DExtras/qdiffusemapmaterial.h> +#include <Qt3DExtras/qdiffusespecularmapmaterial.h> +#include <Qt3DExtras/qextrudedtextgeometry.h> +#include <Qt3DExtras/qextrudedtextmesh.h> +#include <Qt3DExtras/qfirstpersoncameracontroller.h> +#include <Qt3DExtras/qforwardrenderer.h> +#include <Qt3DExtras/qgoochmaterial.h> +#include <Qt3DExtras/qmetalroughmaterial.h> +#include <Qt3DExtras/qmorphphongmaterial.h> +#include <Qt3DExtras/qnormaldiffusemapalphamaterial.h> +#include <Qt3DExtras/qnormaldiffusemapmaterial.h> +#include <Qt3DExtras/qnormaldiffusespecularmapmaterial.h> +#include <Qt3DExtras/qorbitcameracontroller.h> +#include <Qt3DExtras/qpervertexcolormaterial.h> +#include <Qt3DExtras/qphongalphamaterial.h> +#include <Qt3DExtras/qphongmaterial.h> +#include <Qt3DExtras/qplanegeometry.h> #include <Qt3DExtras/qplanemesh.h> +#include <Qt3DExtras/qskyboxentity.h> +#include <Qt3DExtras/qspheregeometry.h> #include <Qt3DExtras/qspheremesh.h> -#include <Qt3DExtras/qtorusmesh.h> +#include <Qt3DExtras/qtext2dentity.h> +#include <Qt3DExtras/qtexturedmetalroughmaterial.h> +#include <Qt3DExtras/qtexturematerial.h> #include <Qt3DExtras/qtorusgeometry.h> -#include <Qt3DExtras/qspheregeometry.h> -#include <Qt3DExtras/qcuboidgeometry.h> -#include <Qt3DExtras/qplanegeometry.h> -#include <Qt3DExtras/qconegeometry.h> -#include <Qt3DExtras/qcylindergeometry.h> -#include <Qt3DExtras/qtext3dgeometry.h> -#include <Qt3DExtras/qtext3dmesh.h> -#include <Qt3DExtras/qkeyframeanimation.h> -#include <Qt3DExtras/qanimationcontroller.h> -#include <Qt3DExtras/qabstractanimation.h> -#include <Qt3DExtras/qmorphinganimation.h> -#include <Qt3DExtras/qanimationgroup.h> -#include <Qt3DExtras/qmorphtarget.h> +#include <Qt3DExtras/qtorusmesh.h> -#include <Qt3DQuickExtras/private/quick3dkeyframeanimation_p.h> -#include <Qt3DQuickExtras/private/quick3danimationgroup_p.h> -#include <Qt3DQuickExtras/private/quick3danimationcontroller_p.h> -#include <Qt3DQuickExtras/private/quick3dmorphtarget_p.h> -#include <Qt3DQuickExtras/private/quick3dmorphinganimation_p.h> +#include <Qt3DQuickExtras/private/quick3dlevelofdetailloader_p.h> #include <QtQml/qqml.h> QT_BEGIN_NAMESPACE -static const struct { - const char *type; - int major, minor; -} qmldir [] = { - // Materials - { "PhongMaterial", 2, 0 }, - { "PhongAlphaMaterial", 2, 0 }, - { "DiffuseMapMaterial", 2, 0 }, - { "DiffuseSpecularMapMaterial", 2, 0 }, - { "NormalDiffuseMapAlphaMaterial", 2, 0 }, - { "NormalDiffuseMapMaterial", 2, 0 }, - { "NormalDiffuseSpecularMapMaterial", 2, 0 }, - { "PerVertexColorMaterial", 2, 0 }, - { "GoochMaterial", 2, 0 }, - { "TextureMaterial", 2, 0 }, - // Effects - { "DefaultEffect", 2, 0 }, - { "DefaultAlphaEffect", 2, 0 }, - { "NormalDiffuseMapAlphaEffect", 2, 0 }, - // Scene Graph - { "LevelOfDetailLoader", 2, 2 }, - // FrameGraphs - { "ForwardRenderer", 2, 0 }, +void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri) +{ + // Framegraphs + qmlRegisterType<Qt3DExtras::QForwardRenderer>(uri, 2, 0, "ForwardRenderer"); + qmlRegisterRevision<Qt3DExtras::QForwardRenderer, 9>(uri, 2, 9); + // Entities - { "SkyboxEntity", 2, 0 }, + qmlRegisterType<Qt3DExtras::QSkyboxEntity>(uri, 2, 0, "SkyboxEntity"); + qmlRegisterRevision<Qt3DExtras::QSkyboxEntity, 9>(uri, 2, 9); + qmlRegisterType<Qt3DExtras::Extras::Quick::Quick3DLevelOfDetailLoader>(uri, 2, 9, "LevelOfDetailLoader"); + // Camera Controllers - { "OrbitCameraController", 2, 0 }, - { "FirstPersonCameraController", 2, 0 }, -}; + qmlRegisterType<Qt3DExtras::QFirstPersonCameraController>(uri, 2, 0, "FirstPersonCameraController"); + qmlRegisterType<Qt3DExtras::QOrbitCameraController>(uri, 2, 0, "OrbitCameraController"); + + // Materials + qmlRegisterType<Qt3DExtras::QPhongMaterial>(uri, 2, 0, "PhongMaterial"); + qmlRegisterType<Qt3DExtras::QPhongAlphaMaterial>(uri, 2, 0, "PhongAlphaMaterial"); + qmlRegisterType<Qt3DExtras::QDiffuseMapMaterial>(uri, 2, 0, "DiffuseMapMaterial"); + qmlRegisterType<Qt3DExtras::QDiffuseSpecularMapMaterial>(uri, 2, 0, "DiffuseSpecularMapMaterial"); + qmlRegisterType<Qt3DExtras::QNormalDiffuseMapAlphaMaterial>(uri, 2, 0, "NormalDiffuseMapAlphaMaterial"); + qmlRegisterType<Qt3DExtras::QNormalDiffuseMapMaterial>(uri, 2, 0, "NormalDiffuseMapMaterial"); + qmlRegisterType<Qt3DExtras::QNormalDiffuseSpecularMapMaterial>(uri, 2, 0, "NormalDiffuseSpecularMapMaterial"); + qmlRegisterType<Qt3DExtras::QPerVertexColorMaterial>(uri, 2, 0, "PerVertexColorMaterial"); + qmlRegisterType<Qt3DExtras::QGoochMaterial>(uri, 2, 0, "GoochMaterial"); + qmlRegisterType<Qt3DExtras::QTextureMaterial>(uri, 2, 0, "TextureMaterial"); + qmlRegisterType<Qt3DExtras::QMetalRoughMaterial>(uri, 2, 9, "MetalRoughMaterial"); + qmlRegisterType<Qt3DExtras::QTexturedMetalRoughMaterial>(uri, 2, 9, "TexturedMetalRoughMaterial"); + qmlRegisterType<Qt3DExtras::QMorphPhongMaterial>(uri, 2, 9, "MorphPhongMaterial"); -void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri) -{ // Meshes qmlRegisterType<Qt3DExtras::QConeMesh>(uri, 2, 0, "ConeMesh"); qmlRegisterType<Qt3DExtras::QConeGeometry>(uri, 2, 0, "ConeGeometry"); @@ -109,31 +116,19 @@ void Qt3DQuick3DExtrasPlugin::registerTypes(const char *uri) qmlRegisterType<Qt3DExtras::QCylinderMesh>(uri, 2, 0, "CylinderMesh"); qmlRegisterType<Qt3DExtras::QCylinderGeometry>(uri, 2, 0, "CylinderGeometry"); qmlRegisterType<Qt3DExtras::QPlaneMesh>(uri, 2, 0, "PlaneMesh"); + qmlRegisterRevision<Qt3DExtras::QPlaneMesh, 9>(uri, 2, 9); qmlRegisterType<Qt3DExtras::QPlaneGeometry>(uri, 2, 0, "PlaneGeometry"); + qmlRegisterRevision<Qt3DExtras::QPlaneGeometry, 9>(uri, 2, 9); qmlRegisterType<Qt3DExtras::QTorusMesh>(uri, 2, 0, "TorusMesh"); qmlRegisterType<Qt3DExtras::QTorusGeometry>(uri, 2, 0, "TorusGeometry"); qmlRegisterType<Qt3DExtras::QSphereMesh>(uri, 2, 0, "SphereMesh"); qmlRegisterType<Qt3DExtras::QSphereGeometry>(uri, 2, 0, "SphereGeometry"); // 3D Text - qmlRegisterType<Qt3DExtras::QText3DGeometry>(uri, 2, 2, "Text3DGeometry"); - qmlRegisterType<Qt3DExtras::QText3DMesh>(uri, 2, 2, "Text3DMesh"); - - qmlRegisterUncreatableType<Qt3DExtras::QAbstractAnimation>(uri, 2, 0, "AbstractAnimation", QStringLiteral("AbstractAnimation is abstract")); - qmlRegisterExtendedType<Qt3DExtras::QKeyframeAnimation, Qt3DExtras::Quick::QQuick3DKeyframeAnimation>(uri, 2, 2, "KeyframeAnimation"); - qmlRegisterExtendedType<Qt3DExtras::QAnimationGroup, Qt3DExtras::Quick::QQuick3DAnimationGroup>(uri, 2, 2, "AnimationGroup"); - qmlRegisterExtendedType<Qt3DExtras::QAnimationController, Qt3DExtras::Quick::QQuick3DAnimationController>(uri, 2, 2, "AnimationController"); - qmlRegisterExtendedType<Qt3DExtras::QMorphingAnimation, Qt3DExtras::Quick::QQuick3DMorphingAnimation>(uri, 2, 2, "MorphingAnimation"); - qmlRegisterExtendedType<Qt3DExtras::QMorphTarget, Qt3DExtras::Quick::QQuick3DMorphTarget>(uri, 2, 2, "MorphTarget"); + qmlRegisterType<Qt3DExtras::QExtrudedTextGeometry>(uri, 2, 9, "ExtrudedTextGeometry"); + qmlRegisterType<Qt3DExtras::QExtrudedTextMesh>(uri, 2, 9, "ExtrudedTextMesh"); - // Register types provided as QML files compiled into the plugin - for (int i = 0; i < int(sizeof(qmldir) / sizeof(qmldir[0])); i++) { - auto path = QLatin1String("qrc:/qt-project.org/imports/Qt3D/Extras/defaults/qml/"); - qmlRegisterType(QUrl(path + qmldir[i].type + QLatin1String(".qml")), - uri, - qmldir[i].major, qmldir[i].minor, - qmldir[i].type); - } + qmlRegisterType<Qt3DExtras::QText2DEntity>(uri, 2, 9, "Text2DEntity"); } diff --git a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h index f5ea6a7f1..f24a93b3f 100644 --- a/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h +++ b/src/quick3d/imports/extras/qt3dquick3dextrasplugin.h @@ -46,7 +46,6 @@ static void initResources() { #ifdef QT_STATIC Q_INIT_RESOURCE(qmake_Qt3D_Extras); - Q_INIT_RESOURCE(defaults); Q_INIT_RESOURCE(extras); #endif } |