diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2019-10-14 11:21:10 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2019-10-16 07:09:10 +0200 |
commit | 8a223a9160fd319c860f282bb93ec160c4a67f3e (patch) | |
tree | 0b98a0d93ad818f6945a7104d5442f361db8d8e5 /tests | |
parent | 8bf52f35d116f4170b76d04c7e2b86c4bbc78a8d (diff) |
Add manual test for compressed_texture
Change-Id: I57111539631824f2b38f7a8e49d8ca80c189b376
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'tests')
37 files changed, 212 insertions, 1 deletions
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 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + </qresource> +</RCC> diff --git a/tests/manual/compressed_textures/data/16_16.png b/tests/manual/compressed_textures/data/16_16.png Binary files differnew file mode 100644 index 000000000..aefb48dc4 --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16.png 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 Binary files differnew file mode 100644 index 000000000..953f300ad --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_7.KTX 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 Binary files differnew file mode 100644 index 000000000..4c23241e4 --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16_PNG_ASTC_8.KTX 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 Binary files differnew file mode 100644 index 000000000..01646e99a --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGBA_11.KTX 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 Binary files differnew file mode 100644 index 000000000..2d2efff1b --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16_PNG_ETC2_RGB_13.KTX 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 Binary files differnew file mode 100644 index 000000000..15e30abc8 --- /dev/null +++ b/tests/manual/compressed_textures/data/16_16_PNG_ETC_RGB_12.KTX diff --git a/tests/manual/compressed_textures/data/16x16-etc1.pkm b/tests/manual/compressed_textures/data/16x16-etc1.pkm Binary files differnew file mode 100644 index 000000000..62ae2a11f --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16-etc1.pkm diff --git a/tests/manual/compressed_textures/data/16x16-etc2.pkm b/tests/manual/compressed_textures/data/16x16-etc2.pkm Binary files differnew file mode 100644 index 000000000..be391113e --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16-etc2.pkm diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds Binary files differnew file mode 100644 index 000000000..feacae8d1 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc1-dx10.dds 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 Binary files differnew file mode 100644 index 000000000..40da98cde --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips-dx10.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds Binary files differnew file mode 100644 index 000000000..1dd3e1e91 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc1-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds Binary files differnew file mode 100644 index 000000000..e31f410d2 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc1.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds Binary files differnew file mode 100644 index 000000000..76c820f31 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc3-dx10.dds 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 Binary files differnew file mode 100644 index 000000000..0a2964f12 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips-dx10.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds Binary files differnew file mode 100644 index 000000000..c8c94d85f --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc3-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds b/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds Binary files differnew file mode 100644 index 000000000..4a08d324a --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-bc3.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds Binary files differnew file mode 100644 index 000000000..8fdd5e3e1 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-lumi-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds b/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds Binary files differnew file mode 100644 index 000000000..82ab57958 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-lumi.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds Binary files differnew file mode 100644 index 000000000..94d06c2c4 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-rgb-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds b/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds Binary files differnew file mode 100644 index 000000000..45635dd97 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-1-rgb.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds Binary files differnew file mode 100644 index 000000000..209b796f0 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc1-dx10.dds 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 Binary files differnew file mode 100644 index 000000000..e79e29ab5 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips-dx10.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds Binary files differnew file mode 100644 index 000000000..de6796d9f --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc1-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds Binary files differnew file mode 100644 index 000000000..92b95ae73 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc1.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds Binary files differnew file mode 100644 index 000000000..f56fa09fd --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc3-dx10.dds 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 Binary files differnew file mode 100644 index 000000000..31e137553 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips-dx10.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds Binary files differnew file mode 100644 index 000000000..644274601 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc3-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds b/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds Binary files differnew file mode 100644 index 000000000..144515bb0 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-bc3.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds Binary files differnew file mode 100644 index 000000000..baa884a36 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-lumi-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds b/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds Binary files differnew file mode 100644 index 000000000..1a4e6f46f --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-lumi.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds b/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds Binary files differnew file mode 100644 index 000000000..318a0bd35 --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-rgb-nomips.dds diff --git a/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds b/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds Binary files differnew file mode 100644 index 000000000..1f3c8f9cf --- /dev/null +++ b/tests/manual/compressed_textures/data/16x16x1-6-rgb.dds 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 <QQuickView> +#include <QGuiApplication> +#include <QQmlContext> +#include <QDir> + +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 += \ |