diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-12-12 15:30:22 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-01-17 07:12:06 +0000 |
commit | 34165446cd03a659eaea83d25dfdb91a22c0e2c5 (patch) | |
tree | ecb6483651e0dc2fb4ff5d6a83aa54ceaf7186f3 /examples/qt3d/scene3d | |
parent | 34cb77c210316dd254a8aa27052fb03223e3f7af (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/qt3d/scene3d')
-rw-r--r-- | examples/qt3d/scene3d/AnimatedEntity.qml | 3 | ||||
-rw-r--r-- | examples/qt3d/scene3d/main.cpp | 14 |
2 files changed, 16 insertions, 1 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; |