From 8a223a9160fd319c860f282bb93ec160c4a67f3e Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Mon, 14 Oct 2019 11:21:10 +0200 Subject: Add manual test for compressed_texture Change-Id: I57111539631824f2b38f7a8e49d8ca80c189b376 Reviewed-by: Mike Krus --- .../compressed_textures/compressed_textures.pro | 12 +++ .../compressed_textures/compressed_textures.qrc | 5 + tests/manual/compressed_textures/data/16_16.png | Bin 0 -> 346 bytes .../compressed_textures/data/16_16_PNG_ASTC_7.KTX | Bin 0 -> 324 bytes .../compressed_textures/data/16_16_PNG_ASTC_8.KTX | Bin 0 -> 324 bytes .../data/16_16_PNG_ETC2_RGBA_11.KTX | Bin 0 -> 324 bytes .../data/16_16_PNG_ETC2_RGB_13.KTX | Bin 0 -> 196 bytes .../data/16_16_PNG_ETC_RGB_12.KTX | Bin 0 -> 196 bytes .../manual/compressed_textures/data/16x16-etc1.pkm | Bin 0 -> 144 bytes .../manual/compressed_textures/data/16x16-etc2.pkm | Bin 0 -> 144 bytes .../data/16x16x1-1-bc1-dx10.dds | Bin 0 -> 332 bytes .../data/16x16x1-1-bc1-nomips-dx10.dds | Bin 0 -> 276 bytes .../data/16x16x1-1-bc1-nomips.dds | Bin 0 -> 256 bytes .../compressed_textures/data/16x16x1-1-bc1.dds | Bin 0 -> 312 bytes .../data/16x16x1-1-bc3-dx10.dds | Bin 0 -> 516 bytes .../data/16x16x1-1-bc3-nomips-dx10.dds | Bin 0 -> 404 bytes .../data/16x16x1-1-bc3-nomips.dds | Bin 0 -> 384 bytes .../compressed_textures/data/16x16x1-1-bc3.dds | Bin 0 -> 496 bytes .../data/16x16x1-1-lumi-nomips.dds | Bin 0 -> 384 bytes .../compressed_textures/data/16x16x1-1-lumi.dds | Bin 0 -> 469 bytes .../data/16x16x1-1-rgb-nomips.dds | Bin 0 -> 1152 bytes .../compressed_textures/data/16x16x1-1-rgb.dds | Bin 0 -> 1492 bytes .../data/16x16x1-6-bc1-dx10.dds | Bin 0 -> 1252 bytes .../data/16x16x1-6-bc1-nomips-dx10.dds | Bin 0 -> 916 bytes .../data/16x16x1-6-bc1-nomips.dds | Bin 0 -> 896 bytes .../compressed_textures/data/16x16x1-6-bc1.dds | Bin 0 -> 1232 bytes .../data/16x16x1-6-bc3-dx10.dds | Bin 0 -> 2356 bytes .../data/16x16x1-6-bc3-nomips-dx10.dds | Bin 0 -> 1684 bytes .../data/16x16x1-6-bc3-nomips.dds | Bin 0 -> 1664 bytes .../compressed_textures/data/16x16x1-6-bc3.dds | Bin 0 -> 2336 bytes .../data/16x16x1-6-lumi-nomips.dds | Bin 0 -> 1664 bytes .../compressed_textures/data/16x16x1-6-lumi.dds | Bin 0 -> 2174 bytes .../data/16x16x1-6-rgb-nomips.dds | Bin 0 -> 6272 bytes .../compressed_textures/data/16x16x1-6-rgb.dds | Bin 0 -> 8312 bytes tests/manual/compressed_textures/main.cpp | 75 +++++++++++++ tests/manual/compressed_textures/main.qml | 118 +++++++++++++++++++++ tests/manual/manual.pro | 3 +- 37 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 tests/manual/compressed_textures/compressed_textures.pro create mode 100644 tests/manual/compressed_textures/compressed_textures.qrc create mode 100644 tests/manual/compressed_textures/data/16_16.png create mode 100644 tests/manual/compressed_textures/data/16_16_PNG_ASTC_7.KTX create mode 100644 tests/manual/compressed_textures/data/16_16_PNG_ASTC_8.KTX create mode 100644 tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGBA_11.KTX create mode 100644 tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGB_13.KTX create mode 100644 tests/manual/compressed_textures/data/16_16_PNG_ETC_RGB_12.KTX create mode 100644 tests/manual/compressed_textures/data/16x16-etc1.pkm create mode 100644 tests/manual/compressed_textures/data/16x16-etc2.pkm create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc1.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-bc3.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-lumi.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-1-rgb.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc1.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips-dx10.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-bc3.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-lumi.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds create mode 100644 tests/manual/compressed_textures/data/16x16x1-6-rgb.dds create mode 100644 tests/manual/compressed_textures/main.cpp create mode 100644 tests/manual/compressed_textures/main.qml diff --git a/tests/manual/compressed_textures/compressed_textures.pro b/tests/manual/compressed_textures/compressed_textures.pro new file mode 100644 index 000000000..37871a4cb --- /dev/null +++ b/tests/manual/compressed_textures/compressed_textures.pro @@ -0,0 +1,12 @@ +QT += 3dcore 3drender 3dinput 3dquick 3dlogic qml quick 3dquickextras + +SOURCES += \ + main.cpp + +OTHER_FILES += \ + main.qml + +RESOURCES += \ + compressed_textures.qrc + +DEFINES += DATA_DIR=\\\"$$PWD/data\\\" diff --git a/tests/manual/compressed_textures/compressed_textures.qrc b/tests/manual/compressed_textures/compressed_textures.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/tests/manual/compressed_textures/compressed_textures.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/tests/manual/compressed_textures/data/16_16.png b/tests/manual/compressed_textures/data/16_16.png new file mode 100644 index 000000000..aefb48dc4 Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16.png differ diff --git a/tests/manual/compressed_textures/data/16_16_PNG_ASTC_7.KTX b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_7.KTX new file mode 100644 index 000000000..953f300ad Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_7.KTX differ diff --git a/tests/manual/compressed_textures/data/16_16_PNG_ASTC_8.KTX b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_8.KTX new file mode 100644 index 000000000..4c23241e4 Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_8.KTX differ diff --git a/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGBA_11.KTX b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGBA_11.KTX new file mode 100644 index 000000000..01646e99a Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGBA_11.KTX differ diff --git a/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGB_13.KTX b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGB_13.KTX new file mode 100644 index 000000000..2d2efff1b Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGB_13.KTX differ diff --git a/tests/manual/compressed_textures/data/16_16_PNG_ETC_RGB_12.KTX b/tests/manual/compressed_textures/data/16_16_PNG_ETC_RGB_12.KTX new file mode 100644 index 000000000..15e30abc8 Binary files /dev/null and b/tests/manual/compressed_textures/data/16_16_PNG_ETC_RGB_12.KTX differ diff --git a/tests/manual/compressed_textures/data/16x16-etc1.pkm b/tests/manual/compressed_textures/data/16x16-etc1.pkm new file mode 100644 index 000000000..62ae2a11f Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16-etc1.pkm differ diff --git a/tests/manual/compressed_textures/data/16x16-etc2.pkm b/tests/manual/compressed_textures/data/16x16-etc2.pkm new file mode 100644 index 000000000..be391113e Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16-etc2.pkm differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds new file mode 100644 index 000000000..feacae8d1 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips-dx10.dds new file mode 100644 index 000000000..40da98cde Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds new file mode 100644 index 000000000..1dd3e1e91 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds new file mode 100644 index 000000000..e31f410d2 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds new file mode 100644 index 000000000..76c820f31 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips-dx10.dds new file mode 100644 index 000000000..0a2964f12 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds new file mode 100644 index 000000000..c8c94d85f Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds new file mode 100644 index 000000000..4a08d324a Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds new file mode 100644 index 000000000..8fdd5e3e1 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds b/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds new file mode 100644 index 000000000..82ab57958 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds new file mode 100644 index 000000000..94d06c2c4 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds b/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds new file mode 100644 index 000000000..45635dd97 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds new file mode 100644 index 000000000..209b796f0 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips-dx10.dds new file mode 100644 index 000000000..e79e29ab5 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds new file mode 100644 index 000000000..de6796d9f Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds new file mode 100644 index 000000000..92b95ae73 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds new file mode 100644 index 000000000..f56fa09fd Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips-dx10.dds new file mode 100644 index 000000000..31e137553 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips-dx10.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds new file mode 100644 index 000000000..644274601 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds new file mode 100644 index 000000000..144515bb0 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds new file mode 100644 index 000000000..baa884a36 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds b/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds new file mode 100644 index 000000000..1a4e6f46f Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds new file mode 100644 index 000000000..318a0bd35 Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds differ diff --git a/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds b/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds new file mode 100644 index 000000000..1f3c8f9cf Binary files /dev/null and b/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds differ diff --git a/tests/manual/compressed_textures/main.cpp b/tests/manual/compressed_textures/main.cpp new file mode 100644 index 000000000..ca4cf7c2d --- /dev/null +++ b/tests/manual/compressed_textures/main.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +QStringList createTextureFileList() +{ + QDir dir(QString::fromUtf8(DATA_DIR)); + return dir.entryList(); +} + +int main(int argc, char* argv[]) +{ + QGuiApplication app(argc, argv); + QQuickView view; + + QQmlContext *ctx =view.rootContext(); + ctx->setContextProperty(QStringLiteral("_pathPrefix"), QString::fromUtf8(DATA_DIR)); + ctx->setContextProperty(QStringLiteral("_texturesList"), createTextureFileList()); + + view.setSource(QUrl("qrc:/main.qml")); + view.show(); + + return app.exec(); +} diff --git a/tests/manual/compressed_textures/main.qml b/tests/manual/compressed_textures/main.qml new file mode 100644 index 000000000..b5ad0990e --- /dev/null +++ b/tests/manual/compressed_textures/main.qml @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2019 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 QtQuick 2.12 as QQ2 +import QtQuick.Scene3D 2.12 +import QtQuick.Controls 2.12 +import Qt3D.Core 2.12 +import Qt3D.Render 2.12 +import Qt3D.Input 2.12 +import Qt3D.Extras 2.12 + +QQ2.Item { + id: root + width: 1280 + height: 720 + + readonly property string textureSource: "file://" + _pathPrefix + "/" + textureSelector.textAt(textureSelector.currentIndex) + + Scene3D { + anchors.fill: parent + focus: true + aspects: ["input", "logic"] + + Entity { + id: sceneRoot + + Camera { + id: camera + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 45 + aspectRatio: 16/9 + nearPlane : 0.1 + farPlane : 1000.0 + position: Qt.vector3d(0.0, 0.0, -2.0) + upVector: Qt.vector3d(0.0, 1.0, 0.0) + viewCenter: Qt.vector3d(0.0, 0.0, 0.0) + } + + OrbitCameraController { + camera: camera + } + + components: [ + RenderSettings { + activeFrameGraph: ForwardRenderer { + clearColor: Qt.rgba(0, 0.5, 1, 1) + camera: camera + } + }, + // Event Source will be set by the Qt3DQuickWindow + InputSettings { } + ] + + Entity { + readonly property CuboidMesh mesh: CuboidMesh { } + readonly property DiffuseMapMaterial material: DiffuseMapMaterial { + diffuse: TextureLoader { + source: textureSource + } + } + components: [ mesh, material ] + } + } + } + + ComboBox { + id: textureSelector + model: _texturesList + width: 200 + } +} diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 644c9ecf9..1182886d3 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -66,7 +66,8 @@ SUBDIRS += \ qtbug-72236 \ qtbug-76766 \ shader-image-qml \ - scene3d-in-sync + scene3d-in-sync \ + compressed_textures qtHaveModule(multimedia): { SUBDIRS += \ -- cgit v1.2.3