diff options
author | Antti Määttä <antti.maatta@qt.io> | 2019-09-17 14:44:27 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2019-09-25 15:37:46 +0300 |
commit | 52f3ec01c0f9e7170dd375de688541baf353bf81 (patch) | |
tree | 11e11fa0d80d76c8de209549cb25e1c2e2dc316f | |
parent | 0b3c05b21496e319831db5a99986014e6f9d44cb (diff) |
Add dynamic loading example
Add example for deferred loading of images and subpresentations.
Task-number: QT3DS-3941
Change-Id: Ica8a38238141f5aff92b09d1f953e3cb58d1109a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
20 files changed, 534 insertions, 1 deletions
diff --git a/examples/studio3d/dynamicloading/StartupProgress.qml b/examples/studio3d/dynamicloading/StartupProgress.qml new file mode 100644 index 0000000..c845588 --- /dev/null +++ b/examples/studio3d/dynamicloading/StartupProgress.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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.Controls 2.5 +import QtQuick 2.12 + +Rectangle { + width: 180 + height: 60 + radius: 16 + anchors.centerIn: parent + color: "white" + antialiasing: true + property alias progressEnabled: progressBar.enabled + property alias textColor: text.color + Text { + id: text + anchors.centerIn: parent + text: "Loading presentation..." + color: "black" + + } + ProgressBar { + id: progressBar + anchors.left: text.left + anchors.top: text.bottom + width: text.width + indeterminate: true + } +} diff --git a/examples/studio3d/dynamicloading/doc/src/dynamicloading.qdoc b/examples/studio3d/dynamicloading/doc/src/dynamicloading.qdoc new file mode 100644 index 0000000..20af763 --- /dev/null +++ b/examples/studio3d/dynamicloading/doc/src/dynamicloading.qdoc @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt 3D Studio. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example dynamicloading + \title Qt 3D Studio Runtime: Dynamic Loading Example + \ingroup OpenGLRuntime-examples-qml + \brief Demonstrates how resources can be loaded dynamically. + + \e {This example demonstrates deferred loading.} + + \include examples-run.qdocinc + + \section1 Description + + The presentation consists of three slides with images, effect, subpresentation and + custom material. Images and subpresentation are loaded dynamically before entering + the slide using the \l{Presentation::preloadSlide}{preloadSlide} function and unloaded + when exiting a slide using the \l{Presentation::unloadSlide}{unloadSlide} function. + + \snippet dynamicloading/main.qml 1 +*/ diff --git a/examples/studio3d/dynamicloading/dynamicloading.pro b/examples/studio3d/dynamicloading/dynamicloading.pro new file mode 100644 index 0000000..af8ed76 --- /dev/null +++ b/examples/studio3d/dynamicloading/dynamicloading.pro @@ -0,0 +1,26 @@ +TEMPLATE = app + +QT += quick widgets qml studio3d +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Refer to the documentation for the +# deprecated API to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp + +RESOURCES += qml.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/studio3d/$$TARGET +INSTALLS += target + +OTHER_FILES += \ + doc/src/dynamicloading.qdoc diff --git a/examples/studio3d/dynamicloading/main.cpp b/examples/studio3d/dynamicloading/main.cpp new file mode 100644 index 0000000..4894be7 --- /dev/null +++ b/examples/studio3d/dynamicloading/main.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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 <QtWidgets/QApplication> +#include <QtQuick/QQuickView> +#include <qstudio3dglobal.h> + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); + + QQuickView viewer; + viewer.setSource(QUrl("qrc:/main.qml")); + viewer.setTitle(QStringLiteral("Qt 3D Studio Example")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.resize(1680, 1050); + viewer.show(); + return app.exec(); +} diff --git a/examples/studio3d/dynamicloading/main.qml b/examples/studio3d/dynamicloading/main.qml new file mode 100644 index 0000000..daa8a94 --- /dev/null +++ b/examples/studio3d/dynamicloading/main.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt 3D Studio. +** +** $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 +import QtStudio3D.OpenGL 2.4 + +Item { + id: mainview + anchors.fill: parent + visible: true + + StartupProgress { + id: progress + } + Studio3D { + id: studio3D + anchors.fill: parent + asyncInit: true + + ViewerSettings { + showRenderStats: false + scaleMode: ViewerSettings.ScaleModeCenter + } + //![1] + Presentation { + property string slidePath: "dynamicloading:Scene:Slide" + property int curSlideIndex: 1 + property int maxSlideIndex: 3 + + id: presentation + delayedLoading: true + source: "qrc:/presentation/dynamicloading.uia" + + onSlideEntered: { + console.log("Entered: " + name) + + curSlideIndex = index + 1 + if (curSlideIndex > maxSlideIndex) + curSlideIndex = 1 + console.log("preloadSlide: " + slidePath + curSlideIndex) + preloadSlide(slidePath + curSlideIndex) + } + + onSlideExited: { + console.log("Exited: " + name) + unloadSlide(name) + } + } + //![1] + onPresentationReady: progress.visible = false + } +} diff --git a/examples/studio3d/dynamicloading/presentation/dynamicloading.uia b/examples/studio3d/dynamicloading/presentation/dynamicloading.uia new file mode 100644 index 0000000..733f47d --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/dynamicloading.uia @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<application xmlns="http://qt.io/qt3dstudio/uia"> + <assets initial="dynamicloading"> + <presentation id="dynamicloading" src="presentations/dynamicloading.uip"/> + <presentation id="subpres" src="presentations/subpres.uip"/> + </assets> +</application> diff --git a/examples/studio3d/dynamicloading/presentation/effects/FullScreenTextureOverlay.effect b/examples/studio3d/dynamicloading/presentation/effects/FullScreenTextureOverlay.effect new file mode 100644 index 0000000..8cfde54 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/effects/FullScreenTextureOverlay.effect @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<Effect> + <MetaData> + <Property name="Overlay" formalName="Overlay Texture" description="Overlay texture" type="Texture" clamp="repeat" /> + <Property name="overlay_repeat" formalName="Repeat" min="0" max="50" default="1" description="Times to repeat the image over screen."/> + <Property name="alpha" formalName="Alpha" min="0" max="1" default="0.5" description="Overlay blend factor"/> + </MetaData> + <Shaders> + <Shared></Shared> + <FragmentShaderShared></FragmentShaderShared> + <Shader name="main"> + <VertexShader></VertexShader> + <FragmentShader><![CDATA[ +void frag() +{ + vec4 origColor = texture2D_0(TexCoord); + vec4 smp = texture(Overlay, TexCoord.xy * overlay_repeat); + gl_FragColor = alpha * smp + origColor; +} + ]]></FragmentShader> + </Shader> + </Shaders> + <Passes> + <Pass shader="main" input="[source]" output="[dest]"/> + </Passes> +</Effect> + + diff --git a/examples/studio3d/dynamicloading/presentation/fonts/TitilliumWeb-Regular.ttf b/examples/studio3d/dynamicloading/presentation/fonts/TitilliumWeb-Regular.ttf Binary files differnew file mode 100644 index 0000000..6da8219 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/fonts/TitilliumWeb-Regular.ttf diff --git a/examples/studio3d/dynamicloading/presentation/maps/Abstract_001_COLOR.jpg b/examples/studio3d/dynamicloading/presentation/maps/Abstract_001_COLOR.jpg Binary files differnew file mode 100644 index 0000000..97c5df3 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Abstract_001_COLOR.jpg diff --git a/examples/studio3d/dynamicloading/presentation/maps/Blue_Marble_002_COLOR.jpg b/examples/studio3d/dynamicloading/presentation/maps/Blue_Marble_002_COLOR.jpg Binary files differnew file mode 100644 index 0000000..1fab91a --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Blue_Marble_002_COLOR.jpg diff --git a/examples/studio3d/dynamicloading/presentation/maps/Ice_002_COLOR.jpg b/examples/studio3d/dynamicloading/presentation/maps/Ice_002_COLOR.jpg Binary files differnew file mode 100644 index 0000000..0e69b27 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Ice_002_COLOR.jpg diff --git a/examples/studio3d/dynamicloading/presentation/maps/Metal_Streaks.png b/examples/studio3d/dynamicloading/presentation/maps/Metal_Streaks.png Binary files differnew file mode 100644 index 0000000..f2a6d49 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Metal_Streaks.png diff --git a/examples/studio3d/dynamicloading/presentation/maps/Moon_001_COLOR.jpg b/examples/studio3d/dynamicloading/presentation/maps/Moon_001_COLOR.jpg Binary files differnew file mode 100644 index 0000000..3fd374c --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Moon_001_COLOR.jpg diff --git a/examples/studio3d/dynamicloading/presentation/maps/Rock_023_COLOR2.jpg b/examples/studio3d/dynamicloading/presentation/maps/Rock_023_COLOR2.jpg Binary files differnew file mode 100644 index 0000000..39214f9 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/Rock_023_COLOR2.jpg diff --git a/examples/studio3d/dynamicloading/presentation/maps/license.txt b/examples/studio3d/dynamicloading/presentation/maps/license.txt new file mode 100644 index 0000000..62a06f7 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/maps/license.txt @@ -0,0 +1,2 @@ +https://3dtextures.me/ distributed under the terms of +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/examples/studio3d/dynamicloading/presentation/materials/simplecustom.material b/examples/studio3d/dynamicloading/presentation/materials/simplecustom.material new file mode 100644 index 0000000..51878d2 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/materials/simplecustom.material @@ -0,0 +1,39 @@ +<Material name="simplecustom" version="1.0"> + <MetaData > + <Property formalName="Red" name="red_weight" type="Float" default="1.0" min="0" max="2.0" category="Material"/> + <Property formalName="Green" name="green_weight" type="Float" default="1.0" min="0" max="2.0" category="Material"/> + <Property formalName="Blue" name="blue_weight" type="Float" default="1.0" min="0" max="2.0" category="Material"/> + <Property formalName="Base Color" name="basecolor" type="Texture" filter="linear" minfilter="linearMipmapLinear" clamp="repeat" category="Material"/> + </MetaData> + <Shaders type="GLSL" version="330"> + <Shader> + <Shared></Shared> + <VertexShader> + </VertexShader> + <FragmentShader> +#define QT3DS_ENABLE_UV0 1 +#define QT3DS_ENABLE_WORLD_POSITION 1 +#define QT3DS_ENABLE_TEXTAN 0 +#define QT3DS_ENABLE_BINORMAL 0 + +#include "vertexFragmentBase.glsllib" + +// set shader output +out vec4 fragColor; + +void main() +{ + vec4 c = texture(basecolor, varTexCoord0.xy); + c.rgb *= vec3(red_weight, green_weight, blue_weight); + fragColor = c; +} + </FragmentShader> + </Shader> + </Shaders> + <Passes> + <ShaderKey value="7"/> + <LayerKey count="1"/> + <Pass> + </Pass> + </Passes> +</Material> diff --git a/examples/studio3d/dynamicloading/presentation/presentations/dynamicloading.uip b/examples/studio3d/dynamicloading/presentation/presentations/dynamicloading.uip new file mode 100644 index 0000000..bcde630 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/presentations/dynamicloading.uip @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="6" > + <Project > + <ProjectSettings author="" company="" presentationWidth="1920" presentationHeight="1080" maintainAspect="False" preferKtx="False" > + <CustomColors count="16" >#989898 #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Classes > + <Effect id="FullScreenTextureOverlay_u46878" name="FullScreenTextureOverlay" sourcepath="../effects/FullScreenTextureOverlay.effect" /> + <CustomMaterial id="simplecustom_u34209" name="simplecustom" sourcepath="../materials/simplecustom.material" /> + </Classes> + <Graph > + <Scene id="Scene_u58399" backgroundcolor="0.596078 0.596078 0.596078 1" bgcolorenable="True" > + <Layer id="Layer2_u19717" variants="" > + <Camera id="Camera_u13977" /> + <Light id="Light_u36115" /> + </Layer> + <Layer id="Layer_u59613" variants="" > + <Effect id="FullScreenTextureOverlay_u35802" class="#FullScreenTextureOverlay_u46878" /> + <Model id="Cone_u21790" variants="" > + <Material id="Default_u13810" > + <Image id="Default_u13810_u63711" /> + </Material> + </Model> + <Camera id="Camera_u44253" /> + <Light id="Light_u28004" /> + <Model id="Cylinder_u21298" variants="" > + <Material id="Default_u37173" > + <Image id="Default_u37173_u19494" /> + </Material> + </Model> + <Model id="Sphere_u7999" variants="" > + <Material id="Default_u28670" > + <Image id="Default_u28670_u18741" /> + </Material> + </Model> + <Model id="Rectangle_u65276" variants="" > + <CustomMaterial id="Default_u12553" name="Default" class="#simplecustom_u34209" /> + </Model> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene_u58399" > + <Add ref="#Layer_u59613" background="Transparent" backgroundcolor="0.596078 0.596078 0.596078 0.490196" disabledepthprepass="True" /> + <Add ref="#Camera_u44253" /> + <Add ref="#Light_u28004" /> + <State id="Slide1_u5883" name="Slide1" playmode="Play Through To..." > + <Set ref="#Layer_u59613" endtime="2000" /> + <Set ref="#Camera_u44253" endtime="2000" /> + <Set ref="#Light_u28004" endtime="2000" /> + <Add ref="#FullScreenTextureOverlay_u35802" name="FullScreenTextureOverlay" Overlay="../maps/Metal_Streaks.png" alpha="0.19" endtime="2000" overlay_repeat="1" > + <AnimationTrack property="alpha" type="EaseInOut" >0 0.01 100 100 0.616 0.26 100 100 2 0.09 100 100</AnimationTrack> + </Add> + <Add ref="#Cylinder_u21298" name="Cylinder" endtime="2000" scale="3 4 1" sourcepath="#Cylinder" /> + <Add ref="#Default_u37173" name="Default_animatable" blendmode="Normal" bumpamount="0.5" diffuse="1 1 1 1" diffuselightwrap="0" diffusemap="#Default_u37173_u19494" displaceamount="20" emissivecolor="1 1 1 1" emissivepower="0" fresnelPower="0" importfile="" importid="" ior="1.5" opacity="100" shaderlighting="Pixel" sourcepath="" specularamount="0" specularmodel="Default" specularroughness="0" speculartint="1 1 1 1" translucentfalloff="1" type="Material" vertexcolors="False" /> + <Add ref="#Default_u37173_u19494" sourcepath="../maps/Abstract_001_COLOR.jpg" subpresentation="" /> + </State> + <State id="Scene-Slide2_u11666" name="Slide2" playmode="Play Through To..." playthroughto="Next" > + <Set ref="#Layer_u59613" endtime="2000" /> + <Set ref="#Camera_u44253" endtime="2000" /> + <Set ref="#Light_u28004" endtime="2000" /> + <Add ref="#Layer2_u19717" name="Layer2" disabledepthprepass="False" endtime="2000" height="766" heightunits="pixels" sourcepath="subpres" top="29" width="1920" widthunits="pixels" /> + <Add ref="#Camera_u13977" endtime="2000" /> + <Add ref="#Light_u36115" endtime="2000" /> + <Add ref="#Cone_u21790" name="Cone" endtime="2000" position="-351.477 228.116 -4.69186" rotation="265 0 0" scale="2 2 2" sourcepath="#Cone" /> + <Add ref="#Default_u13810" name="Default_animatable" blendmode="Normal" bumpamount="0.5" diffuse="1 1 1 1" diffuselightwrap="0" diffusemap="#Default_u13810_u63711" displaceamount="20" emissivecolor="1 1 1 1" emissivepower="0" fresnelPower="0" importfile="" importid="" ior="1.5" opacity="100" shaderlighting="Pixel" sourcepath="" specularamount="0" specularmodel="Default" specularroughness="0" speculartint="1 1 1 1" translucentfalloff="1" type="Material" vertexcolors="False" /> + <Add ref="#Default_u13810_u63711" sourcepath="../maps/Blue_Marble_002_COLOR.jpg" subpresentation="" /> + <Add ref="#Sphere_u7999" name="Sphere" endtime="2000" position="204.727 229.668 0" scale="3 3 3" sourcepath="#Sphere" /> + <Add ref="#Default_u28670" name="Default_animatable" blendmode="Normal" bumpamount="0.5" diffuse="1 1 1 1" diffuselightwrap="0" diffusemap="#Default_u28670_u18741" displaceamount="20" emissivecolor="1 1 1 1" emissivepower="0" fresnelPower="0" importfile="" importid="" ior="1.5" opacity="100" shaderlighting="Pixel" sourcepath="" specularamount="0" specularmodel="Default" specularroughness="0" speculartint="1 1 1 1" translucentfalloff="1" type="Material" vertexcolors="False" /> + <Add ref="#Default_u28670_u18741" sourcepath="../maps/Ice_002_COLOR.jpg" subpresentation="" /> + </State> + <State id="Slide7_u8989" name="Slide3" playmode="Play Through To..." playthroughto="#Slide1_u5883" > + <Set ref="#Layer_u59613" endtime="2000" /> + <Set ref="#Camera_u44253" endtime="2000" /> + <Set ref="#Light_u28004" endtime="2000" /> + <Add ref="#Rectangle_u65276" name="Rectangle" endtime="2000" position="0 0 600" rotation="0 122 58" scale="8 8 8" shadowcaster="True" sourcepath="#Cube" /> + <Add ref="#Default_u12553" name="Default" basecolor="../maps/Rock_023_COLOR2.jpg" blue_weight="0.5" green_weight="0.68" red_weight="1.16" > + <AnimationTrack property="blue_weight" type="EaseInOut" >0 1.08 100 100 1.016 1.58 100 100 2 1.68 100 100</AnimationTrack> + <AnimationTrack property="green_weight" type="EaseInOut" >0 1.22 100 100 1.016 1.7 100 100 2 1.28 100 100</AnimationTrack> + <AnimationTrack property="red_weight" type="EaseInOut" >0 0.42 100 100 1.016 1.12 100 100 2 0.72 100 100</AnimationTrack> + </Add> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/examples/studio3d/dynamicloading/presentation/presentations/subpres.uip b/examples/studio3d/dynamicloading/presentation/presentations/subpres.uip new file mode 100644 index 0000000..6b3d8d8 --- /dev/null +++ b/examples/studio3d/dynamicloading/presentation/presentations/subpres.uip @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<UIP version="6" > + <Project > + <ProjectSettings author="" company="" presentationWidth="1920" presentationHeight="766" maintainAspect="False" preferKtx="False" > + <CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors> + </ProjectSettings> + <Graph > + <Scene id="Scene_u37264" backgroundcolor="0.521569 0.521569 0.521569 1" > + <Layer id="Layer_u43190" variants="" > + <Camera id="Camera_u16495" /> + <Light id="Light_u5451" /> + <Text id="Text_u23736" variants="" /> + <Model id="Rectangle_u54300" variants="" > + <Material id="Default_u22440" > + <Image id="Default_u22440_u62290" /> + </Material> + </Model> + </Layer> + </Scene> + </Graph> + <Logic > + <State name="Master Slide" component="#Scene_u37264" > + <Add ref="#Layer_u43190" /> + <Add ref="#Camera_u16495" /> + <Add ref="#Light_u5451" /> + <State id="Scene-Slide1_u45302" name="Slide1" > + <Add ref="#Text_u23736" name="Text" font="TitilliumWeb-Regular" position="-731.712 313.849 0" textstring="Subpresentation" /> + <Add ref="#Rectangle_u54300" name="Rectangle" scale="8 8 1" sourcepath="#Rectangle" /> + <Add ref="#Default_u22440" name="Default_animatable" blendmode="Normal" bumpamount="0.5" diffuse="1 1 1 1" diffuselightwrap="0" diffusemap="#Default_u22440_u62290" displaceamount="20" emissivecolor="1 1 1 1" emissivepower="0" fresnelPower="0" importfile="" importid="" ior="1.5" opacity="100" shaderlighting="Pixel" sourcepath="" specularamount="0" specularmodel="Default" specularroughness="0" speculartint="1 1 1 1" translucentfalloff="1" type="Material" vertexcolors="False" /> + <Add ref="#Default_u22440_u62290" sourcepath="../maps/Moon_001_COLOR.jpg" subpresentation="" /> + </State> + </State> + </Logic> + </Project> +</UIP> diff --git a/examples/studio3d/dynamicloading/qml.qrc b/examples/studio3d/dynamicloading/qml.qrc new file mode 100644 index 0000000..b4de469 --- /dev/null +++ b/examples/studio3d/dynamicloading/qml.qrc @@ -0,0 +1,19 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>StartupProgress.qml</file> + <file>presentation/effects/FullScreenTextureOverlay.effect</file> + <file>presentation/fonts/TitilliumWeb-Regular.ttf</file> + <file>presentation/maps/Abstract_001_COLOR.jpg</file> + <file>presentation/maps/Blue_Marble_002_COLOR.jpg</file> + <file>presentation/maps/Ice_002_COLOR.jpg</file> + <file>presentation/maps/license.txt</file> + <file>presentation/maps/Metal_Streaks.png</file> + <file>presentation/maps/Moon_001_COLOR.jpg</file> + <file>presentation/maps/Rock_023_COLOR2.jpg</file> + <file>presentation/materials/simplecustom.material</file> + <file>presentation/presentations/dynamicloading.uip</file> + <file>presentation/presentations/subpres.uip</file> + <file>presentation/dynamicloading.uia</file> + </qresource> +</RCC> diff --git a/examples/studio3d/studio3d.pro b/examples/studio3d/studio3d.pro index 05213bd..4eb7780 100644 --- a/examples/studio3d/studio3d.pro +++ b/examples/studio3d/studio3d.pro @@ -6,5 +6,6 @@ SUBDIRS += \ qtHaveModule(quick) { SUBDIRS += simpleqml \ qmldatainput \ - dynamicelement + dynamicelement \ + dynamicloading } |