summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-12-12 15:30:22 +0000
committerMike Krus <mike.krus@kdab.com>2020-01-17 07:12:06 +0000
commit34165446cd03a659eaea83d25dfdb91a22c0e2c5 (patch)
treeecb6483651e0dc2fb4ff5d6a83aa54ceaf7186f3 /examples
parent34cb77c210316dd254a8aa27052fb03223e3f7af (diff)
Add Profiling Overlay
Can be activated at adding a QDebugOverlay in the frame graph to identify which surface it should be renderer one (renders only once on first branch that contains such a node). Can be also activated on the forward renderer from Qt3DExtras. - Shows information about FPS and number of jobs/renderviews/commands/vertices/entities/geometries/textures... - Allows to toggle job and gl call tracing and open folder where trace files are stored - Windows to show and dump glinfo and renderview/command details to the console Change-Id: I286ff85760e8f8f0604a23458883ff22229bda94 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qt3d/scene3d/AnimatedEntity.qml3
-rw-r--r--examples/qt3d/scene3d/main.cpp14
-rw-r--r--examples/qt3d/simple-qml/main.qml3
3 files changed, 18 insertions, 2 deletions
diff --git a/examples/qt3d/scene3d/AnimatedEntity.qml b/examples/qt3d/scene3d/AnimatedEntity.qml
index d1975cb47..2cfeeb73a 100644
--- a/examples/qt3d/scene3d/AnimatedEntity.qml
+++ b/examples/qt3d/scene3d/AnimatedEntity.qml
@@ -51,7 +51,7 @@
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
-import Qt3D.Extras 2.0
+import Qt3D.Extras 2.15
import QtQuick 2.0 as QQ2
@@ -77,6 +77,7 @@ Entity {
activeFrameGraph: ForwardRenderer {
camera: camera
clearColor: "transparent"
+ showDebugOverlay: true
}
},
InputSettings { }
diff --git a/examples/qt3d/scene3d/main.cpp b/examples/qt3d/scene3d/main.cpp
index 8886263f4..8d8bc581e 100644
--- a/examples/qt3d/scene3d/main.cpp
+++ b/examples/qt3d/scene3d/main.cpp
@@ -53,6 +53,20 @@
int main(int argc, char **argv)
{
+ {
+ // Set OpenGL requirements
+ QSurfaceFormat format = QSurfaceFormat::defaultFormat();
+#ifndef QT_OPENGL_ES_2
+ format.setVersion(4, 1);
+ format.setProfile(QSurfaceFormat::CoreProfile);
+ format.setSamples(4);
+#else
+ format.setVersion(3, 0);
+ format.setProfile(QSurfaceFormat::NoProfile);
+ format.setRenderableType(QSurfaceFormat::OpenGLES);
+#endif
+ QSurfaceFormat::setDefaultFormat(format);
+ }
QGuiApplication app(argc, argv);
QQuickView view;
diff --git a/examples/qt3d/simple-qml/main.qml b/examples/qt3d/simple-qml/main.qml
index 5eed965ca..9f4149202 100644
--- a/examples/qt3d/simple-qml/main.qml
+++ b/examples/qt3d/simple-qml/main.qml
@@ -52,7 +52,7 @@ import QtQuick 2.2 as QQ2
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
-import Qt3D.Extras 2.0
+import Qt3D.Extras 2.15
Entity {
id: sceneRoot
@@ -78,6 +78,7 @@ Entity {
activeFrameGraph: ForwardRenderer {
clearColor: Qt.rgba(0, 0.5, 1, 1)
camera: camera
+ showDebugOverlay: true
}
},
// Event Source will be set by the Qt3DQuickWindow