From 34165446cd03a659eaea83d25dfdb91a22c0e2c5 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Thu, 12 Dec 2019 15:30:22 +0000 Subject: 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 --- examples/qt3d/scene3d/AnimatedEntity.qml | 3 ++- examples/qt3d/scene3d/main.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'examples/qt3d/scene3d') 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; -- cgit v1.2.3