Skip to content
Snippets Groups Projects
Commit c512cfae authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

Modernize the manual test version of principledmaterials


The compressed texture based version was not following the recent API
changes. Do it now.

Change-Id: I630a2e16ec3742eb89d62138e3d7b9b7a5c05e44
Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
parent 9ece1a09
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@
#include <QQmlApplicationEngine>
#include <QtGui>
#include <QtQuick3D/private/qquick3dviewport_p.h>
#include <QtQuick3D/qquick3d.h>
int main(int argc, char *argv[])
{
......@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(QQuick3DViewport::idealSurfaceFormat());
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
......
......@@ -48,8 +48,8 @@
**
****************************************************************************/
import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick3D 1.15
Window {
......@@ -58,6 +58,7 @@ Window {
height: 720
visible: true
title: "Principled Materials Example"
color: "#848895"
MaterialControl {
id: materialCtrl
......@@ -73,23 +74,22 @@ Window {
//! [rotating light]
// Rotate the light direction
DirectionalLight {
rotation: Qt.vector3d(0, 100, 0)
eulerRotation.y: -100
brightness: 100
SequentialAnimation on rotation {
SequentialAnimation on eulerRotation.y {
loops: Animation.Infinite
PropertyAnimation {
duration: 5000
to: Qt.vector3d(0, 360, 0)
from: Qt.vector3d(0, 0, 0)
to: 360
from: 0
}
}
}
//! [rotating light]
} //! [rotating light]
//! [environment]
environment: SceneEnvironment {
probeBrightness: 250
clearColor: "#848895"
clearColor: window.color
backgroundMode: SceneEnvironment.Color
lightProbe: Texture {
......@@ -100,7 +100,7 @@ Window {
PerspectiveCamera {
id: camera
position: Qt.vector3d(0, 0, -600)
position: Qt.vector3d(0, 0, 600)
}
//! [basic principled]
......@@ -150,12 +150,12 @@ Window {
]
//! [textured principled]
SequentialAnimation on rotation {
SequentialAnimation on eulerRotation {
loops: Animation.Infinite
PropertyAnimation {
duration: 5000
to: Qt.vector3d(360, 360, 360)
from: Qt.vector3d(0, 0, 0)
to: Qt.vector3d(360, 360, 360)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment