summaryrefslogtreecommitdiff
path: root/tests/manual/planets-qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/planets-qml')
-rw-r--r--tests/manual/planets-qml/AppleTVInput.qml155
-rw-r--r--tests/manual/planets-qml/CMakeLists.txt137
-rw-r--r--tests/manual/planets-qml/FpsDisplay.qml69
-rw-r--r--tests/manual/planets-qml/InfoSheet.qml75
-rw-r--r--tests/manual/planets-qml/Planet.qml19
-rw-r--r--tests/manual/planets-qml/PlanetButton.qml57
-rw-r--r--tests/manual/planets-qml/PlanetEffect.qml109
-rw-r--r--tests/manual/planets-qml/PlanetFrameGraph.qml76
-rw-r--r--tests/manual/planets-qml/PlanetMaterial.qml104
-rw-r--r--tests/manual/planets-qml/PlanetsLight.qml32
-rw-r--r--tests/manual/planets-qml/PlanetsMain.qml522
-rw-r--r--tests/manual/planets-qml/Ring.qml112
-rw-r--r--tests/manual/planets-qml/ShadowEffect.qml140
-rw-r--r--tests/manual/planets-qml/SolarSystem.qml924
-rw-r--r--tests/manual/planets-qml/StyledSlider.qml10
-rw-r--r--tests/manual/planets-qml/SunEffect.qml97
-rw-r--r--tests/manual/planets-qml/android/AndroidManifest.xml48
-rw-r--r--tests/manual/planets-qml/android/res/drawable-hdpi/icon.pngbin0 -> 52258 bytes
-rw-r--r--tests/manual/planets-qml/android/res/drawable-ldpi/icon.pngbin0 -> 52258 bytes
-rw-r--r--tests/manual/planets-qml/android/res/drawable-mdpi/icon.pngbin0 -> 52258 bytes
-rw-r--r--tests/manual/planets-qml/doc/images/planets-qml-example.jpgbin0 -> 68712 bytes
-rw-r--r--tests/manual/planets-qml/doc/src/planets-qml.qdoc82
-rw-r--r--tests/manual/planets-qml/images/earth.pngbin0 -> 45904 bytes
-rw-r--r--tests/manual/planets-qml/images/jupiter.pngbin0 -> 30298 bytes
-rw-r--r--tests/manual/planets-qml/images/mars.pngbin0 -> 35278 bytes
-rw-r--r--tests/manual/planets-qml/images/mercury.pngbin0 -> 62354 bytes
-rw-r--r--tests/manual/planets-qml/images/nasa/license.txt3
-rw-r--r--tests/manual/planets-qml/images/nasa/qt_attribution.json15
-rw-r--r--tests/manual/planets-qml/images/nasa/uranusringcolortrans.pngbin0 -> 341169 bytes
-rw-r--r--tests/manual/planets-qml/images/neptune.pngbin0 -> 23206 bytes
-rw-r--r--tests/manual/planets-qml/images/saturn.pngbin0 -> 39191 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/earthcloudmapcolortrans.pngbin0 -> 1830686 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/earthcloudmapspec.jpgbin0 -> 603331 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/earthmap2k.jpgbin0 -> 307630 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/earthnormal2k.jpgbin0 -> 584692 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/earthspec2k.jpgbin0 -> 185837 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/galaxy_starfield.jpgbin0 -> 521243 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/jupitermap.jpgbin0 -> 345203 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/license.txt6
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/marsmap2k.jpgbin0 -> 489786 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/marsnormal2k.jpgbin0 -> 1073295 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/mercurymap.jpgbin0 -> 534775 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/mercurynormal.jpgbin0 -> 1397792 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/moonmap2k.jpgbin0 -> 641394 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/moonnormal2k.jpgbin0 -> 1473741 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/neptunemap.jpgbin0 -> 87217 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/qt_attribution.json14
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/saturnmap.jpgbin0 -> 143493 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/saturnringcolortrans.pngbin0 -> 355950 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/sunmap.jpgbin0 -> 563238 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/uranusmap.jpgbin0 -> 40631 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/venusmap.jpgbin0 -> 555402 bytes
-rw-r--r--tests/manual/planets-qml/images/solarsystemscope/venusnormal.jpgbin0 -> 1263138 bytes
-rw-r--r--tests/manual/planets-qml/images/sun.pngbin0 -> 55203 bytes
-rw-r--r--tests/manual/planets-qml/images/uranus.pngbin0 -> 32131 bytes
-rw-r--r--tests/manual/planets-qml/images/venus.pngbin0 -> 45622 bytes
-rw-r--r--tests/manual/planets-qml/main.cpp39
-rw-r--r--tests/manual/planets-qml/networkcontroller.cpp64
-rw-r--r--tests/manual/planets-qml/networkcontroller.h30
-rw-r--r--tests/manual/planets-qml/planets-qml-images.qrc35
-rw-r--r--tests/manual/planets-qml/planets-qml.pro37
-rw-r--r--tests/manual/planets-qml/planets-qml.qrc54
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json56
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/home_icon.pngbin0 -> 1495 bytes
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/Contents.json6
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Base.lproj/Interface.storyboard53
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Info.plist33
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json18
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json28
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json18
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json18
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json18
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.h8
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.m48
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Info.plist36
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.h21
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.m146
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.pbxproj608
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.h12
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.m46
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/Contents.json95
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon120.pngbin0 -> 2629 bytes
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon180.pngbin0 -> 5401 bytes
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/LaunchScreen.storyboard27
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/Main.storyboard73
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/Info.plist45
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.h13
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m48
-rw-r--r--tests/manual/planets-qml/planets-watchos/PlanetsClient/main.m16
-rw-r--r--tests/manual/planets-qml/planets.js187
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetD.frag60
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetD.vert36
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetDB.frag56
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetDB.vert61
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetDS.frag61
-rw-r--r--tests/manual/planets-qml/shaders/es2/planetDSB.frag61
-rw-r--r--tests/manual/planets-qml/shaders/es2/sun.frag26
-rw-r--r--tests/manual/planets-qml/shaders/es2/sun.vert21
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetD.frag63
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetD.vert29
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDB.frag66
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDB.vert54
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDS.frag62
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDSB.frag67
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDShadow.frag70
-rw-r--r--tests/manual/planets-qml/shaders/gl3/planetDShadow.vert38
-rw-r--r--tests/manual/planets-qml/shaders/gl3/shadowmap.frag8
-rw-r--r--tests/manual/planets-qml/shaders/gl3/shadowmap.vert13
-rw-r--r--tests/manual/planets-qml/shaders/gl3/sun.frag30
-rw-r--r--tests/manual/planets-qml/shaders/gl3/sun.vert23
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetD.frag82
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetD.vert43
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDB.frag85
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDB.vert84
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDS.frag82
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDSB.frag87
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDShadow.frag87
-rw-r--r--tests/manual/planets-qml/shaders/rhi/planetDShadow.vert52
-rw-r--r--tests/manual/planets-qml/shaders/rhi/shadowmap.frag8
-rw-r--r--tests/manual/planets-qml/shaders/rhi/shadowmap.vert21
-rw-r--r--tests/manual/planets-qml/shaders/rhi/sun.frag30
-rw-r--r--tests/manual/planets-qml/shaders/rhi/sun.vert39
123 files changed, 6354 insertions, 0 deletions
diff --git a/tests/manual/planets-qml/AppleTVInput.qml b/tests/manual/planets-qml/AppleTVInput.qml
new file mode 100644
index 000000000..8926b54f1
--- /dev/null
+++ b/tests/manual/planets-qml/AppleTVInput.qml
@@ -0,0 +1,155 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.7
+import QtQuick.Window 2.2
+
+Item {
+ id: appleTVInput
+
+ property real xThreshold: 500
+ property real yThreshold: 300
+
+ signal swipeLeft()
+ signal swipeRight()
+ signal swipeUp()
+ signal swipeDown()
+
+ onSwipeLeft: {
+ var focusedItem = Window.window.activeFocusItem
+ if (typeof(focusedItem.swipeLeft) === "function") {
+ focusedItem.swipeLeft()
+ }
+ }
+
+ onSwipeRight: {
+ var focusedItem = Window.window.activeFocusItem
+ if (typeof(focusedItem.swipeRight) === "function") {
+ focusedItem.swipeRight()
+ }
+ }
+
+ onSwipeUp: {
+ var focusedItem = Window.window.activeFocusItem
+ if (typeof(focusedItem.swipeUp) === "function") {
+ focusedItem.swipeUp()
+ }
+ }
+
+ onSwipeDown: {
+ var focusedItem = Window.window.activeFocusItem
+ if (typeof(focusedItem.swipeDown) === "function") {
+ focusedItem.swipeDown()
+ }
+ }
+
+ MultiPointTouchArea {
+ id: multiPointTouchArea
+
+ anchors.fill: parent
+
+ property int startX: 0
+ property int startY: 0
+
+ property int pointX: 0
+ property int pointY: 0
+
+ property int xIsIncreasing: -1 // 1 - true, 0 - false, -1 - undefined
+ property int yIsIncreasing: -1 // 1 - true, 0 - false, -1 - undefined
+
+ property bool pressed: false
+
+ touchPoints: [
+ TouchPoint {
+
+ onPressedChanged: {
+ if (pressed) {
+ multiPointTouchArea.startX = x
+ multiPointTouchArea.startY = y
+ multiPointTouchArea.pressed = true
+ } else {
+ multiPointTouchArea.pressed = false
+ multiPointTouchArea.xIsIncreasing = -1
+ multiPointTouchArea.yIsIncreasing = -1
+ multiPointTouchArea.startX = 0
+ multiPointTouchArea.startY = 0
+ }
+ }
+
+ onXChanged: {
+ if (multiPointTouchArea.pressed) {
+ var newValue = x - multiPointTouchArea.startX
+
+ var focusedItem = appleTVInput.Window.window.activeFocusItem
+
+ if (focusedItem.panningEnabled) {
+ if (multiPointTouchArea.xIsIncreasing === -1) {
+ multiPointTouchArea.xIsIncreasing = (newValue > multiPointTouchArea.startX) ? 1 : 0
+ } else {
+ if (multiPointTouchArea.xIsIncreasing === 1 && newValue < multiPointTouchArea.pointX) {
+ multiPointTouchArea.startX = x
+ multiPointTouchArea.xIsIncreasing = 0
+ multiPointTouchArea.pointX = newValue
+ } else if (multiPointTouchArea.xIsIncreasing === 0 && newValue > multiPointTouchArea.pointX) {
+ multiPointTouchArea.startX = x
+ multiPointTouchArea.xIsIncreasing = 1
+ multiPointTouchArea.pointX = newValue
+ } else {
+ multiPointTouchArea.pointX = newValue
+ focusedItem.pannedHorizontally(multiPointTouchArea.pointX / (multiPointTouchArea.width / 2))
+ }
+ }
+ } else {
+ multiPointTouchArea.pointX = newValue
+
+ if (multiPointTouchArea.pointX > xThreshold) {
+ multiPointTouchArea.startX = x
+ swipeRight()
+ } else if (multiPointTouchArea.pointX < -xThreshold) {
+ multiPointTouchArea.startX = x
+ swipeLeft()
+ }
+ }
+ }
+ }
+
+ onYChanged: {
+ if (multiPointTouchArea.pressed) {
+ var newValue = multiPointTouchArea.startY - y
+
+ var focusedItem = appleTVInput.Window.window.activeFocusItem
+
+ if (focusedItem.panningEnabled) {
+ if (multiPointTouchArea.yIsIncreasing === -1) {
+ multiPointTouchArea.yIsIncreasing = (newValue > multiPointTouchArea.startY) ? 1 : 0
+ } else {
+ if (multiPointTouchArea.yIsIncreasing === 1 && newValue < multiPointTouchArea.pointY) {
+ multiPointTouchArea.startY = y
+ multiPointTouchArea.yIsIncreasing = 0
+ multiPointTouchArea.pointY = newValue
+ } else if (multiPointTouchArea.yIsIncreasing === 0 && newValue > multiPointTouchArea.pointY) {
+ multiPointTouchArea.startY = y
+ multiPointTouchArea.yIsIncreasing = 1
+ multiPointTouchArea.pointY = newValue
+ } else {
+ multiPointTouchArea.pointY = newValue
+ focusedItem.pannedVertically(multiPointTouchArea.pointY / (multiPointTouchArea.height / 2))
+ }
+ }
+ } else {
+ multiPointTouchArea.pointY = newValue
+
+ if (multiPointTouchArea.pointY > yThreshold) {
+ multiPointTouchArea.startY = y
+ swipeUp()
+ } else if (multiPointTouchArea.pointY < -yThreshold) {
+ multiPointTouchArea.startY = y
+ swipeDown()
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+}
diff --git a/tests/manual/planets-qml/CMakeLists.txt b/tests/manual/planets-qml/CMakeLists.txt
new file mode 100644
index 000000000..0ebf217ff
--- /dev/null
+++ b/tests/manual/planets-qml/CMakeLists.txt
@@ -0,0 +1,137 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(planets-qml LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+find_package(Qt6 REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DQuickInput 3DQuickRender 3DRender Concurrent Core Gui Network Qml Quick)
+
+qt_add_executable(planets-qml
+ main.cpp
+ networkcontroller.cpp networkcontroller.h
+)
+
+set_target_properties(planets-qml PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(planets-qml PUBLIC
+ Qt::3DCore
+ Qt::3DInput
+ Qt::3DQuick
+ Qt::3DQuickExtras
+ Qt::3DQuickInput
+ Qt::3DQuickRender
+ Qt::3DRender
+ Qt::Concurrent
+ Qt::Core
+ Qt::Gui
+ Qt::Network
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(planets-qml_resource_files
+ "AppleTVInput.qml"
+ "FpsDisplay.qml"
+ "InfoSheet.qml"
+ "Planet.qml"
+ "PlanetButton.qml"
+ "PlanetEffect.qml"
+ "PlanetFrameGraph.qml"
+ "PlanetMaterial.qml"
+ "PlanetsLight.qml"
+ "PlanetsMain.qml"
+ "Ring.qml"
+ "ShadowEffect.qml"
+ "SolarSystem.qml"
+ "StyledSlider.qml"
+ "SunEffect.qml"
+ "meshes/ring.obj"
+ "meshes/starfield.obj"
+ "planets.js"
+ "shaders/es2/planetD.frag"
+ "shaders/es2/planetD.vert"
+ "shaders/es2/planetDB.frag"
+ "shaders/es2/planetDB.vert"
+ "shaders/es2/planetDS.frag"
+ "shaders/es2/planetDSB.frag"
+ "shaders/es2/sun.frag"
+ "shaders/es2/sun.vert"
+ "shaders/gl3/planetD.frag"
+ "shaders/gl3/planetD.vert"
+ "shaders/gl3/planetDB.frag"
+ "shaders/gl3/planetDB.vert"
+ "shaders/gl3/planetDS.frag"
+ "shaders/gl3/planetDSB.frag"
+ "shaders/gl3/planetDShadow.frag"
+ "shaders/gl3/planetDShadow.vert"
+ "shaders/gl3/shadowmap.frag"
+ "shaders/gl3/shadowmap.vert"
+ "shaders/gl3/sun.frag"
+ "shaders/gl3/sun.vert"
+ "shaders/rhi/planetD.frag"
+ "shaders/rhi/planetD.vert"
+ "shaders/rhi/planetDB.frag"
+ "shaders/rhi/planetDB.vert"
+ "shaders/rhi/planetDS.frag"
+ "shaders/rhi/planetDSB.frag"
+ "shaders/rhi/planetDShadow.frag"
+ "shaders/rhi/planetDShadow.vert"
+ "shaders/rhi/shadowmap.frag"
+ "shaders/rhi/shadowmap.vert"
+ "shaders/rhi/sun.frag"
+ "shaders/rhi/sun.vert"
+)
+
+qt6_add_resources(planets-qml "planets-qml"
+ PREFIX
+ "/"
+ FILES
+ ${planets-qml_resource_files}
+)
+
+set(planets-qml-images_resource_files
+ "images/earth.png"
+ "images/jupiter.png"
+ "images/mars.png"
+ "images/mercury.png"
+ "images/nasa/uranusringcolortrans.png"
+ "images/neptune.png"
+ "images/saturn.png"
+ "images/solarsystemscope/earthcloudmapcolortrans.png"
+ "images/solarsystemscope/earthcloudmapspec.jpg"
+ "images/solarsystemscope/earthmap2k.jpg"
+ "images/solarsystemscope/earthnormal2k.jpg"
+ "images/solarsystemscope/earthspec2k.jpg"
+ "images/solarsystemscope/galaxy_starfield.jpg"
+ "images/solarsystemscope/jupitermap.jpg"
+ "images/solarsystemscope/license.txt"
+ "images/solarsystemscope/marsmap2k.jpg"
+ "images/solarsystemscope/marsnormal2k.jpg"
+ "images/solarsystemscope/mercurymap.jpg"
+ "images/solarsystemscope/mercurynormal.jpg"
+ "images/solarsystemscope/moonmap2k.jpg"
+ "images/solarsystemscope/moonnormal2k.jpg"
+ "images/solarsystemscope/neptunemap.jpg"
+ "images/solarsystemscope/saturnmap.jpg"
+ "images/solarsystemscope/saturnringcolortrans.png"
+ "images/solarsystemscope/sunmap.jpg"
+ "images/solarsystemscope/uranusmap.jpg"
+ "images/solarsystemscope/venusmap.jpg"
+ "images/solarsystemscope/venusnormal.jpg"
+ "images/sun.png"
+ "images/uranus.png"
+ "images/venus.png"
+)
+
+qt6_add_resources(planets-qml "planets-qml-images"
+ PREFIX
+ "/"
+ FILES
+ ${planets-qml-images_resource_files}
+)
diff --git a/tests/manual/planets-qml/FpsDisplay.qml b/tests/manual/planets-qml/FpsDisplay.qml
new file mode 100644
index 000000000..8f3052189
--- /dev/null
+++ b/tests/manual/planets-qml/FpsDisplay.qml
@@ -0,0 +1,69 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0
+
+Item {
+ id: fpsDisplayControl
+ property bool hidden: true
+ property real fps: 0.0
+
+ onHiddenChanged: {
+ if (fpsDisplayControl.hidden)
+ fpsDisplay.color = "transparent"
+ else
+ fpsDisplay.color = "#000000FF"
+ }
+
+ onFpsChanged: {
+ fpsDisplay.updateFps()
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ id: fpsDisplay
+ color: "transparent"
+
+ property real maxFps: 60.0
+ property color maxFpsColor: "#5500FF00"
+ property color minFpsColor: "#55FF0000"
+
+ function updateFps() {
+ var scale = (fps > maxFps)?1.0:(fps/maxFps)
+ var r = (1 - scale) * minFpsColor.r + scale * maxFpsColor.r
+ var g = (1 - scale) * minFpsColor.g + scale * maxFpsColor.g
+ var b = (1 - scale) * minFpsColor.b + scale * maxFpsColor.b
+ var a = (1 - scale) * minFpsColor.a + scale * maxFpsColor.a
+ fpsCauge.height = scale * fpsDisplay.height
+ fpsCauge.color = Qt.rgba(r, g, b, a)
+ }
+
+ Rectangle {
+ id: fpsCauge
+ width: parent.width
+ anchors.bottom: parent.bottom
+ visible: !fpsDisplayControl.hidden
+ }
+
+ Text {
+ id: fpsText
+ text: ""+(fps | 0)
+ font.family: "Helvetica"
+ font.pixelSize: 16
+ font.weight: Font.Light
+ color: "white"
+ anchors.fill: parent
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ visible: !fpsDisplayControl.hidden
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ fpsDisplayControl.hidden = !fpsDisplayControl.hidden
+ }
+ }
+}
+
diff --git a/tests/manual/planets-qml/InfoSheet.qml b/tests/manual/planets-qml/InfoSheet.qml
new file mode 100644
index 000000000..3f6bd3a34
--- /dev/null
+++ b/tests/manual/planets-qml/InfoSheet.qml
@@ -0,0 +1,75 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0
+
+Rectangle {
+ id: infoSheet
+
+ width: 200
+ height: 450
+ anchors.verticalCenter: parent.verticalCenter
+
+ property alias planet: planetText.planet
+ property alias radius: infoText.radius
+ property alias temperature: infoText.temperature
+ property alias orbitalPeriod: infoText.orbitalPeriod
+ property alias distance: infoText.distance
+ property alias exampleDetails: infoText.exampleDetails
+
+ Behavior on opacity { PropertyAnimation {} }
+
+ color: "black"
+
+ Text {
+ id: planetText
+ anchors.top: parent.top
+ anchors.topMargin: 20
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ property string planet: ""
+
+ font.family: "Helvetica"
+ font.pixelSize: 32
+ font.weight: Font.Light
+ color: "white"
+
+ text: "<p>" + planet + "</p>"
+ }
+
+ Text {
+ id: infoText
+ anchors.top: planetText.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ property string radius: ""
+ property string temperature: ""
+ property string orbitalPeriod: ""
+ property string distance: ""
+ property string exampleDetails: ""
+
+ font.family: "Helvetica"
+ font.pixelSize: 18
+ font.weight: Font.Light
+ lineHeight: 1.625 * 18
+ lineHeightMode: Text.FixedHeight
+ color: "white"
+
+ text: {
+ if (planet == "Solar System") {
+ "<p>" + exampleDetails + "</p>"
+ } else if (planet == "Sun") {
+ "<p>Equatorial Diameter:</p><p>" + radius + "</p></br>"
+ + "<p>Surface Temperature:</p><p>" + temperature + "</p>"
+ } else {
+ "<p>Equatorial Diameter:</p><p>" + radius + "</p></br>"
+ + "<p>Surface Temperature:</p><p>" + temperature + "</p></br>"
+ + "<p>Solar Orbit Period:</p><p>" + orbitalPeriod + "</p></br>"
+ + "<p>Distance from Sun:</p><p>" + distance + "</p>"
+ }
+ }
+
+ onLinkActivated: Qt.openUrlExternally(link)
+ }
+}
+
diff --git a/tests/manual/planets-qml/Planet.qml b/tests/manual/planets-qml/Planet.qml
new file mode 100644
index 000000000..530ef2ce0
--- /dev/null
+++ b/tests/manual/planets-qml/Planet.qml
@@ -0,0 +1,19 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Render 2.0
+import Qt3D.Extras 2.0
+
+SphereMesh {
+ property real r: 0
+ property real x: 0
+ property real y: 0
+ property real z: 0
+ property real roll: 0
+ property real tilt: 0
+
+ radius: 1.0
+ generateTangents: true
+ rings: 64
+ slices: 64
+}
diff --git a/tests/manual/planets-qml/PlanetButton.qml b/tests/manual/planets-qml/PlanetButton.qml
new file mode 100644
index 000000000..a2d8da559
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetButton.qml
@@ -0,0 +1,57 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0
+
+Rectangle {
+ id: planetButton
+
+ property alias text: planetText.text
+ property alias source: planetImage.source
+ property alias focusPlanet: planetImage.focusPlanet
+ property Item planetSelector: parent.parent
+ property int buttonSize: 70
+ property int fontSize: 16
+
+ width: buttonSize
+ height: buttonSize
+ color: "transparent"
+
+ Image {
+ id: planetImage
+ anchors.fill: parent
+ property int focusPlanet
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: { planetSelector.focusedPlanet = focusPlanet }
+ onEntered: PropertyAnimation { target: planetText; property: "opacity"; to: 1 }
+ onExited: PropertyAnimation {
+ target: planetText
+ property: "opacity"
+ to: {
+ if (planetText.text != "Solar System")
+ 0
+ else
+ 1
+ }
+ }
+ }
+ }
+
+ Text {
+ id: planetText
+ anchors.centerIn: parent
+ font.family: "Helvetica"
+ font.pixelSize: fontSize
+ font.weight: Font.Light
+ color: "white"
+ opacity: {
+ if (text == "Solar System" || (Qt.platform.os === "tvos" && planetButton.activeFocus))
+ opacity = 1
+ else
+ opacity = 0
+ }
+ }
+}
diff --git a/tests/manual/planets-qml/PlanetEffect.qml b/tests/manual/planets-qml/PlanetEffect.qml
new file mode 100644
index 000000000..307006048
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetEffect.qml
@@ -0,0 +1,109 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+
+Effect {
+ id: root
+
+ property Texture2D shadowTexture
+ property PlanetsLight light
+ property string vertexES: "qrc:/shaders/es2/planetD.vert"
+ property string fragmentES: "qrc:/shaders/es2/planetD.frag"
+ property string vertexGL: "qrc:/shaders/gl3/planetD.vert"
+ property string fragmentGL: "qrc:/shaders/gl3/planetD.frag"
+ property string vertexRHI: "qrc:/shaders/rhi/planetD.vert"
+ property string fragmentRHI: "qrc:/shaders/rhi/planetD.frag"
+
+ parameters: [
+ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection },
+ Parameter { name: "lightPosition"; value: root.light.lightPosition },
+ Parameter { name: "lightIntensity"; value: root.light.lightIntensity }
+ ]
+
+ FilterKey { id: eskey; name: "name"; value: "ES2" }
+ FilterKey { id: glkey; name: "name"; value: "Desktop" }
+ FilterKey { id: forwardkey; name : "pass"; value : "forward" }
+
+ RenderPass {
+ id: glpass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource(vertexGL)
+ fragmentShaderCode: loadSource(fragmentGL)
+ }
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: rhipass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource(vertexRHI)
+ fragmentShaderCode: loadSource(fragmentRHI)
+ }
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: espass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource(vertexES)
+ fragmentShaderCode: loadSource(fragmentES)
+ }
+ // no special render state set => use the default set of states
+ }
+
+ techniques: [
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ profile: GraphicsApiFilter.CoreProfile
+ majorVersion: 3
+ minorVersion: 2
+ }
+
+ filterKeys: [ glkey ]
+
+ renderPasses: [ glpass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ majorVersion: 2
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGLES
+ majorVersion: 2
+ minorVersion: 0
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.RHI
+ majorVersion: 1
+ minorVersion: 0
+ }
+
+ filterKeys: [ glkey ]
+
+ renderPasses: [ rhipass ]
+ }
+ ]
+}
diff --git a/tests/manual/planets-qml/PlanetFrameGraph.qml b/tests/manual/planets-qml/PlanetFrameGraph.qml
new file mode 100644
index 000000000..fac5e2687
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetFrameGraph.qml
@@ -0,0 +1,76 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+
+RenderSettings {
+ id: root
+
+ property alias viewCamera: viewCameraSelector.camera
+ property alias lightCamera: lightCameraSelector.camera
+ readonly property Texture2D shadowTexture: depthTexture
+
+ activeFrameGraph: Viewport {
+ normalizedRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
+
+ RenderSurfaceSelector {
+
+ TechniqueFilter {
+ matchAll: [ FilterKey { name: "name"; value: "Desktop" } ]
+
+ RenderPassFilter {
+ matchAny: [ FilterKey { name: "pass"; value: "shadowmap" } ]
+
+ RenderTargetSelector {
+ target: RenderTarget {
+ attachments: [
+ RenderTargetOutput {
+ objectName: "depth"
+ attachmentPoint: RenderTargetOutput.Depth
+ texture: Texture2D {
+ id: depthTexture
+ width: mainview.width
+ height: mainview.height
+ format: Texture.D24
+ generateMipMaps: false
+ magnificationFilter: Texture.Linear
+ minificationFilter: Texture.Linear
+ wrapMode {
+ x: WrapMode.ClampToEdge
+ y: WrapMode.ClampToEdge
+ }
+ comparisonFunction: Texture.CompareLessEqual
+ comparisonMode: Texture.CompareRefToTexture
+ }
+ }
+ ]
+ }
+
+ ClearBuffers {
+ buffers: ClearBuffers.DepthBuffer
+ clearColor: Qt.rgba(0., 0., 0., 1.)
+
+ CameraSelector {
+ id: lightCameraSelector
+ }
+ }
+ }
+ }
+ }
+
+ RenderPassFilter {
+ matchAny: [ FilterKey { name: "pass"; value: "forward" } ]
+
+ ClearBuffers {
+ buffers: ClearBuffers.ColorDepthBuffer
+
+ CameraSelector {
+ id: viewCameraSelector
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/manual/planets-qml/PlanetMaterial.qml b/tests/manual/planets-qml/PlanetMaterial.qml
new file mode 100644
index 000000000..9fcfd09fe
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetMaterial.qml
@@ -0,0 +1,104 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+import QtQuick 2.1
+
+Material {
+ id: root
+ property color ambientLight: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ property color diffuseColor: Qt.rgba(0.7, 0.7, 0.7, 1.0)
+ property color specularColor: Qt.rgba(0.5, 0.5, 0.5, 1.0)
+ property real shininess: 150.0
+ property string diffuseMap
+ property string specularMap
+ property string normalMap
+ property real textureScale: 1.0
+ property real opacity: 1.0
+
+ parameters: [
+ Parameter {
+ name: "ambient"
+ value: Qt.vector3d(root.ambientLight.r, root.ambientLight.g, root.ambientLight.b)
+ },
+ Parameter {
+ name: "diffuse"
+ value: Qt.vector3d(root.diffuseColor.r, root.diffuseColor.g, root.diffuseColor.b)
+ },
+ Parameter {
+ name: "specular"
+ value: Qt.vector3d(root.specularColor.r, root.specularColor.g, root.specularColor.b)
+ },
+ Parameter {
+ name: "shininess"
+ value: root.shininess
+ },
+ 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
+ source: diffuseMap
+ }
+ }
+ },
+ 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
+ // Get rid of runtime warnings. It's safe, as the texture just isn't used
+ source: specularMap !== "" ? specularMap
+ : "qrc:/images/solarsystemscope/uranusmap.jpg"
+ }
+ }
+ },
+ Parameter {
+ name: "normalTexture"
+ value: Texture2D {
+ id: normalTexture
+ minificationFilter: Texture.Linear
+ magnificationFilter: Texture.Linear
+ wrapMode {
+ x: WrapMode.Repeat
+ y: WrapMode.Repeat
+ }
+ maximumAnisotropy: 16.0
+ TextureImage {
+ id: normalTextureImage
+ // Get rid of runtime warnings. It's safe, as the texture just isn't used
+ source: normalMap !== "" ? normalMap
+ : "qrc:/images/solarsystemscope/uranusmap.jpg"
+ }
+ }
+ },
+ Parameter {
+ name: "texCoordScale"
+ value: textureScale
+ },
+ Parameter {
+ name: "opacity"
+ value: opacity
+ }
+ ]
+}
diff --git a/tests/manual/planets-qml/PlanetsLight.qml b/tests/manual/planets-qml/PlanetsLight.qml
new file mode 100644
index 000000000..7a76ff53d
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetsLight.qml
@@ -0,0 +1,32 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+
+Entity {
+ id: root
+
+ property alias near: lightCamera.nearPlane
+ property alias ratio: lightCamera.aspectRatio
+
+ property vector3d lightPosition: Qt.vector3d(0.0, 0.0, 0.0)
+ property vector3d lightIntensity: Qt.vector3d(1.0, 1.0, 1.0)
+
+ readonly property Camera lightCamera: lightCamera
+ readonly property matrix4x4 lightViewProjection:
+ lightCamera.projectionMatrix.times(lightCamera.viewMatrix)
+
+ Camera {
+ id: lightCamera
+ objectName: "lightCameraLens"
+ projectionType: CameraLens.PerspectiveProjection
+ fieldOfView: 30
+ nearPlane: 2500000.0
+ farPlane: 10000000.0
+ position: root.lightPosition
+ viewCenter: Qt.vector3d(0.0, 0.0, 0.0)
+ upVector: Qt.vector3d(0.0, 1.0, 0.0)
+ }
+}
diff --git a/tests/manual/planets-qml/PlanetsMain.qml b/tests/manual/planets-qml/PlanetsMain.qml
new file mode 100644
index 000000000..4a3ec2545
--- /dev/null
+++ b/tests/manual/planets-qml/PlanetsMain.qml
@@ -0,0 +1,522 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0
+import QtQuick.Window 2.2
+import QtQuick.Scene3D 2.0
+import "planets.js" as Planets
+
+Item {
+ id: mainview
+ width: 1280
+ height: 768
+ visible: true
+ property int focusedPlanet: 100
+ property int oldPlanet: 0
+ property int frames: 0
+ property int sliderLength: (width < height) ? width / 2 : height / 2
+ property real textSize: sliderLength / 20
+ property real planetButtonSize: (height < 2200) ? (height / 13) : 200
+
+ Connections {
+ target: networkController
+
+ function onCommandAccepted() {
+ var focusedItem = mainview.Window.window.activeFocusItem
+ if (focusedItem && focusedItem.panningEnabled) {
+ focusedItem.panningEnabled = false
+ }
+
+ switch (command) {
+ case "selectPlanet":
+ mainview.focusedPlanet = Planets.planetId(decodeURIComponent(value))
+ planetButtonView.forceActiveFocus()
+ planetButtonView.currentIndex = Planets.planetIndex(value)
+ break
+ case "setRotationSpeed":
+ rotationSpeedSlider.forceActiveFocus()
+ rotationSpeedSlider.value = rotationSpeedSlider.from +
+ ((rotationSpeedSlider.to - rotationSpeedSlider.from) * value)
+ break
+ case "setViewingDistance":
+ viewingDistanceSlider.forceActiveFocus()
+ viewingDistanceSlider.value = viewingDistanceSlider.from +
+ ((viewingDistanceSlider.to - viewingDistanceSlider.from) * value)
+ break
+ case "setPlanetSize":
+ planetSizeSlider.forceActiveFocus()
+ planetSizeSlider.value = planetSizeSlider.from +
+ ((planetSizeSlider.to - planetSizeSlider.from) * value)
+ break
+ }
+ }
+ }
+
+ //! [0]
+ Scene3D {
+ anchors.fill: parent
+ aspects: ["render", "logic", "input"]
+
+ SolarSystem { id: solarsystem }
+ }
+ //! [0]
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton
+ onClicked:
+ focusedPlanet = 100
+ }
+
+ //! [1]
+ onFocusedPlanetChanged: {
+ if (focusedPlanet == 100) {
+ info.opacity = 0
+ updatePlanetInfo()
+ } else {
+ updatePlanetInfo()
+ info.opacity = 1
+ }
+
+ solarsystem.changePlanetFocus(oldPlanet, focusedPlanet)
+ oldPlanet = focusedPlanet
+ }
+ //! [1]
+
+ ListModel {
+ id: planetModel
+
+ ListElement {
+ name: "Sun"
+ radius: "109 x Earth"
+ temperature: "5 778 K"
+ orbitalPeriod: ""
+ distance: ""
+ planetImageSource: "qrc:/images/sun.png"
+ planetNumber: 0
+ }
+ ListElement {
+ name: "Mercury"
+ radius: "0.3829 x Earth"
+ temperature: "80-700 K"
+ orbitalPeriod: "87.969 d"
+ distance: "0.387 098 AU"
+ planetImageSource: "qrc:/images/mercury.png"
+ planetNumber: 1
+ }
+ ListElement {
+ name: "Venus"
+ radius: "0.9499 x Earth"
+ temperature: "737 K"
+ orbitalPeriod: "224.701 d"
+ distance: "0.723 327 AU"
+ planetImageSource: "qrc:/images/venus.png"
+ planetNumber: 2
+ }
+ ListElement {
+ name: "Earth"
+ radius: "6 378.1 km"
+ temperature: "184-330 K"
+ orbitalPeriod: "365.256 d"
+ distance: "149598261 km (1 AU)"
+ planetImageSource: "qrc:/images/earth.png"
+ planetNumber: 3
+ }
+ ListElement {
+ name: "Mars"
+ radius: "0.533 x Earth"
+ temperature: "130-308 K"
+ orbitalPeriod: "686.971 d"
+ distance: "1.523679 AU"
+ planetImageSource: "qrc:/images/mars.png"
+ planetNumber: 4
+ }
+ ListElement {
+ name: "Jupiter"
+ radius: "11.209 x Earth"
+ temperature: "112-165 K"
+ orbitalPeriod: "4332.59 d"
+ distance: "5.204267 AU"
+ planetImageSource: "qrc:/images/jupiter.png"
+ planetNumber: 5
+ }
+ ListElement {
+ name: "Saturn"
+ radius: "9.4492 x Earth"
+ temperature: "84-134 K"
+ orbitalPeriod: "10759.22 d"
+ distance: "9.5820172 AU"
+ planetImageSource: "qrc:/images/saturn.png"
+ planetNumber: 6
+ }
+ ListElement {
+ name: "Uranus"
+ radius: "4.007 x Earth"
+ temperature: "49-76 K"
+ orbitalPeriod: "30687.15 d"
+ distance: "19.189253 AU"
+ planetImageSource: "qrc:/images/uranus.png"
+ planetNumber: 7
+ }
+ ListElement {
+ name: "Neptune"
+ radius: "3.883 x Earth"
+ temperature: "55-72 K"
+ orbitalPeriod: "60190.03 d"
+ distance: "30.070900 AU"
+ planetImageSource: "qrc:/images/neptune.png"
+ planetNumber: 8
+ }
+ ListElement {
+ name: "Solar System"
+ planetImageSource: ""
+ planetNumber: 100 // Defaults to solar system
+ }
+ }
+
+ Component {
+ id: planetButtonDelegate
+ PlanetButton {
+ source: model.planetImageSource
+ text: model.name
+ focusPlanet: model.planetNumber
+ planetSelector: mainview
+ buttonSize: planetButtonSize
+ fontSize: textSize
+
+ scale: activeFocus ? 1.4 : 1.0
+
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 200
+ }
+ }
+
+ signal swipeUp()
+ signal swipeDown()
+ signal swipeLeft()
+
+ onSwipeUp: {
+ if (planetButtonView.currentIndex > 0) {
+ planetButtonView.currentIndex--
+ } else {
+ rotationSpeedSlider.forceActiveFocus()
+ }
+ }
+
+ onSwipeDown: {
+ if (planetButtonView.currentIndex < planetButtonView.count - 1) {
+ planetButtonView.currentIndex++
+ } else {
+ planetSizeSlider.forceActiveFocus()
+ }
+ }
+
+ onSwipeLeft: {
+ if (index <= planetButtonView.count / 2) {
+ rotationSpeedSlider.forceActiveFocus()
+ } else {
+ planetSizeSlider.forceActiveFocus()
+ }
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Select) {
+ planetSelector.focusedPlanet = focusPlanet
+ }
+ }
+ }
+ }
+
+ ListView {
+ id: planetButtonView
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: planetButtonSize / 2
+ height: childrenRect.height
+ spacing: planetButtonSize / 6
+ width: planetButtonSize * 1.4
+ interactive: false
+ model: planetModel
+ delegate: planetButtonDelegate
+ }
+
+ InfoSheet {
+ id: info
+ width: 400
+ anchors.right: planetButtonView.left
+ anchors.rightMargin: 40
+ opacity: 1
+
+ // Set initial information for Solar System
+ planet: "Solar System"
+ exampleDetails: "This example shows a 3D model of the Solar</p>" +
+ "<p>System comprised of the Sun and the eight</p>" +
+ "<p>planets orbiting the Sun.</p></br>" +
+ "<p>The example is implemented using Qt3D.</p>" +
+ "<p>The textures and images used in the example</p>" +
+ "<p>are Copyright (c) by James Hastings-Trew,</p>" +
+ "<a href=\"http://planetpixelemporium.com/planets.html\">" +
+ "http://planetpixelemporium.com/planets.html</a>"
+ }
+
+ function updatePlanetInfo() {
+ info.width = 200
+
+ if (focusedPlanet !== 100) {
+ info.planet = planetModel.get(focusedPlanet).name
+ info.radius = planetModel.get(focusedPlanet).radius
+ info.temperature = planetModel.get(focusedPlanet).temperature
+ info.orbitalPeriod = planetModel.get(focusedPlanet).orbitalPeriod
+ info.distance = planetModel.get(focusedPlanet).distance
+ }
+ }
+
+ Row {
+ anchors.top: parent.top
+ anchors.topMargin: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ spacing: 10
+ scale: rotationSpeedSlider.activeFocus ? 1.4 : 1.0
+ opacity: rotationSpeedSlider.activeFocus ? 1.0 : 0.5
+
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 200
+ }
+ }
+
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+
+ font.family: "Helvetica"
+ font.pixelSize: textSize
+ font.weight: Font.Light
+ color: rotationSpeedSlider.panningEnabled ? "#80c342" : "#ffffff"
+ text: "Rotation Speed"
+ }
+
+ StyledSlider {
+ id: rotationSpeedSlider
+ anchors.verticalCenter: parent.verticalCenter
+ width: sliderLength
+ value: 0.2
+ from: 0
+ to: 1
+ onValueChanged: solarsystem.changeSpeed(value)
+
+ focus: Qt.platform.os === "tvos" ? true : false
+
+ property bool panningEnabled: false
+ signal swipeDown()
+ signal swipeLeft()
+ signal swipeRight()
+ signal pannedHorizontally(real p)
+ signal pannedVertically(real p)
+
+ onSwipeDown: {
+ planetSizeSlider.forceActiveFocus()
+ }
+
+ onSwipeLeft: {
+ viewingDistanceSlider.forceActiveFocus()
+ }
+
+ onSwipeRight: {
+ planetButtonView.currentIndex = 0
+ planetButtonView.forceActiveFocus()
+ }
+
+ onPannedHorizontally: {
+ var step = (to - from) / 30
+
+ if (p > 0) {
+ value += step
+ } else {
+ value -= step
+ }
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Select) {
+ panningEnabled = !panningEnabled
+ }
+ }
+ }
+ }
+
+ Column {
+ anchors.left: parent.left
+ anchors.leftMargin: 30
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 10
+ scale: viewingDistanceSlider.activeFocus ? 1.4 : 1.0
+ opacity: viewingDistanceSlider.activeFocus ? 1.0 : 0.5
+
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 200
+ }
+ }
+
+ StyledSlider {
+ id: viewingDistanceSlider
+
+ anchors.horizontalCenter: parent.horizontalCenter
+ orientation: Qt.Vertical
+ height: sliderLength
+ value: 1
+ from: 1
+ to: 2
+ //! [2]
+ onValueChanged: solarsystem.changeCameraDistance(value)
+ //! [2]
+
+ property bool panningEnabled: false
+ signal swipeUp()
+ signal swipeDown()
+ signal swipeRight()
+ signal pannedHorizontally(real p)
+ signal pannedVertically(real p)
+
+ onSwipeUp: {
+ rotationSpeedSlider.forceActiveFocus()
+ }
+
+ onSwipeDown: {
+ planetSizeSlider.forceActiveFocus()
+ }
+
+ onSwipeRight: {
+ planetButtonView.currentIndex = 0
+ planetButtonView.forceActiveFocus()
+ }
+
+ onPannedVertically: {
+ var step = (to - from) / 30
+
+ if (p > 0) {
+ value += step
+ } else {
+ value -= step
+ }
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Select) {
+ panningEnabled = !panningEnabled
+ }
+ }
+ }
+
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ font.family: "Helvetica"
+ font.pixelSize: textSize
+ font.weight: Font.Light
+ color: viewingDistanceSlider.panningEnabled ? "#80c342" : "#ffffff"
+ text: "Viewing\nDistance"
+ }
+ }
+
+ Row {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ spacing: 10
+ scale: planetSizeSlider.activeFocus ? 1.4 : 1.0
+ opacity: planetSizeSlider.activeFocus ? 1.0 : 0.5
+
+ Behavior on scale {
+ PropertyAnimation {
+ duration: 200
+ }
+ }
+
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ font.family: "Helvetica"
+ font.pixelSize: textSize
+ font.weight: Font.Light
+ color: planetSizeSlider.panningEnabled ? "#80c342" : "#ffffff"
+ text: "Planet Size"
+ }
+
+ StyledSlider {
+ id: planetSizeSlider
+ anchors.verticalCenter: parent.verticalCenter
+ width: sliderLength
+ value: 1200
+ from: 1
+ to: 2000
+ onValueChanged: solarsystem.changeScale(value, false)
+
+ property bool panningEnabled: false
+ signal swipeUp()
+ signal swipeLeft()
+ signal swipeRight()
+ signal pannedHorizontally(real p)
+ signal pannedVertically(real p)
+
+ onSwipeUp: {
+ rotationSpeedSlider.forceActiveFocus()
+ }
+
+ onSwipeLeft: {
+ viewingDistanceSlider.forceActiveFocus()
+ }
+
+ onSwipeRight: {
+ planetButtonView.currentIndex = planetButtonView.count - 1
+ planetButtonView.forceActiveFocus()
+ }
+
+ onPannedHorizontally: {
+ var step = (to - from) / 30
+
+ if (p > 0) {
+ value += step
+ } else {
+ value -= step
+ }
+ }
+
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Select) {
+ panningEnabled = !panningEnabled
+ }
+ }
+ }
+ }
+
+ // FPS display, initially hidden, clicking will show it
+ FpsDisplay {
+ id: fpsDisplay
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ width: 32
+ height: 64
+ hidden: true
+ }
+
+ Timer {
+ interval: 1000
+ repeat: true
+ running: !fpsDisplay.hidden
+ onTriggered: {
+ fpsDisplay.fps = frames
+ frames = 0
+ }
+ onRunningChanged: frames = 0
+ }
+
+ Loader {
+ anchors.fill: parent
+
+ source: Qt.platform.os === "tvos" ? "AppleTVInput.qml" : ""
+ }
+}
diff --git a/tests/manual/planets-qml/Ring.qml b/tests/manual/planets-qml/Ring.qml
new file mode 100644
index 000000000..441f89ad5
--- /dev/null
+++ b/tests/manual/planets-qml/Ring.qml
@@ -0,0 +1,112 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Render 2.0
+
+// TODO: Once support for meshes from arrays is implemented, replace ring.obj with that
+Mesh {
+ property real innerRadius
+ property real outerRadius
+ /*
+ property real ringSegments
+
+ property var vertices: []
+ property var faces: []
+ property var faceVertexUvs: []
+ */
+
+ source: "qrc:/meshes/ring.obj"
+
+ // Converted from the _RingGeometry() method in the threex.planets.js extension.
+ /*
+ function makeRing() {
+ innerRadius = innerRadius || 0
+ outerRadius = outerRadius || 50
+ var thetaSegments = ringSegments || 8
+ console.log(innerRadius + "," + outerRadius + "," + thetaSegments)
+
+ var normal = Qt.vector3d(0, 0, 1)
+
+ for (var i = 0; i < thetaSegments; i++) {
+ var angleLo = (i / thetaSegments) * Math.PI * 2
+ var angleHi = ((i + 1) / thetaSegments) * Math.PI * 2
+
+ var vertex1 = Qt.vector3d(innerRadius * Math.cos(angleLo),
+ innerRadius * Math.sin(angleLo),
+ 0)
+ var vertex2 = Qt.vector3d(outerRadius * Math.cos(angleLo),
+ outerRadius * Math.sin(angleLo),
+ 0)
+ var vertex3 = Qt.vector3d(innerRadius * Math.cos(angleHi),
+ innerRadius * Math.sin(angleHi),
+ 0)
+ var vertex4 = Qt.vector3d(outerRadius * Math.cos(angleHi),
+ outerRadius * Math.sin(angleHi),
+ 0)
+
+ vertices.push(vertex1)
+ vertices.push(vertex2)
+ vertices.push(vertex3)
+ vertices.push(vertex4)
+
+ var vertexIdx = i * 4
+
+ // Create the first triangle
+ var face = Qt.vector4d(vertexIdx + 0, vertexIdx + 1, vertexIdx + 2, normal)
+ var uvs = []
+
+ var uv = Qt.vector2d(0, 0)
+ uvs.push(uv)
+ uv = Qt.vector2d(1, 0)
+ uvs.push(uv)
+ uv = Qt.vector2d(0, 1)
+ uvs.push(uv)
+
+ faces.push(face)
+ //faceVertexUvs[0].push(uvs)
+ faceVertexUvs.push(uvs)
+
+ // Create the second triangle
+ face = Qt.vector4d(vertexIdx + 2, vertexIdx + 1, vertexIdx + 3, normal)
+ uvs = []
+
+ uv = Qt.vector2d(0, 1)
+ uvs.push(uv)
+ uv = Qt.vector2d(1, 0)
+ uvs.push(uv)
+ uv = Qt.vector2d(1, 1)
+ uvs.push(uv)
+
+ faces.push(face)
+ //faceVertexUvs[0].push(uvs)
+ faceVertexUvs.push(uvs)
+ }
+
+ computeFaceNormals()
+ }
+
+ // Converted from the computeFaceNormals() method in the three.js extension.
+ function computeFaceNormals() {
+ var cb = Qt.vector3d(0, 0, 0)
+ var ab = Qt.vector3d(0, 0, 0)
+
+ for (var f = 0, fl = faces.length; f < fl; f ++) {
+ var face = faces[f]
+
+ var vA = vertices[face.x]
+ var vB = vertices[face.y]
+ var vC = vertices[face.z]
+
+ cb = vC.minus(vB)
+ ab = vA.minus(vB)
+ cb = cb.crossProduct(ab)
+
+ cb = cb.normalized()
+
+ face.w = cb
+ }
+ }
+ */
+}
+
+
diff --git a/tests/manual/planets-qml/ShadowEffect.qml b/tests/manual/planets-qml/ShadowEffect.qml
new file mode 100644
index 000000000..4b8992f24
--- /dev/null
+++ b/tests/manual/planets-qml/ShadowEffect.qml
@@ -0,0 +1,140 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+
+Effect {
+ id: root
+
+ property Texture2D shadowTexture
+ property PlanetsLight light
+
+ parameters: [
+ Parameter { name: "lightViewProjection"; value: root.light.lightViewProjection },
+ Parameter { name: "lightPosition"; value: root.light.lightPosition },
+ Parameter { name: "lightIntensity"; value: root.light.lightIntensity },
+ Parameter { name: "shadowMapTexture"; value: root.shadowTexture }
+ ]
+
+ FilterKey { id: desktopkey; name: "name"; value: "Desktop" }
+ FilterKey { id: shadowkey; name: "pass"; value: "shadowmap" }
+ FilterKey { id: forwardkey; name : "pass"; value : "forward" }
+ FilterKey { id: eskey; name: "name"; value: "ES2" }
+
+ RenderPass {
+ id: shadowpass
+ filterKeys: [ shadowkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/shadowmap.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/shadowmap.frag")
+ }
+
+ renderStates: [
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
+ DepthTest { depthFunction: DepthTest.Less }
+ ]
+ }
+
+ RenderPass {
+ id: glpass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/planetDShadow.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/planetDShadow.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: rhishadowpass
+ filterKeys: [ shadowkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/rhi/shadowmap.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/rhi/shadowmap.frag")
+ }
+
+ renderStates: [
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
+ DepthTest { depthFunction: DepthTest.Less }
+ ]
+ }
+
+
+ RenderPass {
+ id: rhipass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/rhi/planetDShadow.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/rhi/planetDShadow.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: espass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/es2/planetD.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/planetD.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+
+ techniques: [
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ profile: GraphicsApiFilter.CoreProfile
+ majorVersion: 3
+ minorVersion: 2
+ }
+
+ filterKeys: [ desktopkey ]
+
+ renderPasses: [ shadowpass, glpass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ majorVersion: 2
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGLES
+ majorVersion: 2
+ minorVersion: 0
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.RHi
+ majorVersion: 1
+ minorVersion: 0
+ }
+
+ filterKeys: [ desktopkey ]
+
+ renderPasses: [ rhishadowpass, rhipass ]
+ }
+ ]
+}
diff --git a/tests/manual/planets-qml/SolarSystem.qml b/tests/manual/planets-qml/SolarSystem.qml
new file mode 100644
index 000000000..7630a4eb5
--- /dev/null
+++ b/tests/manual/planets-qml/SolarSystem.qml
@@ -0,0 +1,924 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0 as QQ2
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+import Qt3D.Input 2.0
+import Qt3D.Logic 2.0
+import Qt3D.Extras 2.0
+
+import "planets.js" as Planets
+
+Entity {
+ id: sceneRoot
+
+ property bool ready: false
+
+ property real cameraNear: 0
+ property real xLookAtOffset: 0
+ property real yLookAtOffset: 0
+ property real zLookAtOffset: 0
+ property real xCameraOffset: 0
+ property real yCameraOffset: 0
+ property real zCameraOffset: 0
+
+ property var planetData
+ property var planets: []
+
+ property vector3d defaultUp: Qt.vector3d(0, 1, 0)
+ property vector3d defaultCameraPosition: Qt.vector3d(Planets.solarDistance,
+ Planets.solarDistance,
+ Planets.solarDistance)
+ property vector3d tiltAxis: Qt.vector3d(0, 0, 1)
+ property vector3d rollAxis: Qt.vector3d(0, 1, 0)
+ property real cameraDistance: 1
+ property vector3d oldCameraPosition
+ property vector3d oldFocusedPlanetPosition
+
+ property color ambientStrengthStarfield: "#000000"
+ property color ambientStrengthSun: "#ffffff"
+ property color ambientStrengthClouds: "#000000"
+ property color ambientStrengthRing: "#111111"
+ property color ambientStrengthPlanet: "#222222"
+ property real shininessSpecularMap: 50.0
+ property real shininessClouds: 10.0
+ property real shininessBasic: 1.0
+
+ property real saturnRingInnerRadius
+ property real saturnRingOuterRadius
+ property real uranusRingInnerRadius
+ property real uranusRingOuterRadius
+
+ // Time variables
+ property int year: 2000
+ property int month: 1
+ property int day: 1
+ // Time scale formula based on http://www.stjarnhimlen.se/comp/ppcomp.html
+ property real startD: 367 * year - 7 * (year + (month + 9) / 12) / 4 + 275 * month / 9 + day - 730530
+ property real oldTimeD: startD
+ property real currTimeD: startD
+ property real deltaTimeD: 0
+ property real daysPerFrame
+ property real daysPerFrameScale
+
+ property real planetScale
+
+ property bool focusedScaling: false
+ property int focusedMinimumScale: 20
+ property real actualScale
+
+ // Animate solar system with LogicComponent
+ FrameAction {
+ onTriggered: {
+ frames++
+ animate(focusedPlanet)
+ }
+ }
+
+ PlanetsLight {
+ id: light
+ ratio: width / height
+ }
+
+ Camera {
+ id: camera
+ projectionType: CameraLens.PerspectiveProjection
+ fieldOfView: 45
+ aspectRatio: width / height
+ nearPlane: 2500.0
+ farPlane: 20000.0
+ position: defaultCameraPosition
+ upVector: defaultUp
+ viewCenter: Qt.vector3d( xLookAtOffset, yLookAtOffset, zLookAtOffset )
+ }
+
+ FirstPersonCameraController { camera: camera }
+
+ components: [
+ PlanetFrameGraph {
+ id: framegraph
+ viewCamera: camera
+ lightCamera: light.lightCamera
+ },
+ InputSettings {}
+ ]
+
+ PlanetEffect {
+ id: effectD
+ light: light
+ }
+
+ PlanetEffect {
+ id: effectDB
+ light: light
+ vertexES: "qrc:/shaders/es2/planetDB.vert"
+ fragmentES: "qrc:/shaders/es2/planetDB.frag"
+ vertexGL: "qrc:/shaders/gl3/planetDB.vert"
+ fragmentGL: "qrc:/shaders/gl3/planetDB.frag"
+ vertexRHI: "qrc:/shaders/rhi/planetDB.vert"
+ fragmentRHI: "qrc:/shaders/rhi/planetDB.frag"
+ }
+
+ PlanetEffect {
+ id: effectDSB
+ light: light
+ vertexES: "qrc:/shaders/es2/planetDB.vert"
+ fragmentES: "qrc:/shaders/es2/planetDSB.frag"
+ vertexGL: "qrc:/shaders/gl3/planetDB.vert"
+ fragmentGL: "qrc:/shaders/gl3/planetDSB.frag"
+ vertexRHI: "qrc:/shaders/rhi/planetDB.vert"
+ fragmentRHI: "qrc:/shaders/rhi/planetDSB.frag"
+ }
+
+ PlanetEffect {
+ id: cloudEffect
+ light: light
+ vertexES: "qrc:/shaders/es2/planetD.vert"
+ fragmentES: "qrc:/shaders/es2/planetDS.frag"
+ vertexGL: "qrc:/shaders/gl3/planetD.vert"
+ fragmentGL: "qrc:/shaders/gl3/planetDS.frag"
+ vertexRHI: "qrc:/shaders/rhi/planetD.vert"
+ fragmentRHI: "qrc:/shaders/rhi/planetDS.frag"
+ }
+
+ SunEffect {
+ id: sunEffect
+ }
+
+ ShadowEffect {
+ id: shadowMapEffect
+ shadowTexture: framegraph.shadowTexture
+ light: light
+ }
+
+ //! [2]
+ QQ2.Component.onCompleted: {
+ planetData = Planets.loadPlanetData()
+ // Push in the correct order
+ planets.push(sun)
+ planets.push(mercury)
+ planets.push(venus)
+ planets.push(earth)
+ planets.push(mars)
+ planets.push(jupiter)
+ planets.push(saturn)
+ planets.push(uranus)
+ planets.push(neptune)
+ planets.push(moon)
+ // TODO: Once support for creating meshes from arrays is implemented take these into use
+ //saturnRing.makeRing()
+ //uranusRing.makeRing()
+ saturnRingOuterRadius = planetData[Planets.SATURN].radius + Planets.saturnOuterRadius
+ saturnRingInnerRadius = planetData[Planets.SATURN].radius + 0.006630
+ uranusRingOuterRadius = planetData[Planets.URANUS].radius + Planets.uranusOuterRadius
+ uranusRingInnerRadius = planetData[Planets.URANUS].radius + 0.002
+ ready = true
+ changeScale(1200)
+ changeSpeed(0.2)
+ setLookAtOffset(Planets.SUN)
+ }
+ //! [2]
+
+ //! [0]
+ QQ2.NumberAnimation {
+ id: lookAtOffsetAnimation
+ target: sceneRoot
+ properties: "xLookAtOffset, yLookAtOffset, zLookAtOffset"
+ to: 0
+// easing.type: Easing.InOutQuint
+ duration: 1250
+ }
+
+ QQ2.NumberAnimation {
+ id: cameraOffsetAnimation
+ target: sceneRoot
+ properties: "xCameraOffset, yCameraOffset, zCameraOffset"
+ to: 0
+// easing.type: Easing.InOutQuint
+ duration: 2500
+ }
+ //! [0]
+
+ QQ2.Behavior on cameraNear {
+ QQ2.PropertyAnimation {
+// easing.type: Easing.InOutQuint
+ duration: 2500
+ }
+ }
+
+ function changePlanetFocus(oldPlanet, focusedPlanet) {
+ setOldPlanet(oldPlanet, focusedPlanet)
+ setLookAtOffset(focusedPlanet)
+ setCameraOffset(oldPlanet, focusedPlanet)
+ lookAtOffsetAnimation.restart()
+ cameraOffsetAnimation.restart()
+ }
+
+ function setOldPlanet(oldPlanet, focusedPlanet) {
+ oldCameraPosition = camera.position
+
+ var planet = 0
+ if (oldPlanet !== Planets.SOLAR_SYSTEM)
+ planet = oldPlanet
+ oldFocusedPlanetPosition = Qt.vector3d(planets[planet].x,
+ planets[planet].y,
+ planets[planet].z)
+ checkScaling(focusedPlanet)
+ }
+
+ function setScale(value, focused) {
+ // Save actual scale
+ if (!focused)
+ actualScale = value
+
+ // Limit minimum scaling in focus mode to avoid jitter caused by rounding errors
+ if (value <= focusedMinimumScale && (focusedScaling || focused))
+ planetScale = focusedMinimumScale
+ else
+ planetScale = actualScale
+ return planetScale
+ }
+
+ function checkScaling(focusedPlanet) {
+ if (focusedPlanet !== Planets.SOLAR_SYSTEM) {
+ // Limit minimum scaling in focus mode to avoid jitter caused by rounding errors
+ if (actualScale <= focusedMinimumScale) {
+ planetScale = focusedMinimumScale
+ changeScale(focusedMinimumSfocusedPlanetcale, true)
+ }
+ focusedScaling = true
+ } else if (focusedScaling === true) {
+ // Restore normal scaling
+ focusedScaling = false
+ changeScale(actualScale, false)
+ }
+ }
+
+ function setLookAtOffset(focusedPlanet) {
+ var offset = oldFocusedPlanetPosition
+
+ var planet = 0
+ if (focusedPlanet !== Planets.SOLAR_SYSTEM)
+ planet = focusedPlanet
+
+ var focusedPlanetPosition = Qt.vector3d(planets[planet].x,
+ planets[planet].y,
+ planets[planet].z)
+ offset = offset.minus(focusedPlanetPosition)
+
+ xLookAtOffset = offset.x
+ yLookAtOffset = offset.y
+ zLookAtOffset = offset.z
+ }
+
+ function setCameraOffset(oldPlanet, focusedPlanet) {
+ var offset = oldCameraPosition
+
+ var planet = 0
+ if (focusedPlanet !== Planets.SOLAR_SYSTEM)
+ planet = focusedPlanet
+
+ var newCameraPosition = getNewCameraPosition(focusedPlanet, Planets.getOuterRadius(planet))
+
+ if (focusedPlanet !== Planets.SUN)
+ offset = offset.minus(newCameraPosition)
+
+ if (oldPlanet === Planets.SOLAR_SYSTEM && focusedPlanet === Planets.SUN) {
+ xCameraOffset = Math.abs(offset.x)
+ yCameraOffset = Math.abs(offset.y)
+ zCameraOffset = Math.abs(offset.z)
+ } else { // from a planet to another
+ xCameraOffset = offset.x
+ yCameraOffset = offset.y
+ zCameraOffset = offset.z
+ }
+ }
+
+ function getNewCameraPosition(focusedPlanet, radius) {
+ var position
+ if (focusedPlanet === Planets.SOLAR_SYSTEM) {
+ position = defaultCameraPosition
+ position = position.times(cameraDistance)
+ } else if (focusedPlanet === Planets.SUN) {
+ position = Qt.vector3d(radius * planetScale * 2,
+ radius * planetScale * 2,
+ radius * planetScale * 2)
+ position = position.times(cameraDistance)
+ } else {
+ var vec1 = Qt.vector3d(planets[focusedPlanet].x,
+ planets[focusedPlanet].y,
+ planets[focusedPlanet].z)
+ var vec2 = defaultUp
+ vec1 = vec1.normalized()
+ vec2 = vec2.crossProduct(vec1)
+ vec2 = vec2.times(radius * planetScale * cameraDistance * 4)
+ vec2 = vec2.plus(Qt.vector3d(planets[focusedPlanet].x,
+ planets[focusedPlanet].y,
+ planets[focusedPlanet].z))
+ vec1 = Qt.vector3d(0, radius * planetScale, 0)
+ vec2 = vec2.plus(vec1)
+ position = vec2
+ }
+ return position
+ }
+
+ function advanceTime(focusedPlanet) {
+ if (focusedPlanet === Planets.SOLAR_SYSTEM)
+ daysPerFrame = daysPerFrameScale * 10
+ else
+ daysPerFrame = daysPerFrameScale * planetData[focusedPlanet].period / 100.0
+
+ // Advance the time in days
+ oldTimeD = currTimeD
+ currTimeD = currTimeD + daysPerFrame
+ deltaTimeD = currTimeD - oldTimeD
+ }
+
+ function positionPlanet(i) {
+ var planet = planetData[i]
+ var target = planets[i]
+
+ if (i !== Planets.SUN) {
+ // Calculate the planet orbital elements from the current time in days
+ var N = (planet.N1 + planet.N2 * currTimeD) * Math.PI / 180
+ var iPlanet = (planet.i1 + planet.i2 * currTimeD) * Math.PI / 180
+ var w = (planet.w1 + planet.w2 * currTimeD) * Math.PI / 180
+ var a = planet.a1 + planet.a2 * currTimeD
+ var e = planet.e1 + planet.e2 * currTimeD
+ var M = (planet.M1 + planet.M2 * currTimeD) * Math.PI / 180
+ var E = M + e * Math.sin(M) * (1.0 + e * Math.cos(M))
+
+ var xv = a * (Math.cos(E) - e)
+ var yv = a * (Math.sqrt(1.0 - e * e) * Math.sin(E))
+ var v = Math.atan2(yv, xv)
+
+ // Calculate the distance (radius)
+ // TODO: Math.hypot() is ES6 and QML JS is only ES5 currently. A patch to QtQml is
+ // required to get Math.hypot() to work.
+ //var r = Math.hypot(xv, yv)
+ var r = Math.sqrt(Math.pow(xv, 2) + Math.pow(yv, 2))
+
+ // From http://www.davidcolarusso.com/astro/
+ // Modified to compensate for the right handed coordinate system of OpenGL
+ var xh = r * (Math.cos(N) * Math.cos(v + w)
+ - Math.sin(N) * Math.sin(v + w) * Math.cos(iPlanet))
+ var zh = -r * (Math.sin(N) * Math.cos(v + w)
+ + Math.cos(N) * Math.sin(v + w) * Math.cos(iPlanet))
+ var yh = r * (Math.sin(w + v) * Math.sin(iPlanet))
+
+ // Apply the position offset from the center of orbit to the bodies
+ var centerOfOrbit = planet.centerOfOrbit
+ target.x = planets[centerOfOrbit].x + xh * Planets.auScale
+ target.y = planets[centerOfOrbit].y + yh * Planets.auScale
+ target.z = planets[centerOfOrbit].z + zh * Planets.auScale
+ }
+ // Calculate the rotation (roll) of the bodies. Tilt does not change.
+ target.roll += (deltaTimeD / planet.period) * 360 // In degrees
+ }
+
+ function changeScale(scale, focused) {
+ if (!ready)
+ return
+
+ var scaling = setScale(scale, focused)
+ sun.r = planetData[Planets.SUN].radius * scaling / 10
+ mercury.r = planetData[Planets.MERCURY].radius * scaling
+ venus.r = planetData[Planets.VENUS].radius * scaling
+ earth.r = planetData[Planets.EARTH].radius * scaling
+ earthClouds.r = planetData[Planets.EARTH].radius * scaling * 1.02
+ moon.r = planetData[Planets.MOON].radius * scaling
+ mars.r = planetData[Planets.MARS].radius * scaling
+ jupiter.r = planetData[Planets.JUPITER].radius * scaling
+ saturn.r = planetData[Planets.SATURN].radius * scaling
+ saturnRing.outerRadius = saturnRingOuterRadius * scaling
+ saturnRing.innerRadius = saturnRingInnerRadius * scaling
+ uranus.r = planetData[Planets.URANUS].radius * scaling
+ uranusRing.outerRadius = uranusRingOuterRadius * scaling
+ uranusRing.innerRadius = uranusRingInnerRadius * scaling
+ neptune.r = planetData[Planets.NEPTUNE].radius * scaling
+ }
+
+ function changeSpeed(speed) {
+ daysPerFrameScale = speed
+ }
+
+ function changeCameraDistance(distance) {
+ cameraDistance = distance
+ }
+
+ //! [3]
+ function animate(focusedPlanet) {
+ if (!ready)
+ return
+
+ advanceTime(focusedPlanet)
+ for (var i = 0; i <= Planets.NUM_SELECTABLE_PLANETS; i++)
+ positionPlanet(i)
+
+ updateCamera(focusedPlanet)
+ }
+ //! [3]
+
+ function updateCamera(focusedPlanet) {
+ // Get the appropriate near plane position for the camera and animate it with QML animations
+ var outerRadius = Planets.getOuterRadius(focusedPlanet)
+ cameraNear = outerRadius
+ camera.nearPlane = cameraNear
+ light.near = cameraNear
+
+ // Calculate position
+ var cameraPosition = getNewCameraPosition(focusedPlanet, outerRadius)
+ var cameraOffset = Qt.vector3d(xCameraOffset, yCameraOffset, zCameraOffset)
+ cameraPosition = cameraPosition.plus(cameraOffset)
+
+ // Calculate look-at point
+ var lookAtPlanet = Planets.SUN
+ if (focusedPlanet !== Planets.SOLAR_SYSTEM)
+ lookAtPlanet = focusedPlanet
+ var cameraLookAt = Qt.vector3d(planets[lookAtPlanet].x,
+ planets[lookAtPlanet].y,
+ planets[lookAtPlanet].z)
+ var lookAtOffset = Qt.vector3d(xLookAtOffset, yLookAtOffset, zLookAtOffset)
+ cameraLookAt = cameraLookAt.plus(lookAtOffset)
+
+ // Set position and look-at
+ camera.viewCenter = cameraLookAt
+ camera.position = Qt.vector3d(cameraPosition.x, cameraPosition.y, cameraPosition.z)
+ camera.upVector = defaultUp
+ }
+
+ //
+ // STARFIELD
+ //
+
+ Entity {
+ id: starfieldEntity
+
+ Mesh {
+ id: starfield
+ source: "qrc:/meshes/starfield.obj"
+ }
+
+ PlanetMaterial {
+ id: materialStarfield
+ effect: effectD
+ ambientLight: ambientStrengthStarfield
+ specularColor: Qt.rgba(0.0, 0.0, 0.0, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/galaxy_starfield.jpg"
+ shininess: 1000000.0
+ }
+
+ property Transform transformStarfield: Transform {
+ scale: 8500
+ translation: Qt.vector3d(0, 0, 0)
+ }
+
+ components: [ starfield, materialStarfield, transformStarfield ]
+ }
+
+ //
+ // SUN
+ //
+
+ Entity {
+ id: sunEntity
+
+ Planet {
+ id: sun
+ tilt: planetData[Planets.SUN].tilt
+ }
+
+ PlanetMaterial {
+ id: materialSun
+ effect: sunEffect
+ ambientLight: ambientStrengthSun
+ diffuseMap: "qrc:/images/solarsystemscope/sunmap.jpg"
+ }
+
+ property Transform transformSun: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(sun.x, sun.y, sun.z))
+ m.rotate(sun.tilt, tiltAxis)
+ m.rotate(sun.roll, rollAxis)
+ m.scale(sun.r)
+ return m
+ }
+ }
+
+ components: [ sun, materialSun, transformSun ]
+ }
+
+ //
+ // PLANETS
+ //
+
+ // MERCURY
+
+ Entity {
+ id: mercuryEntity
+
+ Planet {
+ id: mercury
+ tilt: planetData[Planets.MERCURY].tilt
+ }
+
+ PlanetMaterial {
+ id: materialMercury
+ effect: effectDB
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/mercurymap.jpg"
+ normalMap: "qrc:/images/solarsystemscope/mercurynormal.jpg"
+ shininess: shininessSpecularMap
+ }
+
+ property Transform transformMercury: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(mercury.x, mercury.y, mercury.z))
+ m.rotate(mercury.tilt, tiltAxis)
+ m.rotate(mercury.roll, rollAxis)
+ m.scale(mercury.r)
+ return m
+ }
+ }
+
+ components: [ mercury, materialMercury, transformMercury ]
+ }
+
+ // VENUS
+
+ Entity {
+ id: venusEntity
+
+ Planet {
+ id: venus
+ tilt: planetData[Planets.VENUS].tilt
+ }
+
+ PlanetMaterial {
+ id: materialVenus
+ effect: effectDB
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/venusmap.jpg"
+ normalMap: "qrc:/images/solarsystemscope/venusnormal.jpg"
+ shininess: shininessSpecularMap
+ }
+
+ property Transform transformVenus: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(venus.x, venus.y, venus.z))
+ m.rotate(venus.tilt, tiltAxis)
+ m.rotate(venus.roll, rollAxis)
+ m.scale(venus.r)
+ return m
+ }
+ }
+
+ components: [ venus, materialVenus, transformVenus ]
+ }
+
+ // EARTH
+
+ //! [1]
+ Entity {
+ id: earthEntity
+
+ Planet {
+ id: earth
+ tilt: planetData[Planets.EARTH].tilt
+ }
+
+ PlanetMaterial {
+ id: materialEarth
+ effect: effectDSB
+ ambientLight: ambientStrengthPlanet
+ diffuseMap: "qrc:/images/solarsystemscope/earthmap2k.jpg"
+ specularMap: "qrc:/images/solarsystemscope/earthspec2k.jpg"
+ normalMap: "qrc:/images/solarsystemscope/earthnormal2k.jpg"
+ shininess: shininessSpecularMap
+ }
+
+ property Transform transformEarth: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(earth.x, earth.y, earth.z))
+ m.rotate(earth.tilt, tiltAxis)
+ m.rotate(earth.roll, rollAxis)
+ m.scale(earth.r)
+ return m
+ }
+ }
+
+ components: [ earth, materialEarth, transformEarth ]
+ }
+ //! [1]
+
+ // EARTH CLOUDS
+
+ Entity {
+ id: earthCloudsEntity
+
+ Planet {
+ id: earthClouds
+ tilt: planetData[Planets.EARTH].tilt
+ }
+
+ PlanetMaterial {
+ id: materialEarthClouds
+ effect: cloudEffect
+ ambientLight: ambientStrengthClouds
+ diffuseMap: "qrc:/images/solarsystemscope/earthcloudmapcolortrans.png"
+ specularMap: "qrc:/images/solarsystemscope/earthcloudmapspec.jpg"
+ shininess: shininessClouds
+ opacity: 0.2
+ }
+
+ property Transform transformEarthClouds: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(earth.x, earth.y, earth.z))
+ m.rotate(earth.tilt, tiltAxis)
+ m.rotate(earth.roll / 1.2, rollAxis)
+ m.scale(earthClouds.r)
+ return m
+ }
+ }
+
+ components: [ earthClouds, materialEarthClouds, transformEarthClouds ]
+ }
+
+ // MOON
+
+ Entity {
+ id: moonEntity
+
+ Planet {
+ id: moon
+ tilt: planetData[Planets.MOON].tilt
+ }
+
+ PlanetMaterial {
+ id: materialMoon
+ effect: effectDB
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/moonmap2k.jpg"
+ normalMap: "qrc:/images/solarsystemscope/moonnormal2k.jpg"
+ shininess: shininessSpecularMap
+ }
+
+ property Transform transformMoon: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(moon.x, moon.y, moon.z))
+ m.rotate(moon.tilt, tiltAxis)
+ m.rotate(moon.roll, rollAxis)
+ m.scale(moon.r)
+ return m
+ }
+ }
+
+ components: [ moon, materialMoon, transformMoon ]
+ }
+
+ // MARS
+
+ Entity {
+ id: marsEntity
+
+ Planet {
+ id: mars
+ tilt: planetData[Planets.MARS].tilt
+ }
+
+ PlanetMaterial {
+ id: materialMars
+ effect: effectDB
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/marsmap2k.jpg"
+ normalMap: "qrc:/images/solarsystemscope/marsnormal2k.jpg"
+ shininess: shininessSpecularMap
+ }
+
+ property Transform transformMars: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(mars.x, mars.y, mars.z))
+ m.rotate(mars.tilt, tiltAxis)
+ m.rotate(mars.roll, rollAxis)
+ m.scale(mars.r)
+ return m
+ }
+ }
+
+ components: [ mars, materialMars, transformMars ]
+ }
+
+ // JUPITER
+
+ Entity {
+ id: jupiterEntity
+
+ Planet {
+ id: jupiter
+ tilt: planetData[Planets.JUPITER].tilt
+ }
+
+ PlanetMaterial {
+ id: materialJupiter
+ effect: effectD
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/jupitermap.jpg"
+ shininess: shininessBasic
+ }
+
+ property Transform transformJupiter: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(jupiter.x, jupiter.y, jupiter.z))
+ m.rotate(jupiter.tilt, tiltAxis)
+ m.rotate(jupiter.roll, rollAxis)
+ m.scale(jupiter.r)
+ return m
+ }
+ }
+
+ components: [ jupiter, materialJupiter, transformJupiter ]
+ }
+
+ // SATURN
+
+ Entity {
+ id: saturnEntity
+
+ Planet {
+ id: saturn
+ tilt: planetData[Planets.SATURN].tilt
+ }
+
+ PlanetMaterial {
+ id: materialSaturn
+ effect: shadowMapEffect
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/saturnmap.jpg"
+ shininess: shininessBasic
+ }
+
+ property Transform transformSaturn: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(saturn.x, saturn.y, saturn.z))
+ m.rotate(saturn.tilt, tiltAxis)
+ m.rotate(saturn.roll, rollAxis)
+ m.scale(saturn.r)
+ return m
+ }
+ }
+
+ components: [ saturn, materialSaturn, transformSaturn ]
+ }
+
+ // SATURN RING
+
+ Entity {
+ id: saturnRingEntity
+
+ Ring {
+ id: saturnRing
+ innerRadius: saturnRingInnerRadius
+ outerRadius: saturnRingOuterRadius
+ }
+
+ PlanetMaterial {
+ id: materialSaturnRing
+ effect: shadowMapEffect
+ ambientLight: ambientStrengthRing
+ specularColor: Qt.rgba(0.01, 0.01, 0.01, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/saturnringcolortrans.png"
+ shininess: shininessBasic
+ opacity: 0.4
+ }
+
+ property Transform transformSaturnRing: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(saturn.x, saturn.y, saturn.z))
+ m.rotate(saturn.tilt, tiltAxis)
+ m.rotate(saturn.roll / 10, rollAxis)
+ m.scale((saturnRing.innerRadius + saturnRing.outerRadius) / 1.75)
+ return m
+ }
+ }
+
+ components: [ saturnRing, materialSaturnRing, transformSaturnRing ]
+ }
+
+ // URANUS
+
+ Entity {
+ id: uranusEntity
+
+ Planet {
+ id: uranus
+ tilt: planetData[Planets.URANUS].tilt
+ }
+
+ PlanetMaterial {
+ id: materialUranus
+ effect: shadowMapEffect
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/uranusmap.jpg"
+ shininess: shininessBasic
+ }
+
+ property Transform transformUranus: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(uranus.x, uranus.y, uranus.z))
+ m.rotate(uranus.tilt, tiltAxis)
+ m.rotate(uranus.roll, rollAxis)
+ m.scale(uranus.r)
+ return m
+ }
+ }
+
+ components: [ uranus, materialUranus, transformUranus ]
+ }
+
+ // URANUS RING
+
+ Entity {
+ id: uranusRingEntity
+
+ Ring {
+ id: uranusRing
+ innerRadius: uranusRingInnerRadius
+ outerRadius: uranusRingOuterRadius
+ }
+
+ PlanetMaterial {
+ id: materialUranusRing
+ effect: shadowMapEffect
+ ambientLight: ambientStrengthRing
+ specularColor: Qt.rgba(0.01, 0.01, 0.01, 1.0)
+ diffuseMap: "qrc:/images/nasa/uranusringcolortrans.png"
+ shininess: shininessBasic
+ opacity: 0.4
+ }
+
+ property Transform transformUranusRing: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(uranus.x, uranus.y, uranus.z))
+ m.rotate(uranus.tilt, tiltAxis)
+ m.rotate(uranus.roll / 10, rollAxis)
+ m.scale((uranusRing.innerRadius + uranusRing.outerRadius) / 1.75)
+ return m
+ }
+ }
+
+ components: [ uranusRing, materialUranusRing, transformUranusRing ]
+ }
+
+ // NEPTUNE
+
+ Entity {
+ id: neptuneEntity
+
+ Planet {
+ id: neptune
+ tilt: planetData[Planets.NEPTUNE].tilt
+ }
+
+ PlanetMaterial {
+ id: materialNeptune
+ effect: effectD
+ ambientLight: ambientStrengthPlanet
+ specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0)
+ diffuseMap: "qrc:/images/solarsystemscope/neptunemap.jpg"
+ shininess: shininessBasic
+ }
+
+ property Transform transformNeptune: Transform {
+ matrix: {
+ var m = Qt.matrix4x4()
+ m.translate(Qt.vector3d(neptune.x, neptune.y, neptune.z))
+ m.rotate(neptune.tilt, tiltAxis)
+ m.rotate(neptune.roll, rollAxis)
+ m.scale(neptune.r)
+ return m
+ }
+ }
+
+ components: [ neptune, materialNeptune, transformNeptune ]
+ }
+}
diff --git a/tests/manual/planets-qml/StyledSlider.qml b/tests/manual/planets-qml/StyledSlider.qml
new file mode 100644
index 000000000..e6fff7c1a
--- /dev/null
+++ b/tests/manual/planets-qml/StyledSlider.qml
@@ -0,0 +1,10 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.0
+import QtQuick.Controls 2.0
+
+Slider {
+ id: styledSlider
+}
+
diff --git a/tests/manual/planets-qml/SunEffect.qml b/tests/manual/planets-qml/SunEffect.qml
new file mode 100644
index 000000000..14b9d9f71
--- /dev/null
+++ b/tests/manual/planets-qml/SunEffect.qml
@@ -0,0 +1,97 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+
+Effect {
+ id: root
+
+ FilterKey { id: desktopkey; name: "name"; value: "Desktop" }
+ FilterKey { id: forwardkey; name : "pass"; value : "forward" }
+ FilterKey { id: eskey; name: "name"; value: "ES2" }
+
+ RenderPass {
+ id: glpass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/gl3/sun.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/gl3/sun.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: rhipass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/rhi/sun.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/rhi/sun.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+ RenderPass {
+ id: espass
+ filterKeys: [ forwardkey ]
+
+ shaderProgram: ShaderProgram {
+ vertexShaderCode: loadSource("qrc:/shaders/es2/sun.vert")
+ fragmentShaderCode: loadSource("qrc:/shaders/es2/sun.frag")
+ }
+
+ // no special render state set => use the default set of states
+ }
+
+ techniques: [
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ profile: GraphicsApiFilter.CoreProfile
+ majorVersion: 3
+ minorVersion: 2
+ }
+
+ filterKeys: [ desktopkey ]
+
+ renderPasses: [ glpass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGL
+ majorVersion: 2
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.OpenGLES
+ majorVersion: 2
+ minorVersion: 0
+ }
+
+ filterKeys: [ eskey ]
+
+ renderPasses: [ espass ]
+ },
+ Technique {
+ graphicsApiFilter {
+ api: GraphicsApiFilter.RHI
+ majorVersion: 1
+ minorVersion: 0
+ }
+
+ filterKeys: [ desktopkey ]
+
+ renderPasses: [ rhipass ]
+ }
+ ]
+}
diff --git a/tests/manual/planets-qml/android/AndroidManifest.xml b/tests/manual/planets-qml/android/AndroidManifest.xml
new file mode 100644
index 000000000..2029425d1
--- /dev/null
+++ b/tests/manual/planets-qml/android/AndroidManifest.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.qtproject.planets.qml"
+ android:installLocation="auto"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default permissions. -->
+ <!-- %%INSERT_PERMISSIONS -->
+
+ <!-- The comment below will be replaced with dependencies permissions upon deployment.
+ Remove the comment if you do not require these default features. -->
+ <!-- %%INSERT_FEATURES -->
+
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true" />
+ <application
+ android:name="org.qtproject.qt.android.bindings.QtApplication"
+ android:extractNativeLibs="true"
+ android:hardwareAccelerated="true"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:requestLegacyExternalStorage="true"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:icon="@drawable/icon">
+ <activity
+ android:name="org.qtproject.qt.android.bindings.QtActivity"
+ android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
+ android:label="-- %%INSERT_APP_NAME%% --"
+ android:launchMode="singleTop"
+ android:screenOrientation="unspecified">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+
+ <meta-data
+ android:name="android.app.lib_name"
+ android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
+
+ <meta-data
+ android:name="android.app.background_running"
+ android:value="false"/>
+ </activity>
+ </application>
+</manifest>
diff --git a/tests/manual/planets-qml/android/res/drawable-hdpi/icon.png b/tests/manual/planets-qml/android/res/drawable-hdpi/icon.png
new file mode 100644
index 000000000..bd5939f42
--- /dev/null
+++ b/tests/manual/planets-qml/android/res/drawable-hdpi/icon.png
Binary files differ
diff --git a/tests/manual/planets-qml/android/res/drawable-ldpi/icon.png b/tests/manual/planets-qml/android/res/drawable-ldpi/icon.png
new file mode 100644
index 000000000..bd5939f42
--- /dev/null
+++ b/tests/manual/planets-qml/android/res/drawable-ldpi/icon.png
Binary files differ
diff --git a/tests/manual/planets-qml/android/res/drawable-mdpi/icon.png b/tests/manual/planets-qml/android/res/drawable-mdpi/icon.png
new file mode 100644
index 000000000..bd5939f42
--- /dev/null
+++ b/tests/manual/planets-qml/android/res/drawable-mdpi/icon.png
Binary files differ
diff --git a/tests/manual/planets-qml/doc/images/planets-qml-example.jpg b/tests/manual/planets-qml/doc/images/planets-qml-example.jpg
new file mode 100644
index 000000000..d388d5ee4
--- /dev/null
+++ b/tests/manual/planets-qml/doc/images/planets-qml-example.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/doc/src/planets-qml.qdoc b/tests/manual/planets-qml/doc/src/planets-qml.qdoc
new file mode 100644
index 000000000..a515a9721
--- /dev/null
+++ b/tests/manual/planets-qml/doc/src/planets-qml.qdoc
@@ -0,0 +1,82 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example planets-qml
+ \title Qt 3D: Planets QML Example
+ \ingroup qt3d-examples-qml
+ \brief Demonstrates combining Qt 3D rendering and Qt Quick 2 elements.
+
+ \image planets-qml-example.jpg
+
+ \e Planets demonstrates how to implement an application that combines the use of
+ Qt 3D rendering with Qt Quick 2D elements. The example shows the eight planets of our Solar
+ System with the Sun.
+
+ Planet texture maps are Copyright (c) by James Hastings-Trew
+ \l{http://planetpixelemporium.com/planets.html}{http://planetpixelemporium.com/planets.html}
+ used with permission.
+
+ The planets are rotating around the Sun based on their orbit at a given time. The rotation
+ starts at 2000 Jan 0.0 UT. The planet positions are calculated based on the formulas found here:
+ \l {http://www.stjarnhimlen.se/comp/ppcomp.html}{http://www.stjarnhimlen.se/comp/ppcomp.html}
+ and \l {http://www.davidcolarusso.com/astro/}{http://www.davidcolarusso.com/astro/}.
+
+ \include examples-run.qdocinc
+
+ \section1 Qt Quick 2D Implementation
+
+ The Qt Quick Implementation in \c {planets-qml/PlanetsMain.qml} of the
+ example renders the 3D content using the \c Scene3D type.
+
+ \snippet planets-qml/PlanetsMain.qml 0
+
+ The planet related information is stored into a \c{ListModel}. The selection buttons for the
+ planets and the information sheet are created based on the model. The 2D elements, selection
+ buttons and sliders, are implemented in \c {planets-qml/PlanetsMain.qml}.
+
+ The selection buttons change the \c{focusedPlanet} property of the \c{mainview}. As the property
+ changes, the planet information is updated, and the camera is animated to the new position.
+
+ \snippet planets-qml/PlanetsMain.qml 1
+
+ The camera position and the camera look at point are updated based on values that are animated
+ in \c {planets-qml/SolarSystem.qml}, triggered from the
+ \c{changePlanetFocus()} function.
+
+ \snippet planets-qml/SolarSystem.qml 0
+
+ The sliders are used to adjust the rotation speed, the planet size, and the viewing distance.
+ When a slider value changes, a JavaScript function in \c {planets-qml/SolarSystem.qml}
+ is called to adjust the given property. For example, changing the value of
+ the \e{Viewing Distance} slider calls the \c{changeCameraDistance()} method.
+
+ \snippet planets-qml/PlanetsMain.qml 2
+
+ \section1 Qt 3D Implementation
+
+ The main part of the implementation, including the movement and rotation maths for the planets,
+ is done in \c {planets-qml/SolarSystem.qml}.
+
+ First, a \c Camera, a \c{Light}, and a \c Configuration are added, followed by \c{Effect}s for
+ the planet \c{Material}s, and finally the planets themselves. For example, Earth is constructed
+ as follows:
+
+ \snippet planets-qml/SolarSystem.qml 1
+
+ Planet data, which is needed for the movement and rotation calculations, among other things, is
+ constructed with JavaScript in \c {planets-qml/planets.js} by calling
+ \c{loadPlanetData()} as the component completes. Other initializations, such as inserting the
+ planets into an array for easier handling, calculating the ring radii for Saturn and Uranus
+ rings, and setting the default scale, speed, and camera offset, are done as well:
+
+ \snippet planets-qml/SolarSystem.qml 2
+
+ The scene is animated by calling the \c{animate()} function. That is also the place where the
+ time is advanced, and the new positions for all of the planets are calculated. The planets are
+ rotated in the \c{positionPlanet()} function based on their axial tilt and their sidereal
+ rotation period. Finally, the new camera position is calculated in the \c{updateCamera()}
+ function.
+
+ \snippet planets-qml/SolarSystem.qml 3
+*/
diff --git a/tests/manual/planets-qml/images/earth.png b/tests/manual/planets-qml/images/earth.png
new file mode 100644
index 000000000..7bfef7cc7
--- /dev/null
+++ b/tests/manual/planets-qml/images/earth.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/jupiter.png b/tests/manual/planets-qml/images/jupiter.png
new file mode 100644
index 000000000..b0cc4cfc2
--- /dev/null
+++ b/tests/manual/planets-qml/images/jupiter.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/mars.png b/tests/manual/planets-qml/images/mars.png
new file mode 100644
index 000000000..187560b70
--- /dev/null
+++ b/tests/manual/planets-qml/images/mars.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/mercury.png b/tests/manual/planets-qml/images/mercury.png
new file mode 100644
index 000000000..418d49f64
--- /dev/null
+++ b/tests/manual/planets-qml/images/mercury.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/nasa/license.txt b/tests/manual/planets-qml/images/nasa/license.txt
new file mode 100644
index 000000000..62a6d9ffd
--- /dev/null
+++ b/tests/manual/planets-qml/images/nasa/license.txt
@@ -0,0 +1,3 @@
+Uranus Ring:
+http://photojournal.jpl.nasa.gov/catalog/PIA00033 - Courtesy NASA/JPL-Caltech.
+Used under the terms of the license at http://www.jpl.nasa.gov/imagepolicy/
diff --git a/tests/manual/planets-qml/images/nasa/qt_attribution.json b/tests/manual/planets-qml/images/nasa/qt_attribution.json
new file mode 100644
index 000000000..6f47e3837
--- /dev/null
+++ b/tests/manual/planets-qml/images/nasa/qt_attribution.json
@@ -0,0 +1,15 @@
+{
+ "Id": "nasa-jpl",
+ "Name": "Jet Propulsion Laboratory Photojournal",
+ "QDocModule": "qt3d",
+ "QtParts": ["examples"],
+ "Description": "The NASA/JPL Photojournal provides high quality images related to space research and exploration",
+ "QtUsage": "Used in Qt 3D planets-qml example.",
+
+ "DownloadLocation": "https://photojournal.jpl.nasa.gov/catalog/PIA00033",
+ "Homepage": "https://photojournal.jpl.nasa.gov/",
+ "License": "JPL Image Use Policy",
+ "LicenseId": "LicenseRef-Image-Use-Policy",
+ "LicenseFile": "license.txt",
+ "Copyright": "Copyright (c) 1996, Jet Propulsion Laboratory"
+}
diff --git a/tests/manual/planets-qml/images/nasa/uranusringcolortrans.png b/tests/manual/planets-qml/images/nasa/uranusringcolortrans.png
new file mode 100644
index 000000000..b0953dec5
--- /dev/null
+++ b/tests/manual/planets-qml/images/nasa/uranusringcolortrans.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/neptune.png b/tests/manual/planets-qml/images/neptune.png
new file mode 100644
index 000000000..07794c6f9
--- /dev/null
+++ b/tests/manual/planets-qml/images/neptune.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/saturn.png b/tests/manual/planets-qml/images/saturn.png
new file mode 100644
index 000000000..003363cd7
--- /dev/null
+++ b/tests/manual/planets-qml/images/saturn.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapcolortrans.png b/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapcolortrans.png
new file mode 100644
index 000000000..1aabde94e
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapcolortrans.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapspec.jpg b/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapspec.jpg
new file mode 100644
index 000000000..254b6fb6c
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/earthcloudmapspec.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/earthmap2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/earthmap2k.jpg
new file mode 100644
index 000000000..e90540c83
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/earthmap2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/earthnormal2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/earthnormal2k.jpg
new file mode 100644
index 000000000..8215226fb
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/earthnormal2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/earthspec2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/earthspec2k.jpg
new file mode 100644
index 000000000..8e2b3f6c1
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/earthspec2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/galaxy_starfield.jpg b/tests/manual/planets-qml/images/solarsystemscope/galaxy_starfield.jpg
new file mode 100644
index 000000000..2be906a73
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/galaxy_starfield.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/jupitermap.jpg b/tests/manual/planets-qml/images/solarsystemscope/jupitermap.jpg
new file mode 100644
index 000000000..f5af80197
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/jupitermap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/license.txt b/tests/manual/planets-qml/images/solarsystemscope/license.txt
new file mode 100644
index 000000000..40ff1c577
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/license.txt
@@ -0,0 +1,6 @@
+www.solarsystemscope.com/textures distributed under the terms of
+https://creativecommons.org/licenses/by/4.0/
+
+Changes:
+- Rings created from the reference rectangle file.
+- earthcloudmapcolortrans.png was made from the earthcloudmapspec.jpg file
diff --git a/tests/manual/planets-qml/images/solarsystemscope/marsmap2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/marsmap2k.jpg
new file mode 100644
index 000000000..ea77177fb
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/marsmap2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/marsnormal2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/marsnormal2k.jpg
new file mode 100644
index 000000000..44a2e2f9b
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/marsnormal2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/mercurymap.jpg b/tests/manual/planets-qml/images/solarsystemscope/mercurymap.jpg
new file mode 100644
index 000000000..f69e947c0
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/mercurymap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/mercurynormal.jpg b/tests/manual/planets-qml/images/solarsystemscope/mercurynormal.jpg
new file mode 100644
index 000000000..5e77923bf
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/mercurynormal.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/moonmap2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/moonmap2k.jpg
new file mode 100644
index 000000000..0e0c20d0a
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/moonmap2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/moonnormal2k.jpg b/tests/manual/planets-qml/images/solarsystemscope/moonnormal2k.jpg
new file mode 100644
index 000000000..10797cf0a
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/moonnormal2k.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/neptunemap.jpg b/tests/manual/planets-qml/images/solarsystemscope/neptunemap.jpg
new file mode 100644
index 000000000..250fce966
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/neptunemap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/qt_attribution.json b/tests/manual/planets-qml/images/solarsystemscope/qt_attribution.json
new file mode 100644
index 000000000..9d32e541d
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/qt_attribution.json
@@ -0,0 +1,14 @@
+{
+ "Id": "solar_system_scope",
+ "Name": "Solar System Scope Texture Library",
+ "QDocModule": "qt3d",
+ "QtParts": ["examples"],
+ "Description": "Solar System Scope provides high quality, free to use textures for objects in the solar system.",
+ "QtUsage": "Used in Qt 3D planets-qml example.",
+
+ "Homepage": "https://www.solarsystemscope.com/textures",
+ "License": "Creative Commons Attribution 4.0",
+ "LicenseId": "CC-BY-4.0",
+ "LicenseFile": "license.txt",
+ "Copyright": "Copyright (c) 2010-2017, Solar System Scope"
+}
diff --git a/tests/manual/planets-qml/images/solarsystemscope/saturnmap.jpg b/tests/manual/planets-qml/images/solarsystemscope/saturnmap.jpg
new file mode 100644
index 000000000..981bb36c9
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/saturnmap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/saturnringcolortrans.png b/tests/manual/planets-qml/images/solarsystemscope/saturnringcolortrans.png
new file mode 100644
index 000000000..aefd9f6c4
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/saturnringcolortrans.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/sunmap.jpg b/tests/manual/planets-qml/images/solarsystemscope/sunmap.jpg
new file mode 100644
index 000000000..46f2ce8c1
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/sunmap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/uranusmap.jpg b/tests/manual/planets-qml/images/solarsystemscope/uranusmap.jpg
new file mode 100644
index 000000000..96cea14be
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/uranusmap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/venusmap.jpg b/tests/manual/planets-qml/images/solarsystemscope/venusmap.jpg
new file mode 100644
index 000000000..93bed3e47
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/venusmap.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/solarsystemscope/venusnormal.jpg b/tests/manual/planets-qml/images/solarsystemscope/venusnormal.jpg
new file mode 100644
index 000000000..0fc5ff703
--- /dev/null
+++ b/tests/manual/planets-qml/images/solarsystemscope/venusnormal.jpg
Binary files differ
diff --git a/tests/manual/planets-qml/images/sun.png b/tests/manual/planets-qml/images/sun.png
new file mode 100644
index 000000000..9a62c5f1d
--- /dev/null
+++ b/tests/manual/planets-qml/images/sun.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/uranus.png b/tests/manual/planets-qml/images/uranus.png
new file mode 100644
index 000000000..8678b9aa5
--- /dev/null
+++ b/tests/manual/planets-qml/images/uranus.png
Binary files differ
diff --git a/tests/manual/planets-qml/images/venus.png b/tests/manual/planets-qml/images/venus.png
new file mode 100644
index 000000000..fdbb45d32
--- /dev/null
+++ b/tests/manual/planets-qml/images/venus.png
Binary files differ
diff --git a/tests/manual/planets-qml/main.cpp b/tests/manual/planets-qml/main.cpp
new file mode 100644
index 000000000..a410b6486
--- /dev/null
+++ b/tests/manual/planets-qml/main.cpp
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include <QGuiApplication>
+#include <QQuickView>
+#include <QQmlContext>
+#include <QOpenGLContext>
+#include <Qt3DRender/qt3drender-config.h>
+
+#include "networkcontroller.h"
+
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
+
+ QSurfaceFormat format;
+ if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ format.setVersion(4, 5);
+ format.setProfile(QSurfaceFormat::CoreProfile);
+ }
+ format.setDepthBufferSize(24);
+ format.setStencilBufferSize(8);
+ format.setSamples(4);
+#if !QT_CONFIG(qt3d_rhi_renderer)
+ qputenv("QSG_RHI_BACKEND", "opengl");
+#endif
+
+ NetworkController networkController;
+
+ QQuickView view;
+ view.setFormat(format);
+ view.rootContext()->setContextProperty("networkController", &networkController);
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:/PlanetsMain.qml"));
+ view.setColor("#000000");
+ view.show();
+
+ return app.exec();
+}
diff --git a/tests/manual/planets-qml/networkcontroller.cpp b/tests/manual/planets-qml/networkcontroller.cpp
new file mode 100644
index 000000000..ab25bb0a1
--- /dev/null
+++ b/tests/manual/planets-qml/networkcontroller.cpp
@@ -0,0 +1,64 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "networkcontroller.h"
+
+NetworkController::NetworkController(QObject *parent) :
+ QObject(parent)
+{
+ QObject::connect(&m_server, &QTcpServer::newConnection, this, &NetworkController::newConnection);
+
+ if (!m_server.listen(QHostAddress::Any, 8080)) {
+ qDebug() << "Failed to run http server";
+ }
+}
+
+void NetworkController::newConnection()
+{
+ QTcpSocket *socket = m_server.nextPendingConnection();
+
+ if (!socket)
+ return;
+
+ QObject::connect(socket, &QAbstractSocket::disconnected, this, &NetworkController::disconnected);
+ QObject::connect(socket, &QIODevice::readyRead, this, &NetworkController::readyRead);
+}
+
+void NetworkController::disconnected()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
+ if (!socket)
+ return;
+
+ socket->disconnect();
+ socket->deleteLater();
+}
+
+void NetworkController::readyRead()
+{
+ QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
+ if (!socket || socket->state() == QTcpSocket::ClosingState)
+ return;
+
+ QString requestData = socket->readAll();
+ QStringList list = requestData.split(' ');
+ QString path = list[1];
+ list = path.split('/');
+
+ QByteArray reply;
+ if (list.count() == 3) {
+ socket->write("HTTP/1.1 200 OK\r\n");
+ reply = QStringLiteral("Command accepted: %1 %2").arg(list[1], list[2]).toUtf8();
+ emit commandAccepted(list[1], list[2]);
+ } else {
+ socket->write("HTTP/1.1 404 Not Found\r\n");
+ reply = "Command rejected";
+ }
+
+ socket->write("Content-Type: text/plain\r\n");
+ socket->write(QStringLiteral("Content-Length: %1\r\n").arg(reply.size()).toUtf8());
+ socket->write("Connection: close\r\n");
+ socket->write("\r\n");
+ socket->write(reply);
+ socket->disconnectFromHost();
+}
diff --git a/tests/manual/planets-qml/networkcontroller.h b/tests/manual/planets-qml/networkcontroller.h
new file mode 100644
index 000000000..1746f4287
--- /dev/null
+++ b/tests/manual/planets-qml/networkcontroller.h
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef NETWORKCONTROLLER_H
+#define NETWORKCONTROLLER_H
+
+#include <QObject>
+#include <QTcpServer>
+#include <QTcpSocket>
+
+class NetworkController : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit NetworkController(QObject *parent = 0);
+
+private:
+ QTcpServer m_server;
+
+private slots:
+ void newConnection();
+ void disconnected();
+ void readyRead();
+
+signals:
+ void commandAccepted(QString command, QString value);
+};
+
+#endif // NETWORKCONTROLLER_H
diff --git a/tests/manual/planets-qml/planets-qml-images.qrc b/tests/manual/planets-qml/planets-qml-images.qrc
new file mode 100644
index 000000000..6b6b30ec4
--- /dev/null
+++ b/tests/manual/planets-qml/planets-qml-images.qrc
@@ -0,0 +1,35 @@
+<RCC>
+ <qresource prefix="/">
+ <file>images/nasa/uranusringcolortrans.png</file>
+ <file>images/solarsystemscope/earthcloudmapcolortrans.png</file>
+ <file>images/solarsystemscope/earthcloudmapspec.jpg</file>
+ <file>images/solarsystemscope/earthmap2k.jpg</file>
+ <file>images/solarsystemscope/earthnormal2k.jpg</file>
+ <file>images/solarsystemscope/earthspec2k.jpg</file>
+ <file>images/solarsystemscope/galaxy_starfield.jpg</file>
+ <file>images/solarsystemscope/jupitermap.jpg</file>
+ <file>images/solarsystemscope/license.txt</file>
+ <file>images/solarsystemscope/marsmap2k.jpg</file>
+ <file>images/solarsystemscope/marsnormal2k.jpg</file>
+ <file>images/solarsystemscope/mercurymap.jpg</file>
+ <file>images/solarsystemscope/mercurynormal.jpg</file>
+ <file>images/solarsystemscope/moonmap2k.jpg</file>
+ <file>images/solarsystemscope/moonnormal2k.jpg</file>
+ <file>images/solarsystemscope/neptunemap.jpg</file>
+ <file>images/solarsystemscope/saturnmap.jpg</file>
+ <file>images/solarsystemscope/saturnringcolortrans.png</file>
+ <file>images/solarsystemscope/sunmap.jpg</file>
+ <file>images/solarsystemscope/uranusmap.jpg</file>
+ <file>images/solarsystemscope/venusmap.jpg</file>
+ <file>images/solarsystemscope/venusnormal.jpg</file>
+ <file>images/earth.png</file>
+ <file>images/jupiter.png</file>
+ <file>images/mars.png</file>
+ <file>images/mercury.png</file>
+ <file>images/saturn.png</file>
+ <file>images/sun.png</file>
+ <file>images/uranus.png</file>
+ <file>images/venus.png</file>
+ <file>images/neptune.png</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/planets-qml/planets-qml.pro b/tests/manual/planets-qml/planets-qml.pro
new file mode 100644
index 000000000..de14ecc8a
--- /dev/null
+++ b/tests/manual/planets-qml/planets-qml.pro
@@ -0,0 +1,37 @@
+!include( ../examples.pri ) {
+ error( "Couldn't find the examples.pri file!" )
+}
+
+QT += qml quick \
+ concurrent \
+ 3dcore 3drender 3dinput \
+ 3dquick 3dquickrender 3dquickinput 3dquickextras \
+ network
+
+CONFIG += resources_big c++11
+
+HEADERS += \
+ networkcontroller.h
+
+SOURCES += \
+ main.cpp \
+ networkcontroller.cpp
+
+OTHER_FILES += \
+ *.qml \
+ planets.js \
+ shaders/gl3/*.* \
+ shaders/es2/*.* \
+ doc/src/*.* \
+ doc/images/*.*
+
+RESOURCES += \
+ planets-qml.qrc \
+ planets-qml-images.qrc
+
+DISTFILES += \
+ PlanetsMain.qml \
+ android/AndroidManifest.xml \
+ images/license.txt
+
+ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
diff --git a/tests/manual/planets-qml/planets-qml.qrc b/tests/manual/planets-qml/planets-qml.qrc
new file mode 100644
index 000000000..d799fbdf0
--- /dev/null
+++ b/tests/manual/planets-qml/planets-qml.qrc
@@ -0,0 +1,54 @@
+<RCC>
+ <qresource prefix="/">
+ <file>SolarSystem.qml</file>
+ <file>PlanetsMain.qml</file>
+ <file>PlanetButton.qml</file>
+ <file>InfoSheet.qml</file>
+ <file>StyledSlider.qml</file>
+ <file>FpsDisplay.qml</file>
+ <file>Planet.qml</file>
+ <file>Ring.qml</file>
+ <file>PlanetsLight.qml</file>
+ <file>SunEffect.qml</file>
+ <file>PlanetEffect.qml</file>
+ <file>ShadowEffect.qml</file>
+ <file>PlanetFrameGraph.qml</file>
+ <file>PlanetMaterial.qml</file>
+ <file>planets.js</file>
+ <file>meshes/starfield.obj</file>
+ <file>meshes/ring.obj</file>
+ <file>shaders/gl3/sun.frag</file>
+ <file>shaders/gl3/sun.vert</file>
+ <file>shaders/gl3/shadowmap.frag</file>
+ <file>shaders/gl3/shadowmap.vert</file>
+ <file>shaders/gl3/planetD.frag</file>
+ <file>shaders/gl3/planetD.vert</file>
+ <file>shaders/gl3/planetDB.frag</file>
+ <file>shaders/gl3/planetDB.vert</file>
+ <file>shaders/gl3/planetDS.frag</file>
+ <file>shaders/gl3/planetDSB.frag</file>
+ <file>shaders/es2/sun.frag</file>
+ <file>shaders/es2/sun.vert</file>
+ <file>shaders/es2/planetD.frag</file>
+ <file>shaders/es2/planetD.vert</file>
+ <file>shaders/es2/planetDB.frag</file>
+ <file>shaders/es2/planetDB.vert</file>
+ <file>shaders/es2/planetDS.frag</file>
+ <file>shaders/es2/planetDSB.frag</file>
+ <file>shaders/gl3/planetDShadow.frag</file>
+ <file>shaders/gl3/planetDShadow.vert</file>
+ <file>AppleTVInput.qml</file>
+ <file>shaders/rhi/planetD.frag</file>
+ <file>shaders/rhi/planetD.vert</file>
+ <file>shaders/rhi/planetDB.frag</file>
+ <file>shaders/rhi/planetDB.vert</file>
+ <file>shaders/rhi/planetDS.frag</file>
+ <file>shaders/rhi/planetDSB.frag</file>
+ <file>shaders/rhi/planetDShadow.frag</file>
+ <file>shaders/rhi/planetDShadow.vert</file>
+ <file>shaders/rhi/shadowmap.frag</file>
+ <file>shaders/rhi/shadowmap.vert</file>
+ <file>shaders/rhi/sun.frag</file>
+ <file>shaders/rhi/sun.vert</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 000000000..500276f67
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,56 @@
+{
+ "images" : [
+ {
+ "size" : "24x24",
+ "idiom" : "watch",
+ "scale" : "2x",
+ "role" : "notificationCenter",
+ "subtype" : "38mm"
+ },
+ {
+ "size" : "27.5x27.5",
+ "idiom" : "watch",
+ "scale" : "2x",
+ "role" : "notificationCenter",
+ "subtype" : "42mm"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "watch",
+ "role" : "companionSettings",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "watch",
+ "role" : "companionSettings",
+ "scale" : "3x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "watch",
+ "filename" : "home_icon.png",
+ "scale" : "2x",
+ "role" : "appLauncher",
+ "subtype" : "38mm"
+ },
+ {
+ "size" : "86x86",
+ "idiom" : "watch",
+ "scale" : "2x",
+ "role" : "quickLook",
+ "subtype" : "38mm"
+ },
+ {
+ "size" : "98x98",
+ "idiom" : "watch",
+ "scale" : "2x",
+ "role" : "quickLook",
+ "subtype" : "42mm"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/home_icon.png b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/home_icon.png
new file mode 100644
index 000000000..d00a93632
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/AppIcon.appiconset/home_icon.png
Binary files differ
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/Contents.json
new file mode 100644
index 000000000..da4a164c9
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Base.lproj/Interface.storyboard b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Base.lproj/Interface.storyboard
new file mode 100644
index 000000000..d7e9194b4
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Base.lproj/Interface.storyboard
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="11535.1" systemVersion="16A323" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
+ <device id="watch38" orientation="portrait">
+ <adaptation id="fullscreen"/>
+ </device>
+ <dependencies>
+ <deployment identifier="watchOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11523"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="11508"/>
+ </dependencies>
+ <scenes>
+ <!--Interface Controller-->
+ <scene sceneID="aou-V4-d1y">
+ <objects>
+ <controller id="AgC-eL-Hgc" customClass="InterfaceController">
+ <items>
+ <label width="1" alignment="left" text="127.0.0.1:8080" numberOfLines="2" id="9HQ-YC-P4i"/>
+ <picker width="1" height="64" alignment="left" focusStyle="stack" id="ABv-8d-yEr">
+ <connections>
+ <action selector="selectedPlanetChanged:" destination="AgC-eL-Hgc" id="OU5-km-9HE"/>
+ </connections>
+ </picker>
+ <label width="1" alignment="left" text="Rotation Speed" id="xoA-aj-W51"/>
+ <slider width="1" alignment="left" value="5" minimum="1" maximum="10" steps="10" id="HWA-3V-ha8">
+ <connections>
+ <action selector="rotationSpeedChanged:" destination="AgC-eL-Hgc" id="OGB-04-Eac"/>
+ </connections>
+ </slider>
+ <label width="1" alignment="left" text="Viewing Distance" id="mHk-AK-qJi"/>
+ <slider width="1" alignment="left" value="5" minimum="1" maximum="10" steps="10" id="ETL-Aj-Rbd">
+ <connections>
+ <action selector="viewingDistanceChanged:" destination="AgC-eL-Hgc" id="05F-9h-WCb"/>
+ </connections>
+ </slider>
+ <label width="1" height="18" alignment="left" text="Planet Size" id="w4k-sT-H0q"/>
+ <slider width="1" alignment="left" value="5" minimum="1" maximum="10" steps="10" id="ohR-g5-Xt1">
+ <connections>
+ <action selector="planetSizeChanged:" destination="AgC-eL-Hgc" id="O44-Jy-fTe"/>
+ </connections>
+ </slider>
+ </items>
+ <connections>
+ <outlet property="hostLabel" destination="9HQ-YC-P4i" id="hFZ-iv-58q"/>
+ <outlet property="planetPicker" destination="ABv-8d-yEr" id="sNX-zW-lRr"/>
+ <outlet property="planetSizeSlider" destination="ohR-g5-Xt1" id="RTf-au-sBa"/>
+ <outlet property="rotationSpeedSlider" destination="HWA-3V-ha8" id="E3m-En-Rle"/>
+ <outlet property="viewingDistanceSlider" destination="ETL-Aj-Rbd" id="5rO-7Q-MYm"/>
+ </connections>
+ </controller>
+ </objects>
+ </scene>
+ </scenes>
+</document>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Info.plist b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Info.plist
new file mode 100644
index 000000000..97f7a59a2
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit App/Info.plist
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>PlanetsClient WatchKit App</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ </array>
+ <key>WKCompanionAppBundleIdentifier</key>
+ <string>Qt.PlanetsClient</string>
+ <key>WKWatchKitApp</key>
+ <true/>
+</dict>
+</plist>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json
new file mode 100644
index 000000000..9be9adbf7
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json
@@ -0,0 +1,18 @@
+{
+ "images" : [
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{130,145}",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{146,165}",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json
new file mode 100644
index 000000000..2eca9a1f4
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json
@@ -0,0 +1,28 @@
+{
+ "assets" : [
+ {
+ "idiom" : "watch",
+ "filename" : "Circular.imageset",
+ "role" : "circular"
+ },
+ {
+ "idiom" : "watch",
+ "filename" : "Extra Large.imageset",
+ "role" : "extra-large"
+ },
+ {
+ "idiom" : "watch",
+ "filename" : "Modular.imageset",
+ "role" : "modular"
+ },
+ {
+ "idiom" : "watch",
+ "filename" : "Utilitarian.imageset",
+ "role" : "utilitarian"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json
new file mode 100644
index 000000000..9be9adbf7
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json
@@ -0,0 +1,18 @@
+{
+ "images" : [
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{130,145}",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{146,165}",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json
new file mode 100644
index 000000000..9be9adbf7
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json
@@ -0,0 +1,18 @@
+{
+ "images" : [
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{130,145}",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{146,165}",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json
new file mode 100644
index 000000000..9be9adbf7
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json
@@ -0,0 +1,18 @@
+{
+ "images" : [
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{130,145}",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "watch",
+ "screenWidth" : "{146,165}",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.h b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.h
new file mode 100644
index 000000000..ad3ff3efa
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.h
@@ -0,0 +1,8 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import <WatchKit/WatchKit.h>
+
+@interface ExtensionDelegate : NSObject <WKExtensionDelegate>
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.m
new file mode 100644
index 000000000..2c56d4b19
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/ExtensionDelegate.m
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import "ExtensionDelegate.h"
+
+@implementation ExtensionDelegate
+
+- (void)applicationDidFinishLaunching {
+ // Perform any final initialization of your application.
+}
+
+- (void)applicationDidBecomeActive {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillResignActive {
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, etc.
+}
+
+- (void)handleBackgroundTasks:(NSSet<WKRefreshBackgroundTask *> *)backgroundTasks {
+ // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
+ for (WKRefreshBackgroundTask * task in backgroundTasks) {
+ // Check the Class of each task to decide how to process it
+ if ([task isKindOfClass:[WKApplicationRefreshBackgroundTask class]]) {
+ // Be sure to complete the background task once you’re done.
+ WKApplicationRefreshBackgroundTask *backgroundTask = (WKApplicationRefreshBackgroundTask*)task;
+ [backgroundTask setTaskCompleted];
+ } else if ([task isKindOfClass:[WKSnapshotRefreshBackgroundTask class]]) {
+ // Snapshot tasks have a unique completion call, make sure to set your expiration date
+ WKSnapshotRefreshBackgroundTask *snapshotTask = (WKSnapshotRefreshBackgroundTask*)task;
+ [snapshotTask setTaskCompletedWithDefaultStateRestored:YES estimatedSnapshotExpiration:[NSDate distantFuture] userInfo:nil];
+ } else if ([task isKindOfClass:[WKWatchConnectivityRefreshBackgroundTask class]]) {
+ // Be sure to complete the background task once you’re done.
+ WKWatchConnectivityRefreshBackgroundTask *backgroundTask = (WKWatchConnectivityRefreshBackgroundTask*)task;
+ [backgroundTask setTaskCompleted];
+ } else if ([task isKindOfClass:[WKURLSessionRefreshBackgroundTask class]]) {
+ // Be sure to complete the background task once you’re done.
+ WKURLSessionRefreshBackgroundTask *backgroundTask = (WKURLSessionRefreshBackgroundTask*)task;
+ [backgroundTask setTaskCompleted];
+ } else {
+ // make sure to complete unhandled task types
+ [task setTaskCompleted];
+ }
+ }
+}
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Info.plist b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Info.plist
new file mode 100644
index 000000000..ece2677b1
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/Info.plist
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>PlanetsClient WatchKit Extension</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>XPC!</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSExtension</key>
+ <dict>
+ <key>NSExtensionAttributes</key>
+ <dict>
+ <key>WKAppBundleIdentifier</key>
+ <string>Qt.PlanetsClient.watchkitapp</string>
+ </dict>
+ <key>NSExtensionPointIdentifier</key>
+ <string>com.apple.watchkit</string>
+ </dict>
+ <key>WKExtensionDelegateClassName</key>
+ <string>ExtensionDelegate</string>
+</dict>
+</plist>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.h b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.h
new file mode 100644
index 000000000..1620148fc
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.h
@@ -0,0 +1,21 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import <WatchKit/WatchKit.h>
+#import <Foundation/Foundation.h>
+#import <WatchConnectivity/WatchConnectivity.h>
+
+@interface InterfaceController : WKInterfaceController
+
+@property (nonatomic, copy) NSString *host;
+@property (nonatomic, copy) NSNumber *port;
+@property (nonatomic, copy) NSArray *planets;
+@property (nonatomic, assign) float minimumValue;
+@property (nonatomic, assign) float maximumValue;
+@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceLabel *hostLabel;
+@property (unsafe_unretained, nonatomic) IBOutlet WKInterfacePicker *planetPicker;
+@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceSlider *rotationSpeedSlider;
+@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceSlider *viewingDistanceSlider;
+@property (unsafe_unretained, nonatomic) IBOutlet WKInterfaceSlider *planetSizeSlider;
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.m
new file mode 100644
index 000000000..4d3cb1b70
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient WatchKit Extension/InterfaceController.m
@@ -0,0 +1,146 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import "InterfaceController.h"
+
+@interface InterfaceController() <WCSessionDelegate>
+
+@end
+
+@implementation InterfaceController
+
+- (id)init {
+ if ((self = [super init])) {
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ NSString *host = [defaults stringForKey:@"host"];
+ int port = [defaults integerForKey:@"port"];
+
+ if (host == nil) {
+ self.host = @"127.0.0.1";
+ } else {
+ self.host = host;
+ }
+
+ if (port == 0) {
+ self.port = [NSNumber numberWithInt:8080];
+ } else {
+ self.port = [NSNumber numberWithInt:port];
+ }
+
+ self.planets = @[@"Sun",
+ @"Mercury",
+ @"Venus",
+ @"Earth",
+ @"Mars",
+ @"Jupiter",
+ @"Saturn",
+ @"Uranus",
+ @"Neptune",
+ @"Solar System"];
+
+ self.minimumValue = 1.0f;
+ self.maximumValue = 10.0f;
+ }
+
+ return self;
+}
+
+- (void)awakeWithContext:(id)context {
+ [super awakeWithContext:context];
+
+ int planetsCount = [self.planets count];
+
+ NSMutableArray *pickerItems = [[NSMutableArray alloc] init];
+
+ for (int i = 0; i < planetsCount; i++) {
+ WKPickerItem *item = [WKPickerItem alloc];
+ item.title = self.planets[i];
+ [pickerItems addObject:item];
+ }
+
+ [self.planetPicker setItems:pickerItems];
+
+ [self.hostLabel setText:[NSString stringWithFormat:@"%@:%@", self.host, [NSString stringWithFormat:@"%d", [self.port intValue]]]];
+}
+
+- (void)willActivate {
+ [super willActivate];
+
+ if ([WCSession isSupported]) {
+ WCSession *session = [WCSession defaultSession];
+ session.delegate = self;
+ [session activateSession];
+ }
+}
+
+- (IBAction)selectedPlanetChanged:(NSInteger)value {
+ NSString *command = [@[@"selectPlanet", self.planets[value]] componentsJoinedByString:@"/"];
+
+ [self sendCommand:command];
+}
+
+- (IBAction)rotationSpeedChanged:(float)value {
+ NSString* formattedValue = [NSString stringWithFormat:@"%.02f", (value - self.minimumValue) /
+ (self.maximumValue - self.minimumValue)];
+ NSString *command = [@[@"setRotationSpeed", formattedValue] componentsJoinedByString:@"/"];
+
+ [self sendCommand:command];
+}
+
+- (IBAction)viewingDistanceChanged:(float)value {
+ NSString* formattedValue = [NSString stringWithFormat:@"%.02f", (value - self.minimumValue) /
+ (self.maximumValue - self.minimumValue)];
+ NSString *command = [@[@"setViewingDistance", formattedValue] componentsJoinedByString:@"/"];
+
+ [self sendCommand:command];
+}
+
+- (IBAction)planetSizeChanged:(float)value {
+ NSString* formattedValue = [NSString stringWithFormat:@"%.02f", (value - self.minimumValue) /
+ (self.maximumValue - self.minimumValue)];
+ NSString *command = [@[@"setPlanetSize", formattedValue] componentsJoinedByString:@"/"];
+
+ [self sendCommand:command];
+}
+
+
+- (void)sendCommand:(NSString *)command {
+ NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
+
+ NSURLComponents *urlComponents = [[NSURLComponents alloc] init];
+ urlComponents.scheme = @"http";
+ urlComponents.host = self.host;
+ urlComponents.port = self.port;
+ urlComponents.path = [NSString stringWithFormat:@"/%@", command];
+
+ [request setURL:urlComponents.URL];
+ [request setHTTPMethod:@"GET"];
+
+ NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
+ [[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response,
+ NSError *error) {}] resume];
+}
+
+- (void)session:(nonnull WCSession *)session didReceiveMessage:(nonnull NSDictionary *)message replyHandler:(nonnull void (^)(NSDictionary<NSString *,id> *))replyHandler {
+ NSString *host = [message objectForKey:@"host"];
+ NSString *port = [message objectForKey:@"port"];
+
+ NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
+ numberFormatter.numberStyle = NSNumberFormatterNoStyle;
+
+ self.host = host;
+ self.port = [numberFormatter numberFromString:port];
+
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ [defaults setObject:host forKey:@"host"];
+ [defaults setInteger:[self.port integerValue] forKey:@"port"];
+ [defaults synchronize];
+
+ [self.hostLabel setText:[NSString stringWithFormat:@"%@:%@", host, port]];
+}
+
+- (void)session:(WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(NSError *)error {
+
+}
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.pbxproj b/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..14afdbfb1
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.pbxproj
@@ -0,0 +1,608 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 198EE56A1DB022870021AE36 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 198EE5691DB022870021AE36 /* main.m */; };
+ 198EE56D1DB022870021AE36 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 198EE56C1DB022870021AE36 /* AppDelegate.m */; };
+ 198EE5701DB022870021AE36 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 198EE56F1DB022870021AE36 /* ViewController.m */; };
+ 198EE5731DB022870021AE36 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5711DB022870021AE36 /* Main.storyboard */; };
+ 198EE5751DB022870021AE36 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5741DB022870021AE36 /* Assets.xcassets */; };
+ 198EE5781DB022870021AE36 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5761DB022870021AE36 /* LaunchScreen.storyboard */; };
+ 198EE57D1DB022880021AE36 /* PlanetsClient WatchKit App.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 198EE57C1DB022880021AE36 /* PlanetsClient WatchKit App.app */; };
+ 198EE5831DB022880021AE36 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5811DB022880021AE36 /* Interface.storyboard */; };
+ 198EE5851DB022880021AE36 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5841DB022880021AE36 /* Assets.xcassets */; };
+ 198EE58C1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 198EE58B1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 198EE5921DB022880021AE36 /* InterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 198EE5911DB022880021AE36 /* InterfaceController.m */; };
+ 198EE5951DB022880021AE36 /* ExtensionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 198EE5941DB022880021AE36 /* ExtensionDelegate.m */; };
+ 198EE5971DB022880021AE36 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 198EE5961DB022880021AE36 /* Assets.xcassets */; };
+ 19BD10BF1DB0235700520DE2 /* WatchConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19BD10BE1DB0235700520DE2 /* WatchConnectivity.framework */; };
+ 19BD10C11DB0295200520DE2 /* WatchConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19BD10C01DB0295200520DE2 /* WatchConnectivity.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 198EE57E1DB022880021AE36 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 198EE55D1DB022870021AE36 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 198EE57B1DB022880021AE36;
+ remoteInfo = "PlanetsClient WatchKit App";
+ };
+ 198EE58D1DB022880021AE36 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 198EE55D1DB022870021AE36 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 198EE58A1DB022880021AE36;
+ remoteInfo = "PlanetsClient WatchKit Extension";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 198EE59E1DB022880021AE36 /* Embed App Extensions */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 13;
+ files = (
+ 198EE58C1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex in Embed App Extensions */,
+ );
+ name = "Embed App Extensions";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 198EE5A21DB022880021AE36 /* Embed Watch Content */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "$(CONTENTS_FOLDER_PATH)/Watch";
+ dstSubfolderSpec = 16;
+ files = (
+ 198EE57D1DB022880021AE36 /* PlanetsClient WatchKit App.app in Embed Watch Content */,
+ );
+ name = "Embed Watch Content";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 198EE5651DB022870021AE36 /* PlanetsClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PlanetsClient.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 198EE5691DB022870021AE36 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 198EE56B1DB022870021AE36 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 198EE56C1DB022870021AE36 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 198EE56E1DB022870021AE36 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 198EE56F1DB022870021AE36 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ 198EE5721DB022870021AE36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+ 198EE5741DB022870021AE36 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+ 198EE5771DB022870021AE36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+ 198EE5791DB022870021AE36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 198EE57C1DB022880021AE36 /* PlanetsClient WatchKit App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PlanetsClient WatchKit App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 198EE5821DB022880021AE36 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = "<group>"; };
+ 198EE5841DB022880021AE36 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+ 198EE5861DB022880021AE36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 198EE58B1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "PlanetsClient WatchKit Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 198EE5901DB022880021AE36 /* InterfaceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InterfaceController.h; sourceTree = "<group>"; };
+ 198EE5911DB022880021AE36 /* InterfaceController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InterfaceController.m; sourceTree = "<group>"; };
+ 198EE5931DB022880021AE36 /* ExtensionDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtensionDelegate.h; sourceTree = "<group>"; };
+ 198EE5941DB022880021AE36 /* ExtensionDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExtensionDelegate.m; sourceTree = "<group>"; };
+ 198EE5961DB022880021AE36 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+ 198EE5981DB022880021AE36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 19BD10BE1DB0235700520DE2 /* WatchConnectivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WatchConnectivity.framework; path = System/Library/Frameworks/WatchConnectivity.framework; sourceTree = SDKROOT; };
+ 19BD10C01DB0295200520DE2 /* WatchConnectivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WatchConnectivity.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.1.sdk/System/Library/Frameworks/WatchConnectivity.framework; sourceTree = DEVELOPER_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 198EE5621DB022870021AE36 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 19BD10BF1DB0235700520DE2 /* WatchConnectivity.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 198EE5881DB022880021AE36 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 19BD10C11DB0295200520DE2 /* WatchConnectivity.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 198EE55C1DB022870021AE36 = {
+ isa = PBXGroup;
+ children = (
+ 198EE5671DB022870021AE36 /* PlanetsClient */,
+ 198EE5801DB022880021AE36 /* PlanetsClient WatchKit App */,
+ 198EE58F1DB022880021AE36 /* PlanetsClient WatchKit Extension */,
+ 198EE5661DB022870021AE36 /* Products */,
+ 19BD10BD1DB0235700520DE2 /* Frameworks */,
+ );
+ sourceTree = "<group>";
+ };
+ 198EE5661DB022870021AE36 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 198EE5651DB022870021AE36 /* PlanetsClient.app */,
+ 198EE57C1DB022880021AE36 /* PlanetsClient WatchKit App.app */,
+ 198EE58B1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 198EE5671DB022870021AE36 /* PlanetsClient */ = {
+ isa = PBXGroup;
+ children = (
+ 198EE56B1DB022870021AE36 /* AppDelegate.h */,
+ 198EE56C1DB022870021AE36 /* AppDelegate.m */,
+ 198EE56E1DB022870021AE36 /* ViewController.h */,
+ 198EE56F1DB022870021AE36 /* ViewController.m */,
+ 198EE5711DB022870021AE36 /* Main.storyboard */,
+ 198EE5741DB022870021AE36 /* Assets.xcassets */,
+ 198EE5761DB022870021AE36 /* LaunchScreen.storyboard */,
+ 198EE5791DB022870021AE36 /* Info.plist */,
+ 198EE5681DB022870021AE36 /* Supporting Files */,
+ );
+ path = PlanetsClient;
+ sourceTree = "<group>";
+ };
+ 198EE5681DB022870021AE36 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 198EE5691DB022870021AE36 /* main.m */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 198EE5801DB022880021AE36 /* PlanetsClient WatchKit App */ = {
+ isa = PBXGroup;
+ children = (
+ 198EE5811DB022880021AE36 /* Interface.storyboard */,
+ 198EE5841DB022880021AE36 /* Assets.xcassets */,
+ 198EE5861DB022880021AE36 /* Info.plist */,
+ );
+ path = "PlanetsClient WatchKit App";
+ sourceTree = "<group>";
+ };
+ 198EE58F1DB022880021AE36 /* PlanetsClient WatchKit Extension */ = {
+ isa = PBXGroup;
+ children = (
+ 198EE5901DB022880021AE36 /* InterfaceController.h */,
+ 198EE5911DB022880021AE36 /* InterfaceController.m */,
+ 198EE5931DB022880021AE36 /* ExtensionDelegate.h */,
+ 198EE5941DB022880021AE36 /* ExtensionDelegate.m */,
+ 198EE5961DB022880021AE36 /* Assets.xcassets */,
+ 198EE5981DB022880021AE36 /* Info.plist */,
+ );
+ path = "PlanetsClient WatchKit Extension";
+ sourceTree = "<group>";
+ };
+ 19BD10BD1DB0235700520DE2 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 19BD10C01DB0295200520DE2 /* WatchConnectivity.framework */,
+ 19BD10BE1DB0235700520DE2 /* WatchConnectivity.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 198EE5641DB022870021AE36 /* PlanetsClient */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 198EE5A31DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient" */;
+ buildPhases = (
+ 198EE5611DB022870021AE36 /* Sources */,
+ 198EE5621DB022870021AE36 /* Frameworks */,
+ 198EE5631DB022870021AE36 /* Resources */,
+ 198EE5A21DB022880021AE36 /* Embed Watch Content */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 198EE57F1DB022880021AE36 /* PBXTargetDependency */,
+ );
+ name = PlanetsClient;
+ productName = PlanetsClient;
+ productReference = 198EE5651DB022870021AE36 /* PlanetsClient.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 198EE57B1DB022880021AE36 /* PlanetsClient WatchKit App */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 198EE59F1DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient WatchKit App" */;
+ buildPhases = (
+ 198EE57A1DB022880021AE36 /* Resources */,
+ 198EE59E1DB022880021AE36 /* Embed App Extensions */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 198EE58E1DB022880021AE36 /* PBXTargetDependency */,
+ );
+ name = "PlanetsClient WatchKit App";
+ productName = "PlanetsClient WatchKit App";
+ productReference = 198EE57C1DB022880021AE36 /* PlanetsClient WatchKit App.app */;
+ productType = "com.apple.product-type.application.watchapp2";
+ };
+ 198EE58A1DB022880021AE36 /* PlanetsClient WatchKit Extension */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 198EE59B1DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient WatchKit Extension" */;
+ buildPhases = (
+ 198EE5871DB022880021AE36 /* Sources */,
+ 198EE5881DB022880021AE36 /* Frameworks */,
+ 198EE5891DB022880021AE36 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "PlanetsClient WatchKit Extension";
+ productName = "PlanetsClient WatchKit Extension";
+ productReference = 198EE58B1DB022880021AE36 /* PlanetsClient WatchKit Extension.appex */;
+ productType = "com.apple.product-type.watchkit2-extension";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 198EE55D1DB022870021AE36 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0810;
+ ORGANIZATIONNAME = "Oleg Yadrov";
+ TargetAttributes = {
+ 198EE5641DB022870021AE36 = {
+ CreatedOnToolsVersion = 8.1;
+ ProvisioningStyle = Automatic;
+ };
+ 198EE57B1DB022880021AE36 = {
+ CreatedOnToolsVersion = 8.1;
+ ProvisioningStyle = Automatic;
+ };
+ 198EE58A1DB022880021AE36 = {
+ CreatedOnToolsVersion = 8.1;
+ ProvisioningStyle = Automatic;
+ };
+ };
+ };
+ buildConfigurationList = 198EE5601DB022870021AE36 /* Build configuration list for PBXProject "PlanetsClient" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 198EE55C1DB022870021AE36;
+ productRefGroup = 198EE5661DB022870021AE36 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 198EE5641DB022870021AE36 /* PlanetsClient */,
+ 198EE57B1DB022880021AE36 /* PlanetsClient WatchKit App */,
+ 198EE58A1DB022880021AE36 /* PlanetsClient WatchKit Extension */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 198EE5631DB022870021AE36 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 198EE5781DB022870021AE36 /* LaunchScreen.storyboard in Resources */,
+ 198EE5751DB022870021AE36 /* Assets.xcassets in Resources */,
+ 198EE5731DB022870021AE36 /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 198EE57A1DB022880021AE36 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 198EE5851DB022880021AE36 /* Assets.xcassets in Resources */,
+ 198EE5831DB022880021AE36 /* Interface.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 198EE5891DB022880021AE36 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 198EE5971DB022880021AE36 /* Assets.xcassets in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 198EE5611DB022870021AE36 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 198EE5701DB022870021AE36 /* ViewController.m in Sources */,
+ 198EE56D1DB022870021AE36 /* AppDelegate.m in Sources */,
+ 198EE56A1DB022870021AE36 /* main.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 198EE5871DB022880021AE36 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 198EE5951DB022880021AE36 /* ExtensionDelegate.m in Sources */,
+ 198EE5921DB022880021AE36 /* InterfaceController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 198EE57F1DB022880021AE36 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 198EE57B1DB022880021AE36 /* PlanetsClient WatchKit App */;
+ targetProxy = 198EE57E1DB022880021AE36 /* PBXContainerItemProxy */;
+ };
+ 198EE58E1DB022880021AE36 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 198EE58A1DB022880021AE36 /* PlanetsClient WatchKit Extension */;
+ targetProxy = 198EE58D1DB022880021AE36 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 198EE5711DB022870021AE36 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 198EE5721DB022870021AE36 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "<group>";
+ };
+ 198EE5761DB022870021AE36 /* LaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 198EE5771DB022870021AE36 /* Base */,
+ );
+ name = LaunchScreen.storyboard;
+ sourceTree = "<group>";
+ };
+ 198EE5811DB022880021AE36 /* Interface.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 198EE5821DB022880021AE36 /* Base */,
+ );
+ name = Interface.storyboard;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 198EE5991DB022880021AE36 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_SUSPICIOUS_MOVES = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Debug;
+ };
+ 198EE59A1DB022880021AE36 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_SUSPICIOUS_MOVES = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 198EE59C1DB022880021AE36 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "PlanetsClient WatchKit Extension/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient.watchkitapp.watchkitextension;
+ PRODUCT_NAME = "${TARGET_NAME}";
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Debug;
+ };
+ 198EE59D1DB022880021AE36 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = "PlanetsClient WatchKit Extension/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient.watchkitapp.watchkitextension;
+ PRODUCT_NAME = "${TARGET_NAME}";
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Release;
+ };
+ 198EE5A01DB022880021AE36 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ DEVELOPMENT_TEAM = "";
+ IBSC_MODULE = PlanetsClient_WatchKit_Extension;
+ INFOPLIST_FILE = "PlanetsClient WatchKit App/Info.plist";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient.watchkitapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Debug;
+ };
+ 198EE5A11DB022880021AE36 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ DEVELOPMENT_TEAM = "";
+ IBSC_MODULE = PlanetsClient_WatchKit_Extension;
+ INFOPLIST_FILE = "PlanetsClient WatchKit App/Info.plist";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient.watchkitapp;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = watchos;
+ SKIP_INSTALL = YES;
+ TARGETED_DEVICE_FAMILY = 4;
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Release;
+ };
+ 198EE5A41DB022880021AE36 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = PlanetsClient/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Debug;
+ };
+ 198EE5A51DB022880021AE36 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ DEVELOPMENT_TEAM = "";
+ INFOPLIST_FILE = PlanetsClient/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ PRODUCT_BUNDLE_IDENTIFIER = Qt.PlanetsClient;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WATCHOS_DEPLOYMENT_TARGET = 2.0;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 198EE5601DB022870021AE36 /* Build configuration list for PBXProject "PlanetsClient" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 198EE5991DB022880021AE36 /* Debug */,
+ 198EE59A1DB022880021AE36 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 198EE59B1DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient WatchKit Extension" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 198EE59C1DB022880021AE36 /* Debug */,
+ 198EE59D1DB022880021AE36 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 198EE59F1DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient WatchKit App" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 198EE5A01DB022880021AE36 /* Debug */,
+ 198EE5A11DB022880021AE36 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 198EE5A31DB022880021AE36 /* Build configuration list for PBXNativeTarget "PlanetsClient" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 198EE5A41DB022880021AE36 /* Debug */,
+ 198EE5A51DB022880021AE36 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 198EE55D1DB022870021AE36 /* Project object */;
+}
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 000000000..194b0d2ec
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:PlanetsClient.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.h b/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.h
new file mode 100644
index 000000000..489a7861f
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.h
@@ -0,0 +1,12 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+
+@end
+
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.m
new file mode 100644
index 000000000..847df7d69
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/AppDelegate.m
@@ -0,0 +1,46 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import "AppDelegate.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+ // Override point for customization after application launch.
+ return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 000000000..a3ed4cb66
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,95 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "size" : "60x60",
+ "idiom" : "iphone",
+ "filename" : "icon120.png",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "icon180.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "83.5x83.5",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon120.png b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon120.png
new file mode 100644
index 000000000..c8ff9a2eb
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon120.png
Binary files differ
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon180.png b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon180.png
new file mode 100644
index 000000000..8d312e8a4
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Assets.xcassets/AppIcon.appiconset/icon180.png
Binary files differ
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/LaunchScreen.storyboard b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 000000000..fdf3f97d1
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="EHf-IW-A2E">
+ <objects>
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="53" y="375"/>
+ </scene>
+ </scenes>
+</document>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/Main.storyboard b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/Main.storyboard
new file mode 100644
index 000000000..d15768d40
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Base.lproj/Main.storyboard
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11535.1" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+ <device id="retina4_7" orientation="portrait">
+ <adaptation id="fullscreen"/>
+ </device>
+ <dependencies>
+ <deployment identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11523"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="tne-QT-ifu">
+ <objects>
+ <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Host Name (or IP address)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yQD-6e-UAt">
+ <rect key="frame" x="16" y="28" width="343" height="21"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <nil key="textColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bpy-NM-f5W">
+ <rect key="frame" x="16" y="162" width="343" height="30"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <state key="normal" title="Apply"/>
+ <connections>
+ <action selector="applyButtonClicked:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Vac-dy-zbh"/>
+ </connections>
+ </button>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Port" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Myw-mc-Fnd">
+ <rect key="frame" x="16" y="95" width="343" height="21"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <nil key="textColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="8080" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3ss-x9-aC2">
+ <rect key="frame" x="16" y="124" width="343" height="30"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <nil key="textColor"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits"/>
+ </textField>
+ <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="127.0.0.1" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="lbT-LC-4Rv">
+ <rect key="frame" x="16" y="57" width="343" height="30"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <nil key="textColor"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits"/>
+ </textField>
+ </subviews>
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+ </view>
+ <connections>
+ <outlet property="applyButton" destination="bpy-NM-f5W" id="6ch-bt-ccO"/>
+ <outlet property="hostNameTextField" destination="lbT-LC-4Rv" id="mNc-AV-o4s"/>
+ <outlet property="portTextField" destination="3ss-x9-aC2" id="zzX-4j-Sk4"/>
+ </connections>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+ </objects>
+ </scene>
+ </scenes>
+</document>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/Info.plist b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Info.plist
new file mode 100644
index 000000000..d05247386
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/Info.plist
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UIMainStoryboardFile</key>
+ <string>Main</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.h b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.h
new file mode 100644
index 000000000..ca14ab1bb
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.h
@@ -0,0 +1,13 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import <UIKit/UIKit.h>
+#import <WatchConnectivity/WatchConnectivity.h>
+
+@interface ViewController : UIViewController
+@property (weak, nonatomic) IBOutlet UITextField *hostNameTextField;
+@property (weak, nonatomic) IBOutlet UITextField *portTextField;
+@property (weak, nonatomic) IBOutlet UIButton *applyButton;
+
+@end
+
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m
new file mode 100644
index 000000000..c5b2c943b
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/ViewController.m
@@ -0,0 +1,48 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#import "ViewController.h"
+
+@interface ViewController () <WCSessionDelegate>
+
+@end
+
+@implementation ViewController
+
+- (void)session:(WCSession *)session activationDidCompleteWithState:(WCSessionActivationState)activationState error:(NSError *)error {
+
+}
+
+- (void)sessionDidBecomeInactive:(WCSession *)session {
+
+}
+
+- (void)sessionDidDeactivate:(WCSession *)session {
+
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ // Do any additional setup after loading the view, typically from a nib.
+
+ if ([WCSession isSupported]) {
+ WCSession *session = [WCSession defaultSession];
+ session.delegate = self;
+ [session activateSession];
+ }
+}
+
+- (IBAction)applyButtonClicked:(id)sender {
+ if ([[WCSession defaultSession] isReachable]) {
+ NSDictionary *dictionary = @{
+ @"host" : [self.hostNameTextField text],
+ @"port" : [self.portTextField text]
+ };
+
+ [[WCSession defaultSession] sendMessage:dictionary
+ replyHandler:^(NSDictionary *replyHandler) {}
+ errorHandler:^(NSError *error) {}];
+ }
+}
+
+@end
diff --git a/tests/manual/planets-qml/planets-watchos/PlanetsClient/main.m b/tests/manual/planets-qml/planets-watchos/PlanetsClient/main.m
new file mode 100644
index 000000000..22b991ddd
--- /dev/null
+++ b/tests/manual/planets-qml/planets-watchos/PlanetsClient/main.m
@@ -0,0 +1,16 @@
+//
+// main.m
+// PlanetsClient
+//
+// Created by Oleg Yadrov on 10/13/16.
+// Copyright © 2016 Oleg Yadrov. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/tests/manual/planets-qml/planets.js b/tests/manual/planets-qml/planets.js
new file mode 100644
index 000000000..50799e059
--- /dev/null
+++ b/tests/manual/planets-qml/planets.js
@@ -0,0 +1,187 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+.pragma library
+
+var SUN = 0;
+var MERCURY = 1;
+var VENUS = 2;
+var EARTH = 3;
+var MARS = 4;
+var JUPITER = 5;
+var SATURN = 6;
+var URANUS = 7;
+var NEPTUNE = 8;
+var NUM_SELECTABLE_PLANETS = 9;
+var MOON = 9;
+var SOLAR_SYSTEM = 100;
+
+function planetId(planetName) {
+ switch (planetName) {
+ case "Sun":
+ return SUN
+ case "Mercury":
+ return MERCURY
+ case "Venus":
+ return VENUS
+ case "Earth":
+ return EARTH
+ case "Mars":
+ return MARS
+ case "Jupiter":
+ return JUPITER
+ case "Saturn":
+ return SATURN
+ case "Uranus":
+ return URANUS
+ case "Neptune":
+ return NEPTUNE
+ case "Solar System":
+ return SOLAR_SYSTEM
+ }
+}
+
+function planetIndex(planetName) {
+ switch (planetName) {
+ case "Sun":
+ return 0
+ case "Mercury":
+ return 1
+ case "Venus":
+ return 2
+ case "Earth":
+ return 3
+ case "Mars":
+ return 4
+ case "Jupiter":
+ return 5
+ case "Saturn":
+ return 6
+ case "Uranus":
+ return 7
+ case "Neptune":
+ return 8
+ case "Solar System":
+ return 9
+ }
+}
+
+var planets = []; // Planet data info
+
+// Units are in 10^3 KM
+
+var solarDistance = 2600.000;
+var saturnOuterRadius = 0.120700;
+var uranusOuterRadius = 0.040;
+
+var auScale = 149.597870700; // 0.001 AU (in thousands of kilometers)
+
+function loadPlanetData() {
+
+ // Planet Data
+ // radius - planet radius
+ // tilt - planet axis angle
+ // N1/2 - longitude of the ascending node
+ // i1/2 - inclination to the ecliptic (plane of the Earth's orbit)
+ // w1/2 - argument of perihelion
+ // a1/2 - semi-major axis, or mean distance from Sun
+ // e1/2 - eccentricity (0=circle, 0-1=ellipse, 1=parabola)
+ // M1/2 - mean anomaly (0 at perihelion; increases uniformly with time)
+ // period - sidereal rotation period
+ // centerOfOrbit - the planet in the center of the orbit
+ // (orbital elements based on http://www.stjarnhimlen.se/comp/ppcomp.html)
+
+ var sun = { radius: 0.694439, tilt: 63.87, period: 25.05, x: 0, y: 0, z: 0,
+ roll: 0 };
+ planets.push(sun);
+ var mercury = {
+ radius: 0.002433722, tilt: 0.04, N1: 48.3313, N2: 0.0000324587,
+ i1: 7.0047, i2: 0.0000000500, w1: 29.1241, w2: 0.0000101444,
+ a1: 0.387098, a2: 0, e1: 0.205635, e2: 0.000000000559,
+ M1: 168.6562, M2: 4.0923344368, period: 58.646, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(mercury);
+ var venus = {
+ radius: 0.006046079, tilt: 177.36, N1: 76.6799, N2: 0.0000246590,
+ i1: 3.3946, i2: 0.0000000275, w1: 54.8910, w2: 0.0000138374,
+ a1: 0.723330, a2: 0, e1: 0.006773, e2: -0.000000001302,
+ M1: 48.0052, M2: 1.6021302244, period: 243.0185, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(venus);
+ var earth = {
+ radius: 0.006371, tilt: 25.44, N1: 174.873, N2: 0,
+ i1: 0.00005, i2: 0, w1: 102.94719, w2: 0,
+ a1: 1, a2: 0, e1: 0.01671022, e2: 0,
+ M1: 357.529, M2: 0.985608, period: 0.997, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(earth);
+ var mars = {
+ radius: 0.003389372, tilt: 25.19, N1: 49.5574, N2: 0.0000211081,
+ i1: 1.8497, i2: -0.0000000178, w1: 286.5016, w2: 0.0000292961,
+ a1: 1.523688, a2: 0, e1: 0.093405, e2: 0.000000002516,
+ M1: 18.6021, M2: 0.5240207766, period: 1.025957, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(mars);
+ var jupiter = {
+ radius: 0.07141254, tilt: 3.13, N1: 100.4542, N2: 0.0000276854,
+ i1: 1.3030, i2: -0.0000001557, w1: 273.8777, w2: 0.0000164505,
+ a1: 5.20256, a2: 0, e1: 0.048498, e2: 0.000000004469,
+ M1: 19.8950, M2: 0.0830853001, period: 0.4135, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(jupiter);
+ var saturn = {
+ radius: 0.06019958, tilt: 26.73, N1: 113.6634, N2: 0.0000238980,
+ i1: 2.4886, i2: -0.0000001081, w1: 339.3939, w2: 0.0000297661,
+ a1: 9.55475, a2: 0, e1: 0.055546, e2: -0.000000009499,
+ M1: 316.9670, M2: 0.0334442282, period: 0.4395, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(saturn);
+ var uranus = {
+ radius: 0.0255286, tilt: 97.77, N1: 74.0005, N2: 0.000013978,
+ i1: 0.7733, i2: 0.000000019, w1: 96.6612, w2: 0.000030565,
+ a1: 19.18171, a2: -0.0000000155, e1: 0.047318, e2: 0.00000000745,
+ M1: 142.5905, M2: 0.011725806, period: 0.71833, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(uranus);
+ var neptune = {
+ radius: 0.02473859, tilt: 28.32, N1: 131.7806, N2: 0.000030173,
+ i1: 1.7700, i2: -0.000000255, w1: 272.8461, w2: 0.000006027,
+ a1: 30.05826, a2: 0.00000003313, e1: 0.008606, e2: 0.00000000215,
+ M1: 260.2471, M2: 0.005995147, period: 0.6713, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: SUN
+ };
+ planets.push(neptune);
+ var moon = {
+ radius: 0.0015424, tilt: 28.32, N1: 125.1228, N2: -0.0529538083,
+ i1: 5.1454, i2: 0, w1: 318.0634, w2: 0.1643573223,
+ a1: 0.273, a2: 0, e1: 0.054900, e2: 0,
+ M1: 115.3654, M2: 13.0649929509, period: 27.321582, x: 0, y: 0, z: 0,
+ roll: 0, centerOfOrbit: EARTH
+ };
+ planets.push(moon);
+
+ return planets;
+}
+
+function getOuterRadius(planet) {
+ var outerRadius = solarDistance;
+ if (planet !== SOLAR_SYSTEM) {
+ outerRadius = planets[planet]["radius"];
+ if (planet === SATURN) {
+ outerRadius =+ saturnOuterRadius;
+ } else if (planet === URANUS) {
+ outerRadius =+ uranusOuterRadius;
+ } else if (planet === SUN) {
+ outerRadius = planets[planet]["radius"] / 10;
+ }
+ }
+
+ return outerRadius;
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetD.frag b/tests/manual/planets-qml/shaders/es2/planetD.frag
new file mode 100644
index 000000000..e680f534d
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetD.frag
@@ -0,0 +1,60 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+uniform highp mat4 viewMatrix;
+
+uniform highp vec3 lightPosition;
+uniform highp vec3 lightIntensity;
+
+uniform highp vec3 ka; // Ambient reflectivity
+uniform highp vec3 ks; // Specular reflectivity
+uniform highp float shininess; // Specular shininess factor
+uniform highp float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+
+varying highp vec4 positionInLightSpace;
+
+varying highp vec3 position;
+varying highp vec3 normal;
+varying highp vec2 texCoord;
+
+highp vec3 dModel(const highp vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ highp vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ highp vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ highp vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ highp float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ highp float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * ks);
+}
+
+void main()
+{
+ highp vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ highp vec3 result = dModel(flipYTexCoord);
+
+ highp float alpha = opacity * texture2D(diffuseTexture, flipYTexCoord).a;
+
+ gl_FragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetD.vert b/tests/manual/planets-qml/shaders/es2/planetD.vert
new file mode 100644
index 000000000..ccb004286
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetD.vert
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+attribute vec3 vertexPosition;
+attribute vec3 vertexNormal;
+attribute vec2 vertexTexCoord;
+
+varying vec4 positionInLightSpace;
+varying vec3 position;
+varying vec3 normal;
+varying vec2 texCoord;
+
+uniform mat4 lightViewProjection;
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+void main()
+{
+ const mat4 shadowMatrix = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+ positionInLightSpace = shadowMatrix * lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+
+ texCoord = vertexTexCoord * texCoordScale;
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetDB.frag b/tests/manual/planets-qml/shaders/es2/planetDB.frag
new file mode 100644
index 000000000..e21a60ede
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetDB.frag
@@ -0,0 +1,56 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+uniform highp mat4 viewMatrix;
+
+uniform highp vec3 lightPosition;
+uniform highp vec3 lightIntensity;
+
+uniform highp vec3 ka; // Ambient reflectivity
+uniform highp vec3 ks; // Specular reflectivity
+uniform highp float shininess; // Specular shininess factor
+uniform highp float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D normalTexture;
+
+varying highp vec4 positionInLightSpace;
+
+varying highp vec3 lightDir;
+varying highp vec3 viewDir;
+varying highp vec2 texCoord;
+
+highp vec3 dbModel(const highp vec3 norm, const highp vec2 flipYTexCoord)
+{
+ // Reflection of light direction about normal
+ highp vec3 r = reflect(-lightDir, norm);
+
+ highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ highp vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ highp float sDotN = max(dot(lightDir, norm), 0.0);
+ highp vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Calculate the specular highlight contribution
+ highp vec3 specular = vec3(0.0);
+ if (sDotN > 0.0)
+ specular = (lightIntensity * ks) * pow(max(dot(r, viewDir), 0.0), shininess);
+
+ return ambient + diffuse + specular;
+}
+
+void main()
+{
+ highp vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ highp vec4 normal = 2.0 * texture2D(normalTexture, flipYTexCoord) - vec4(1.0);
+
+ highp vec3 result = dbModel(normalize(normal.xyz), flipYTexCoord);
+
+ gl_FragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetDB.vert b/tests/manual/planets-qml/shaders/es2/planetDB.vert
new file mode 100644
index 000000000..ef76b4e7e
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetDB.vert
@@ -0,0 +1,61 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+attribute vec3 vertexPosition;
+attribute vec3 vertexNormal;
+attribute vec2 vertexTexCoord;
+attribute vec4 vertexTangent;
+
+varying vec4 positionInLightSpace;
+varying vec3 lightDir;
+varying vec3 viewDir;
+varying vec2 texCoord;
+
+uniform mat4 viewMatrix;
+uniform mat4 lightViewProjection;
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+uniform vec3 lightPosition;
+
+void main()
+{
+ const mat4 shadowMatrix = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+ positionInLightSpace = shadowMatrix * lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+
+ // Pass through texture coordinates
+ texCoord = vertexTexCoord * texCoordScale;
+
+ // Transform position, normal, and tangent to eye coords
+ vec3 normal = normalize(modelViewNormal * vertexNormal);
+ vec3 tangent = normalize(modelViewNormal * vertexTangent.xyz);
+ vec3 position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ // Calculate binormal vector
+ vec3 binormal = normalize(cross(normal, tangent));
+
+ // Construct matrix to transform from eye coords to tangent space
+ mat3 tangentMatrix = mat3 (
+ tangent.x, binormal.x, normal.x,
+ tangent.y, binormal.y, normal.y,
+ tangent.z, binormal.z, normal.z);
+
+ // Transform light direction and view direction to tangent space
+ vec3 s = lightPosition - position;
+ lightDir = normalize(tangentMatrix * vec3(viewMatrix * vec4(s, 1.0)));
+
+ vec3 v = -position;
+ viewDir = normalize(tangentMatrix * v);
+
+ // Calculate vertex position in clip coordinates
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetDS.frag b/tests/manual/planets-qml/shaders/es2/planetDS.frag
new file mode 100644
index 000000000..5835a9b3b
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetDS.frag
@@ -0,0 +1,61 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+uniform highp mat4 viewMatrix;
+
+uniform highp vec3 lightPosition;
+uniform highp vec3 lightIntensity;
+
+uniform highp vec3 ka; // Ambient reflectivity
+uniform highp float shininess; // Specular shininess factor
+uniform highp float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D specularTexture;
+
+varying highp vec4 positionInLightSpace;
+
+varying highp vec3 position;
+varying highp vec3 normal;
+varying highp vec2 texCoord;
+
+highp vec3 dsModel(const highp vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ highp vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ highp vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ highp vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ highp float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ highp float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb;
+ highp vec3 specularColor = texture2D(specularTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * specularColor);
+}
+
+void main()
+{
+ highp vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ highp vec3 result = dsModel(flipYTexCoord);
+
+ highp float alpha = opacity * texture2D(diffuseTexture, flipYTexCoord).a;
+
+ gl_FragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/planetDSB.frag b/tests/manual/planets-qml/shaders/es2/planetDSB.frag
new file mode 100644
index 000000000..c78c4a3e2
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/planetDSB.frag
@@ -0,0 +1,61 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+uniform highp mat4 viewMatrix;
+
+uniform highp vec3 lightPosition;
+uniform highp vec3 lightIntensity;
+
+uniform highp vec3 ka; // Ambient reflectivity
+uniform highp float shininess; // Specular shininess factor
+uniform highp float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D specularTexture;
+uniform sampler2D normalTexture;
+
+varying highp vec4 positionInLightSpace;
+
+varying highp vec3 lightDir;
+varying highp vec3 viewDir;
+varying highp vec2 texCoord;
+
+highp vec3 dsbModel(const highp vec3 norm, const highp vec2 flipYTexCoord)
+{
+ // Reflection of light direction about normal
+ highp vec3 r = reflect(-lightDir, norm);
+
+ highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb;
+ highp vec3 specularColor = texture2D(specularTexture, flipYTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ highp vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ highp float sDotN = max(dot(lightDir, norm), 0.0);
+ highp vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Calculate the specular highlight contribution
+ highp vec3 specular = vec3(0.0);
+ if (sDotN > 0.0)
+ specular = (lightIntensity * (shininess / (8.0 * 3.14))) * pow(max(dot(r, viewDir), 0.0), shininess);
+
+ specular *= specularColor;
+
+ return ambient + diffuse + specular;
+}
+
+void main()
+{
+ highp vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ // Sample the textures at the interpolated texCoords
+ highp vec4 normal = 2.0 * texture2D(normalTexture, flipYTexCoord) - vec4(1.0);
+
+ highp vec3 result = dsbModel(normalize(normal.xyz), flipYTexCoord);
+
+ // Combine spec with ambient+diffuse for final fragment color
+ gl_FragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/es2/sun.frag b/tests/manual/planets-qml/shaders/es2/sun.frag
new file mode 100644
index 000000000..e08850e9a
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/sun.frag
@@ -0,0 +1,26 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+uniform sampler2D diffuseTexture;
+
+varying highp vec3 position;
+varying highp vec2 texCoord;
+
+highp vec4 dModel(const highp vec2 flipYTexCoord)
+{
+ // Lookup diffuse
+ highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb;
+
+ return vec4(diffuseColor, 1.0);
+}
+
+void main()
+{
+ highp vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ highp vec4 result = dModel(flipYTexCoord);
+
+ gl_FragColor = result;
+}
diff --git a/tests/manual/planets-qml/shaders/es2/sun.vert b/tests/manual/planets-qml/shaders/es2/sun.vert
new file mode 100644
index 000000000..231711011
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/es2/sun.vert
@@ -0,0 +1,21 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+attribute vec3 vertexPosition;
+attribute vec2 vertexTexCoord;
+
+varying vec3 position;
+varying vec2 texCoord;
+
+uniform mat4 modelView;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+void main()
+{
+ texCoord = vertexTexCoord * texCoordScale;
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetD.frag b/tests/manual/planets-qml/shaders/gl3/planetD.frag
new file mode 100644
index 000000000..566e74f7a
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetD.frag
@@ -0,0 +1,63 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform mat4 viewMatrix;
+
+uniform vec3 lightPosition;
+uniform vec3 lightIntensity;
+
+uniform vec3 ka; // Ambient reflectivity
+uniform vec3 ks; // Specular reflectivity
+uniform float shininess; // Specular shininess factor
+uniform float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+
+in vec3 position;
+in vec3 normal;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+vec3 dModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * ks);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ result += dModel(flipYTexCoord);
+
+ float alpha = opacity * texture(diffuseTexture, flipYTexCoord).a;
+
+ fragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetD.vert b/tests/manual/planets-qml/shaders/gl3/planetD.vert
new file mode 100644
index 000000000..c6318f350
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetD.vert
@@ -0,0 +1,29 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+in vec3 vertexPosition;
+in vec3 vertexNormal;
+in vec2 vertexTexCoord;
+
+out vec3 position;
+out vec3 normal;
+out vec2 texCoord;
+
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+void main()
+{
+ texCoord = vertexTexCoord * texCoordScale;
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDB.frag b/tests/manual/planets-qml/shaders/gl3/planetDB.frag
new file mode 100644
index 000000000..4f7fd015a
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDB.frag
@@ -0,0 +1,66 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform mat4 viewMatrix;
+
+uniform vec3 lightPosition;
+uniform vec3 lightIntensity;
+
+uniform vec3 ka; // Ambient reflectivity
+uniform vec3 ks; // Specular reflectivity
+uniform float shininess; // Specular shininess factor
+uniform float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D normalTexture;
+
+in vec3 lightDir;
+in vec3 viewDir;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+void dbModel(const in vec3 norm, const in vec2 flipYTexCoord, out vec3 ambientAndDiff, out vec3 spec)
+{
+ // Reflection of light direction about normal
+ vec3 r = reflect(-lightDir, norm);
+
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ float sDotN = max(dot(lightDir, norm), 0.0);
+ vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Sum the ambient and diffuse contributions
+ ambientAndDiff = ambient + diffuse;
+
+ // Calculate the specular highlight contribution
+ spec = vec3(0.0);
+ if (sDotN > 0.0)
+ spec = (lightIntensity * ks) * pow(max(dot(r, viewDir), 0.0), shininess);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ // Sample the textures at the interpolated texCoords
+ vec4 normal = 2.0 * texture(normalTexture, flipYTexCoord) - vec4(1.0);
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Calculate the lighting model, keeping the specular component separate
+ vec3 ambientAndDiff, spec;
+ dbModel(normalize(normal.xyz), flipYTexCoord, ambientAndDiff, spec);
+ result = ambientAndDiff + spec;
+
+ // Combine spec with ambient+diffuse for final fragment color
+ fragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDB.vert b/tests/manual/planets-qml/shaders/gl3/planetDB.vert
new file mode 100644
index 000000000..14b98c814
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDB.vert
@@ -0,0 +1,54 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+in vec3 vertexPosition;
+in vec3 vertexNormal;
+in vec2 vertexTexCoord;
+in vec4 vertexTangent;
+
+out vec3 lightDir;
+out vec3 viewDir;
+out vec2 texCoord;
+
+uniform mat4 viewMatrix;
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+uniform vec3 lightPosition;
+
+void main()
+{
+ // Pass through texture coordinates
+ texCoord = vertexTexCoord * texCoordScale;
+
+ // Transform position, normal, and tangent to eye coords
+ vec3 normal = normalize(modelViewNormal * vertexNormal);
+ vec3 tangent = normalize(modelViewNormal * vertexTangent.xyz);
+ vec3 position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ // Calculate binormal vector
+ vec3 binormal = normalize(cross(normal, tangent));
+
+ // Construct matrix to transform from eye coords to tangent space
+ mat3 tangentMatrix = mat3 (
+ tangent.x, binormal.x, normal.x,
+ tangent.y, binormal.y, normal.y,
+ tangent.z, binormal.z, normal.z);
+
+ // Transform light direction and view direction to tangent space
+ vec3 s = lightPosition - position;
+ lightDir = normalize(tangentMatrix * vec3(viewMatrix * vec4(s, 1.0)));
+
+ vec3 v = -position;
+ viewDir = normalize(tangentMatrix * v);
+
+ // Calculate vertex position in clip coordinates
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDS.frag b/tests/manual/planets-qml/shaders/gl3/planetDS.frag
new file mode 100644
index 000000000..413816adc
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDS.frag
@@ -0,0 +1,62 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform mat4 viewMatrix;
+
+uniform vec3 lightPosition;
+uniform vec3 lightIntensity;
+
+uniform vec3 ka; // Ambient reflectivity
+uniform float shininess; // Specular shininess factor
+uniform float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D specularTexture;
+
+in vec3 position;
+in vec3 normal;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+vec3 dsModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+ vec3 specularColor = texture(specularTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * specularColor);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ result += dsModel(flipYTexCoord);
+
+ fragColor = vec4(result, opacity * texture(diffuseTexture, flipYTexCoord).a);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDSB.frag b/tests/manual/planets-qml/shaders/gl3/planetDSB.frag
new file mode 100644
index 000000000..c5ebf9e49
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDSB.frag
@@ -0,0 +1,67 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform mat4 viewMatrix;
+
+uniform vec3 lightPosition;
+uniform vec3 lightIntensity;
+
+uniform vec3 ka; // Ambient reflectivity
+uniform float shininess; // Specular shininess factor
+uniform float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+uniform sampler2D specularTexture;
+uniform sampler2D normalTexture;
+
+in vec3 lightDir;
+in vec3 viewDir;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+void dsbModel(const in vec3 norm, const in vec2 flipXTexCoord, out vec3 ambientAndDiff, out vec3 spec)
+{
+ // Reflection of light direction about normal
+ vec3 r = reflect(-lightDir, norm);
+
+ vec3 diffuseColor = texture(diffuseTexture, flipXTexCoord).rgb;
+ vec3 specularColor = texture(specularTexture, flipXTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ float sDotN = max(dot(lightDir, norm), 0.0);
+ vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Sum the ambient and diffuse contributions
+ ambientAndDiff = ambient + diffuse;
+
+ // Calculate the specular highlight contribution
+ spec = vec3(0.0);
+ if (sDotN > 0.0)
+ spec = (lightIntensity * (shininess / (8.0 * 3.14))) * pow(max(dot(r, viewDir), 0.0), shininess);
+
+ spec *= specularColor;
+}
+
+void main()
+{
+ vec2 flipXTexCoord = texCoord;
+ flipXTexCoord.x = 1.0 - texCoord.x;
+
+ // Sample the textures at the interpolated texCoords
+ vec4 normal = 2.0 * texture(normalTexture, flipXTexCoord) - vec4(1.0);
+
+ // Calculate the lighting model, keeping the specular component separate
+ vec3 ambientAndDiff, spec;
+ dsbModel(normalize(normal.xyz), flipXTexCoord, ambientAndDiff, spec);
+ vec3 result = ambientAndDiff + spec;
+
+ // Combine spec with ambient+diffuse for final fragment color
+ fragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDShadow.frag b/tests/manual/planets-qml/shaders/gl3/planetDShadow.frag
new file mode 100644
index 000000000..f236c8f47
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDShadow.frag
@@ -0,0 +1,70 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform mat4 viewMatrix;
+
+uniform vec3 lightPosition;
+uniform vec3 lightIntensity;
+
+uniform vec3 ka; // Ambient reflectivity
+uniform vec3 ks; // Specular reflectivity
+uniform float shininess; // Specular shininess factor
+uniform float opacity; // Alpha channel
+
+uniform sampler2D diffuseTexture;
+
+uniform sampler2DShadow shadowMapTexture;
+
+in vec4 positionInLightSpace;
+
+in vec3 position;
+in vec3 normal;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+vec3 dModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * ks);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ float shadowMapSample = textureProj(shadowMapTexture, positionInLightSpace);
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ if (shadowMapSample > 0)
+ result += dModel(flipYTexCoord);
+
+ float alpha = opacity * texture(diffuseTexture, flipYTexCoord).a;
+
+ fragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/planetDShadow.vert b/tests/manual/planets-qml/shaders/gl3/planetDShadow.vert
new file mode 100644
index 000000000..064456ffa
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/planetDShadow.vert
@@ -0,0 +1,38 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+in vec3 vertexPosition;
+in vec3 vertexNormal;
+in vec2 vertexTexCoord;
+
+out vec4 positionInLightSpace;
+out vec3 position;
+out vec3 normal;
+out vec2 texCoord;
+
+uniform mat4 lightViewProjection;
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+void main()
+{
+ const mat4 shadowMatrix = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+ positionInLightSpace = shadowMatrix * lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+
+ texCoord = vertexTexCoord * texCoordScale;
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/shadowmap.frag b/tests/manual/planets-qml/shaders/gl3/shadowmap.frag
new file mode 100644
index 000000000..96f754e51
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/shadowmap.frag
@@ -0,0 +1,8 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+void main()
+{
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/shadowmap.vert b/tests/manual/planets-qml/shaders/gl3/shadowmap.vert
new file mode 100644
index 000000000..9bfa508cf
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/shadowmap.vert
@@ -0,0 +1,13 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+in vec3 vertexPosition;
+
+uniform mat4 mvp;
+
+void main()
+{
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/sun.frag b/tests/manual/planets-qml/shaders/gl3/sun.frag
new file mode 100644
index 000000000..82c5bd035
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/sun.frag
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+uniform sampler2D diffuseTexture;
+
+in vec3 position;
+in vec2 texCoord;
+
+out vec4 fragColor;
+
+vec4 dModel(const in vec2 flipYTexCoord)
+{
+ // Lookup diffuse
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ return vec4(diffuseColor, 1.0);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec4 result = dModel(flipYTexCoord);
+
+ fragColor = result;
+}
diff --git a/tests/manual/planets-qml/shaders/gl3/sun.vert b/tests/manual/planets-qml/shaders/gl3/sun.vert
new file mode 100644
index 000000000..527602acb
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/gl3/sun.vert
@@ -0,0 +1,23 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 150 core
+
+in vec3 vertexPosition;
+in vec2 vertexTexCoord;
+
+out vec3 position;
+out vec2 texCoord;
+
+uniform mat4 modelView;
+uniform mat4 mvp;
+
+uniform float texCoordScale;
+
+void main()
+{
+ texCoord = vertexTexCoord * texCoordScale;
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetD.frag b/tests/manual/planets-qml/shaders/rhi/planetD.frag
new file mode 100644
index 000000000..2823c93f6
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetD.frag
@@ -0,0 +1,82 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+
+layout(location=0) in vec3 position;
+layout(location=1) in vec3 normal;
+layout(location=2) in vec2 texCoord;
+
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(location=0) out vec4 fragColor;
+
+vec3 dModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * ks);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ result += dModel(flipYTexCoord);
+
+ float alpha = opacity * texture(diffuseTexture, flipYTexCoord).a;
+
+ fragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetD.vert b/tests/manual/planets-qml/shaders/rhi/planetD.vert
new file mode 100644
index 000000000..3c9f33bd3
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetD.vert
@@ -0,0 +1,43 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(location=0) in vec3 vertexPosition;
+layout(location=1) in vec3 vertexNormal;
+layout(location=2) in vec2 vertexTexCoord;
+
+layout(location=0) out vec3 position;
+layout(location=1) out vec3 normal;
+layout(location=2) out vec2 texCoord;
+
+
+layout(std140, binding = 1) uniform qt3d_command_uniforms {
+ mat4 modelMatrix;
+ mat4 inverseModelMatrix;
+ mat4 modelViewMatrix;
+ mat3 modelNormalMatrix;
+ mat4 inverseModelViewMatrix;
+ mat4 modelViewProjection;
+ mat4 inverseModelViewProjectionMatrix;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+void main()
+{
+ texCoord = vertexTexCoord * texCoordScale;
+ normal = normalize(modelNormalMatrix * vertexNormal);
+ position = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
+
+ gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDB.frag b/tests/manual/planets-qml/shaders/rhi/planetDB.frag
new file mode 100644
index 000000000..0700b2391
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDB.frag
@@ -0,0 +1,85 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+layout(binding=4) uniform sampler2D normalTexture;
+
+layout(location = 0) in vec3 lightDir;
+layout(location = 1) in vec3 viewDir;
+layout(location = 2) in vec2 texCoord;
+
+layout(location = 0) out vec4 fragColor;
+
+void dbModel(const in vec3 norm, const in vec2 flipYTexCoord, out vec3 ambientAndDiff, out vec3 spec)
+{
+ // Reflection of light direction about normal
+ vec3 r = reflect(-lightDir, norm);
+
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ float sDotN = max(dot(lightDir, norm), 0.0);
+ vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Sum the ambient and diffuse contributions
+ ambientAndDiff = ambient + diffuse;
+
+ // Calculate the specular highlight contribution
+ spec = vec3(0.0);
+ if (sDotN > 0.0)
+ spec = (lightIntensity * ks) * pow(max(dot(r, viewDir), 0.0), shininess);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ // Sample the textures at the interpolated texCoords
+ vec4 normal = 2.0 * texture(normalTexture, flipYTexCoord) - vec4(1.0);
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Calculate the lighting model, keeping the specular component separate
+ vec3 ambientAndDiff, spec;
+ dbModel(normalize(normal.xyz), flipYTexCoord, ambientAndDiff, spec);
+ result = ambientAndDiff + spec;
+
+ // Combine spec with ambient+diffuse for final fragment color
+ fragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDB.vert b/tests/manual/planets-qml/shaders/rhi/planetDB.vert
new file mode 100644
index 000000000..178eac70c
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDB.vert
@@ -0,0 +1,84 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(location=0) in vec3 vertexPosition;
+layout(location=1) in vec3 vertexNormal;
+layout(location=2) in vec2 vertexTexCoord;
+layout(location=3) in vec4 vertexTangent;
+
+layout(location=0) out vec3 lightDir;
+layout(location=1) out vec3 viewDir;
+layout(location=2) out vec2 texCoord;
+
+
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(std140, binding = 1) uniform qt3d_command_uniforms {
+ mat4 modelMatrix;
+ mat4 inverseModelMatrix;
+ mat4 modelViewMatrix;
+ mat3 modelNormalMatrix;
+ mat4 inverseModelViewMatrix;
+ mat4 modelViewProjection;
+ mat4 inverseModelViewProjectionMatrix;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+void main()
+{
+ // Pass through texture coordinates
+ texCoord = vertexTexCoord * texCoordScale;
+
+ // Transform position, normal, and tangent to eye coords
+ vec3 normal = normalize(modelNormalMatrix * vertexNormal);
+ vec3 tangent = normalize(modelNormalMatrix * vertexTangent.xyz);
+ vec3 position = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
+
+ // Calculate binormal vector
+ vec3 binormal = normalize(cross(normal, tangent));
+
+ // Construct matrix to transform from eye coords to tangent space
+ mat3 tangentMatrix = mat3 (
+ tangent.x, binormal.x, normal.x,
+ tangent.y, binormal.y, normal.y,
+ tangent.z, binormal.z, normal.z);
+
+ // Transform light direction and view direction to tangent space
+ vec3 s = lightPosition - position;
+ lightDir = normalize(tangentMatrix * vec3(viewMatrix * vec4(s, 1.0)));
+
+ vec3 v = -position;
+ viewDir = normalize(tangentMatrix * v);
+
+ // Calculate vertex position in clip coordinates
+ gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDS.frag b/tests/manual/planets-qml/shaders/rhi/planetDS.frag
new file mode 100644
index 000000000..bb673b9ec
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDS.frag
@@ -0,0 +1,82 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+layout(binding=4) uniform sampler2D specularTexture;
+
+layout(location=0) in vec3 position;
+layout(location=1) in vec3 normal;
+layout(location=2) in vec2 texCoord;
+
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(location=0) out vec4 fragColor;
+
+vec3 dsModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+ vec3 specularColor = texture(specularTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * specularColor);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ result += dsModel(flipYTexCoord);
+
+ fragColor = vec4(result, opacity * texture(diffuseTexture, flipYTexCoord).a);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDSB.frag b/tests/manual/planets-qml/shaders/rhi/planetDSB.frag
new file mode 100644
index 000000000..6b0ffa06c
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDSB.frag
@@ -0,0 +1,87 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+layout(binding=4) uniform sampler2D normalTexture;
+layout(binding=5) uniform sampler2D specularTexture;
+
+layout(location = 0) in vec3 lightDir;
+layout(location = 1) in vec3 viewDir;
+layout(location = 2) in vec2 texCoord;
+
+layout(location = 0) out vec4 fragColor;
+
+void dsbModel(const in vec3 norm, const in vec2 flipXTexCoord, out vec3 ambientAndDiff, out vec3 spec)
+{
+ // Reflection of light direction about normal
+ vec3 r = reflect(-lightDir, norm);
+
+ vec3 diffuseColor = texture(diffuseTexture, flipXTexCoord).rgb;
+ vec3 specularColor = texture(specularTexture, flipXTexCoord).rgb;
+
+ // Calculate the ambient contribution
+ vec3 ambient = lightIntensity * ka * diffuseColor;
+
+ // Calculate the diffuse contribution
+ float sDotN = max(dot(lightDir, norm), 0.0);
+ vec3 diffuse = lightIntensity * diffuseColor * sDotN;
+
+ // Sum the ambient and diffuse contributions
+ ambientAndDiff = ambient + diffuse;
+
+ // Calculate the specular highlight contribution
+ spec = vec3(0.0);
+ if (sDotN > 0.0)
+ spec = (lightIntensity * (shininess / (8.0 * 3.14))) * pow(max(dot(r, viewDir), 0.0), shininess);
+
+ spec *= specularColor;
+}
+
+void main()
+{
+ vec2 flipXTexCoord = texCoord;
+ flipXTexCoord.x = 1.0 - texCoord.x;
+
+ // Sample the textures at the interpolated texCoords
+ vec4 normal = 2.0 * texture(normalTexture, flipXTexCoord) - vec4(1.0);
+
+ // Calculate the lighting model, keeping the specular component separate
+ vec3 ambientAndDiff, spec;
+ dsbModel(normalize(normal.xyz), flipXTexCoord, ambientAndDiff, spec);
+ vec3 result = ambientAndDiff + spec;
+
+ // Combine spec with ambient+diffuse for final fragment color
+ fragColor = vec4(result, opacity);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDShadow.frag b/tests/manual/planets-qml/shaders/rhi/planetDShadow.frag
new file mode 100644
index 000000000..857406210
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDShadow.frag
@@ -0,0 +1,87 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+layout(std140, binding = 0) uniform qt3d_render_view_uniforms {
+ mat4 viewMatrix;
+ mat4 projectionMatrix;
+ mat4 uncorrectedProjectionMatrix;
+ mat4 clipCorrectionMatrix;
+ mat4 viewProjectionMatrix;
+ mat4 inverseViewMatrix;
+ mat4 inverseProjectionMatrix;
+ mat4 inverseViewProjectionMatrix;
+ mat4 viewportMatrix;
+ mat4 inverseViewportMatrix;
+ vec4 textureTransformMatrix;
+ vec3 eyePosition;
+ float aspectRatio;
+ float gamma;
+ float exposure;
+ float time;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+layout(binding=4) uniform sampler2DShadow shadowMapTexture;
+
+layout(location = 3) in vec4 positionInLightSpace;
+
+layout(location = 0) in vec3 position;
+layout(location = 1) in vec3 normal;
+layout(location = 2) in vec2 texCoord;
+
+layout(location = 0)out vec4 fragColor;
+
+vec3 dModel(const in vec2 flipYTexCoord)
+{
+ // Calculate the vector from the light to the fragment
+ vec3 s = normalize(vec3(viewMatrix * vec4(lightPosition, 1.0)) - position);
+
+ // Calculate the vector from the fragment to the eye position
+ // (origin since this is in "eye" or "camera" space)
+ vec3 v = normalize(-position);
+
+ // Reflect the light beam using the normal at this fragment
+ vec3 r = reflect(-s, normal);
+
+ // Calculate the diffuse component
+ float diffuse = max(dot(s, normal), 0.0);
+
+ // Calculate the specular component
+ float specular = 0.0;
+ if (dot(s, normal) > 0.0)
+ specular = (shininess / (8.0 * 3.14)) * pow(max(dot(r, v), 0.0), shininess);
+
+ // Lookup diffuse and specular factors
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ // Combine the ambient, diffuse and specular contributions
+ return lightIntensity * ((ka + diffuse) * diffuseColor + specular * ks);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ float shadowMapSample = textureProj(shadowMapTexture, positionInLightSpace);
+
+ vec3 result = lightIntensity * ka * texture(diffuseTexture, flipYTexCoord).rgb;
+ if (shadowMapSample > 0)
+ result += dModel(flipYTexCoord);
+
+ float alpha = opacity * texture(diffuseTexture, flipYTexCoord).a;
+
+ fragColor = vec4(result, alpha);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/planetDShadow.vert b/tests/manual/planets-qml/shaders/rhi/planetDShadow.vert
new file mode 100644
index 000000000..0e675d5ce
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/planetDShadow.vert
@@ -0,0 +1,52 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(location=0) in vec3 vertexPosition;
+layout(location=1) in vec3 vertexNormal;
+layout(location=2) in vec2 vertexTexCoord;
+
+layout(location = 3) out vec4 positionInLightSpace;
+
+layout(location = 0) out vec3 position;
+layout(location = 1) out vec3 normal;
+layout(location = 2) out vec2 texCoord;
+
+layout(std140, binding = 1) uniform qt3d_command_uniforms {
+ mat4 modelMatrix;
+ mat4 inverseModelMatrix;
+ mat4 modelViewMatrix;
+ mat3 modelNormalMatrix;
+ mat4 inverseModelViewMatrix;
+ mat4 modelViewProjection;
+ mat4 inverseModelViewProjectionMatrix;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+ mat4 lightViewProjection;
+};
+
+void main()
+{
+ const mat4 shadowMatrix = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+ positionInLightSpace = shadowMatrix * lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+
+ texCoord = vertexTexCoord * texCoordScale;
+ normal = normalize(modelNormalMatrix * vertexNormal);
+ position = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
+
+ gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/shadowmap.frag b/tests/manual/planets-qml/shaders/rhi/shadowmap.frag
new file mode 100644
index 000000000..912ce125c
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/shadowmap.frag
@@ -0,0 +1,8 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+void main()
+{
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/shadowmap.vert b/tests/manual/planets-qml/shaders/rhi/shadowmap.vert
new file mode 100644
index 000000000..4f0167304
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/shadowmap.vert
@@ -0,0 +1,21 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(location=0) in vec3 vertexPosition;
+
+layout(std140, binding = 1) uniform qt3d_command_uniforms {
+ mat4 modelMatrix;
+ mat4 inverseModelMatrix;
+ mat4 modelViewMatrix;
+ mat3 modelNormalMatrix;
+ mat4 inverseModelViewMatrix;
+ mat4 modelViewProjection;
+ mat4 inverseModelViewProjectionMatrix;
+};
+
+void main()
+{
+ gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/sun.frag b/tests/manual/planets-qml/shaders/rhi/sun.frag
new file mode 100644
index 000000000..eed939c48
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/sun.frag
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+layout(binding=3) uniform sampler2D diffuseTexture;
+
+layout(location=0) in vec3 position;
+layout(location=1) in vec2 texCoord;
+
+layout(location = 0) out vec4 fragColor;
+
+vec4 dModel(const in vec2 flipYTexCoord)
+{
+ // Lookup diffuse
+ vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb;
+
+ return vec4(diffuseColor, 1.0);
+}
+
+void main()
+{
+ vec2 flipYTexCoord = texCoord;
+ flipYTexCoord.y = 1.0 - texCoord.y;
+
+ vec4 result = dModel(flipYTexCoord);
+
+ fragColor = result;
+}
diff --git a/tests/manual/planets-qml/shaders/rhi/sun.vert b/tests/manual/planets-qml/shaders/rhi/sun.vert
new file mode 100644
index 000000000..f13964449
--- /dev/null
+++ b/tests/manual/planets-qml/shaders/rhi/sun.vert
@@ -0,0 +1,39 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#version 450 core
+
+
+layout(location=0) in vec3 vertexPosition;
+layout(location=1) in vec2 vertexTexCoord;
+
+layout(location=0) out vec3 position;
+layout(location=1) out vec2 texCoord;
+
+layout(std140, binding = 1) uniform qt3d_command_uniforms {
+ mat4 modelMatrix;
+ mat4 inverseModelMatrix;
+ mat4 modelViewMatrix;
+ mat3 modelNormalMatrix;
+ mat4 inverseModelViewMatrix;
+ mat4 modelViewProjection;
+ mat4 inverseModelViewProjectionMatrix;
+};
+
+layout(std140, binding = 2) uniform extras_uniforms {
+ float texCoordScale;
+ vec3 ka; // Ambient reflectivity
+ vec3 ks; // Specular reflectivity
+ float shininess; // Specular shininess factor
+ float opacity; // Alpha channel
+ vec3 lightPosition;
+ vec3 lightIntensity;
+};
+
+void main()
+{
+ texCoord = vertexTexCoord * texCoordScale;
+ position = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
+ gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
+}