Trusted Software Excellence across Desktop and Embedded
Take a glance at the areas of expertise where KDAB excels ranging from swift troubleshooting, ongoing consulting and training to multi-year, large-scale software development projects.
Find out why customers from innovative industries rely on our extensive expertise, including Medical, Biotech, Science, Renewable Energy, Transportation, Mobility, Aviation, Automation, Electronics, Agriculture and Defense.
High-quality Embedded Engineering across the Stack
To successfully develop an embedded device that meets your expectations regarding quality, budget and time to market, all parts of the project need to fit perfectly together.
Learn more about KDAB's expertise in embedded software development.
Where the capabilities of modern mobile devices or web browsers fall short, KDAB engineers help you expertly architect and build high-functioning desktop and workstation applications.
Extensible, Safety-compliant Software for the Medical Sector
Create intelligent, patient-focused medical software and devices and stay ahead with technology that adapts to your needs.
KDAB offers you expertise in developing a broad spectrum of clinical and home-healthcare devices, including but not limited to, internal imaging systems, robotic surgery devices, ventilators and non-invasive monitoring systems.
Building digital dashboards and cockpits with fluid animations and gesture-controlled touchscreens is a big challenge.
In over two decades of developing intricate UI solutions for cars, trucks, tractors, scooters, ships, airplanes and more, the KDAB team has gained market leading expertise in this realm.
Build on Advanced Expertise when creating Modern UIs
KDAB assists you in the creation of user-friendly interfaces designed specifically for industrial process control, manufacturing, and fabrication.
Our specialties encompass the custom design and development of HMIs, enabling product accessibility from embedded systems, remote desktops, and mobile devices on the move.
Legacy software is a growing but often ignored problem across all industries. KDAB helps you elevate your aging code base to meet the dynamic needs of the future.
Whether you want to migrate from an old to a modern GUI toolkit, update to a more recent version, or modernize your code base, you can rely on over 25 years of modernization experience.
KDAB offers a wide range of services to address your software needs including consulting, development, workshops and training tailored to your requirements.
Our expertise spans cross-platform desktop, embedded and 3D application development, using the proven technologies for the job.
When working with KDAB, the first-ever Qt consultancy, you benefit from a deep understanding of Qt internals, that allows us to provide effective solutions, irrespective of the depth or scale of your Qt project.
Qt Services include developing applications, building runtimes, mixing native and web technologies, solving performance issues, and porting problems.
KDAB helps create commercial, scientific or industrial desktop applications from scratch, or update its code or framework to benefit from modern features.
Discover clean, efficient solutions that precisely meet your requirements.
Boost your team's programming skills with in-depth, constantly updated, hands-on training courses delivered by active software engineers who love to teach and share their knowledge.
Our courses cover Modern C++, Qt/QML, Rust, 3D programming, Debugging, Profiling and more.
The collective expertise of KDAB's engineering team is at your disposal to help you choose the software stack for your project or master domain-specific challenges.
Our particular focus is on software technologies you use for cross-platform applications or for embedded devices.
Since 1999, KDAB has been the largest independent Qt consultancy worldwide and today is a Qt Platinum partner. Our experts can help you with any aspect of software development with Qt and QML.
KDAB specializes in Modern C++ development, with a focus on desktop applications, GUI, embedded software, and operating systems.
Our experts are industry-recognized contributors and trainers, leveraging C++'s power and relevance across these domains to deliver high-quality software solutions.
KDAB can guide you incorporating Rust into your project, from as overlapping element to your existing C++ codebase to a complete replacement of your legacy code.
Unique Expertise for Desktop and Embedded Platforms
Whether you are using Linux, Windows, MacOS, Android, iOS or real-time OS, KDAB helps you create performance optimized applications on your preferred platform.
If you are planning to create projects with Slint, a lightweight alternative to standard GUI frameworks especially on low-end hardware, you can rely on the expertise of KDAB being one of the earliest adopters and official service partner of Slint.
KDAB has deep expertise in embedded systems, which coupled with Flutter proficiency, allows us to provide comprehensive support throughout the software development lifecycle.
Our engineers are constantly contributing to the Flutter ecosystem, for example by developing flutter-pi, one of the most used embedders.
KDAB invests significant time in exploring new software technologies to maintain its position as software authority. Benefit from this research and incorporate it eventually into your own project.
Start here to browse infos on the KDAB website(s) and take advantage of useful developer resources like blogs, publications and videos about Qt, C++, Rust, 3D technologies like OpenGL and Vulkan, the KDAB developer tools and more.
The KDAB Youtube channel has become a go-to source for developers looking for high-quality tutorial and information material around software development with Qt/QML, C++, Rust and other technologies.
Click to navigate the all KDAB videos directly on this website.
In over 25 years KDAB has served hundreds of customers from various industries, many of them having become long-term customers who value our unique expertise and dedication.
Learn more about KDAB as a company, understand why we are considered a trusted partner by many and explore project examples in which we have proven to be the right supplier.
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications.
Read more about the history, the values, the team and the founder of the company.
When working with KDAB you can expect quality software and the desired business outcomes thanks to decades of experience gathered in hundreds of projects of different sizes in various industries.
Have a look at selected examples where KDAB has helped customers to succeed with their projects.
KDAB is committed to developing high-quality and high-performance software, and helping other developers deliver to the same high standards.
We create software with pride to improve your engineering and your business, making your products more resilient and maintainable with better performance.
KDAB has been the first certified Qt consulting and software development company in the world, and continues to deliver quality processes that meet or exceed the highest expectations.
In KDAB we value practical software development experience and skills higher than academic degrees. We strive to ensure equal treatment of all our employees regardless of age, ethnicity, gender, sexual orientation, nationality.
Interested? Read more about working at KDAB and how to apply for a job in software engineering or business administration.
Qt 3D, being a retained mode high level graphic API abstraction, tries to hide most of the details involved in rendering the data provided by applications. It makes a lot of decisions and operations in the background in order to get pixels on the screen. But, because Qt 3D also has very rich API, developers can have a lot of control on the rendering by manipulating the scene graph and, more importantly, the frame graph. It is however sometimes difficult to understand how various operations affect performance.
In this article, we look at some of the tools, both old and new, that can be used to investigate what Qt 3D is doing in the back end and get some insight into what is going on during the frame.
Built in Profiling
The first step in handling performance issues is, of course, measuring where time is spent. This can be as simple as measuring how long it took to render a given frame. But to make sense of these numbers, it helps to have a notion of how complex the scene is.
In order to provide measurable information, Qt 3D introduces a visual overlay that will render details of the scene, constantly updated in real time.
The overlay shows some real time data:
Time to render last frame and FPS (frames per second), averaged and plotted over last few seconds. As Qt 3D is by default locking to VSync, this should not exceed 60fps on most configurations.
Number of Jobs: these are the tasks that Qt 3D executes on every frame. The number of jobs may vary depending on changes in the scene graph, whether animations are active, etc.
Number of Render Views: this matches loosely to render pass, see below discussion on the frame graph.
Number of Commands: this is total number of draw calls (and compute calls) in the frame.
Number of Vertices and Primitives (triangles, lines and points combined).
Number of Entities, Geometries and Textures in the scene graph. For the last two, the overlay will also show the number of geometries and textures that are effectively in use in the frame.
As seen in the screen shots above, the scene graph contains two entities, each with one geometry. This will produce two draw calls when both objects are in frame. But as the sphere rotates out of the screen, you can see the effect of the view frustum culling job which is making sure the sphere doesn't get rendered, leaving a single draw call for the torus.
This overlay can be enabled by setting the showDebugOverlay property of the QForwardRenderer to true.
Understanding Rendering Steps
To make sense of the numbers above, it helps to understand the details of the scene graph and frame graph.
In the simple case, as in the screen shots, an entity will have a geometry (and material, maybe a transform). But many entities may share the same geometry (a good thing if appropriate!). Also, entities may not have any geometry but just be used for grouping and positioning purposes.
So keeping an eye on the number of entities and geometries, and seeing how that effects the number of commands (or draw calls), is valuable. If you find one geometry drawn one thousand times in a thousand separate entities, if may be a good indication that you should refactor your scene to use instanced rendering.
In order to provide more details, the overlay has a number of buttons that can be used to dump the current state of the rendering data.
For a deeper understanding of this, you might consider our full Qt 3D Training course.
Scene Graph
Dumping the scene graph will print data to the console, like this:
This prints the hierarchy of entities and for each of them lists all the components. The id (in curly brackets) can be used to identify shared components.
Frame Graph
Similar data can be dumped to the console to show the active frame graph:
This is the default forward renderer frame graph that comes with Qt 3D Extras.
As you can see, one of the nodes in that graph is of type QDebugOverlay. If you build your own frame graph, you can use an instance of that node to control which surface the overlay will be rendered onto. Only one branch of the frame graph may contain a debug node. If the node is enabled, then the overlay will be rendered for that branch.
The frame graph above is one of the simplest you can build. They may get more complicated as you build effects into your rendering. Here's an example of a Kuesa frame graph:
If you are not familiar with the frame graph, it is important to understand that each path (from root to leaf) will represent a render pass. So the simple forward renderer will represent a simple render pass, but the Kuesa frame graph above contains eight passes!
It is therefore often easier to look at the frame graph in term of those paths. This can also be dumped to the console:
Hopefully this is a good way of finding out issues you may have when building your custom frame graph.
Draw Commands
On every pass of the frame graph, Qt 3D will traverse the scene graph, find entities that need to be rendered, and for each of them, issue a draw call. The number of objects drawn in each pass may vary, depending on whether the entities and all of their components are enabled or not, or whether entities get filtered out by using QLayers (different passes may draw different portions of the scene graph).
The new profiling overlay also gives you access to the actual draw calls.
So in this simple example, you can see that two draw calls are made, both for indexed triangles. You can also see some details about the render target, such as the viewport, the surface size, etc.
That information can also be dumped to the console which makes it easier to search in a text editor.
Built in Job Tracing
The data above provides a useful real time view on what is actually being processed to render a particular frame. However, it doesn't provide much feedback as to how long certain operations take and how that changes during the runtime of the application.
In order to track such information, you need to enable tracing.
Tracing tracks, for each frame, what jobs are executed by Qt 3D's backend. Jobs involve updating global transformations and the bounding volume hierarchy, finding objects in the view frustum, layer filtering, picking, input handling, animating, etc. Some jobs run every frame, some only run when internal state needs updating.
If your application is slow, it may be because jobs are taking a lot of time to complete. But how do you find out which jobs take up all the time?
Qt 3D has had tracing built in since a few years already, but it was hard to get to. You needed to do your own build of Qt 3D and enable tracing when running qmake. From thereon, every single run of an application linked against that build of Qt 3D would generate a trace file.
In 5.15, tracing is always available. It can be enabled in two ways:
By setting the QT3D_TRACE_ENABLED environment variable before the application starts (or at least before the aspect engine is created). This means the tracing will happen for the entire run of the application.
If you're interested in tracing for a specific part of your application's life time, you can enable the overlay and toggle tracing on and off using the check for Jobs. In this case, a new trace file will be generated every time the tracing is enabled.
For every tracing session, Qt 3D will generate one file in the current working directory. So how do you inspect the content of that file?
KDAB provides a visualisation tool but it is not currently shipped with Qt 3D. You can get the source and build it from GitHub here. Because jobs change from one version of Qt 3D to the next, you need to take care to configure which version was used to generate the trace files. Using that tool, you can open the trace files. It will render a time line of all the jobs that were executed for every frame.
In the example above, you can see roughly two frames worth of data, with jobs executed on a thread pool. You can see the longer running jobs, in this case:
RenderViewBuilder jobs, which create all the render views, one for each branch in the frame graph. You can see some of them take much longer that others.
FrameSubmissionPart1 and FrameSubmissionPart2 which contain the actual draw calls.
Of course, you need to spend some time understanding what Qt 3D is doing internally to make sense of that data. As with most performance monitoring tools, it's worth spending the time experimenting with this and seeing what gets affected by changes you make to your scene graph or frame graph.
Job Dependencies
Another important source of information when analysing performance of jobs is looking at the dependencies. This is mostly useful for developers of Qt 3D aspects.
Using the profiling overlay, you can now dump the dependency graph in GraphViz dot format.
Other Tools
Static capabilities
Qt 3D 5.15 introduces QRenderCapabilities which can be used to make runtime decisions based on the actual capabilities of the hardware the application is running on. The class supports a number of properties which report information such as the graphics API in use, the card vendor, the supported versions of OpenGL and GLSL. It also has information related to the maximum number of samples for MSAA, maximum texture size, if UBOs and SSBOs are supported and what their maximum size is, etc.
Third Party Tools
Of course, using more generic performance tools is also a good idea.
perf can be used for general tracing, giving you insight where time is spent, both for Qt 3D and for the rest of your application. Use it in combination with KDAB's very own hotspot to get powerful visualisation of the critical paths in the code.
Using the flame graph, as show above (captured on an embedded board), you can usually spot the two main sections of Qt 3D work, the job processing and the actual rendering.
Other useful tools are the OpenGL trace capture applications, either the generic ones such as apitrace and renderdoc, or the ones provided your hardware manufacturer, such as nVidia or AMD.
Conclusion
We hope this article will help you get more performance out of your Qt 3D applications. The tools, old and new, should be very valuable to help find bottlenecks and see the impact of changes you make to your scene graph or frame graph. Furthermore, improvements regarding performance are in the works for Qt 6, so watch this space!
About KDAB
Trusted software excellence across embedded and desktop platforms
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Hi, how can I enable the enviroment variable QT3D_TRACE_ENABLED in my proyect?
30 - Jun - 2020
Mike Krus
It's just an environment variable. Set it on the command line, set it in Creator's run time configuration for your project, or set it in code using qputenv before creating the first window.
15 - Jul - 2022
Hung
Hi @Mike Krus,
I'm developing a 3D application on QNX device using Qt 5.12. As I read your post, all your solutions are available from Qt5.15. Is there any tool that supports profiling my app which is being developed using Qt 5.12?
Thank you!
15 - Jul - 2022
Mike Krus
Depends what you're looking for. For GL calls you can use apitrace, the platform/vendor tools, etc. For tracking what Qt3D is doing you can build it to enable job traces (there's a configure option for that) and use the same job tracker. But that doesn't have all the information that the debug overlay provides.
I would recommend upgrading to 5.15 anyway, its performance is much better.
22 - Aug - 2022
antonius
Seems to be i am the stupid guy.
How to set QT3D_TRACE_ENABLED?
I tried it in different ways and no output.
23 - Aug - 2022
Mike Krus
when you build qt3d, you need to pass extra options to qmake. Something like: qmake <normal_options> -- --qt3d-profile-jobs=yes
(don't have a 5.12 build of qt available to test it out)
Mike Krus
Senior Software Engineer & Teamlead
Senior Software Engineer at KDAB. Mike has been developing with C++ since 1996 and Qt since 2004. He has a broad range of experience in scientific applications, mainly in civil engineering and oil & gas industries. His range of expertise includes C++, QML and interactive 3D visualization software design on desktop and mobile as well as macOS development. Mike is the Qt maintainer for the tvOS platform, one of the core contributors to Qt 3D and is interested in building mobile applications with Qt, mainly on iOS. He has a PhD in Computer Science.
6 Comments
30 - Jun - 2020
Angel Lillo
Hi, how can I enable the enviroment variable QT3D_TRACE_ENABLED in my proyect?
30 - Jun - 2020
Mike Krus
It's just an environment variable. Set it on the command line, set it in Creator's run time configuration for your project, or set it in code using qputenv before creating the first window.
15 - Jul - 2022
Hung
Hi @Mike Krus, I'm developing a 3D application on QNX device using Qt 5.12. As I read your post, all your solutions are available from Qt5.15. Is there any tool that supports profiling my app which is being developed using Qt 5.12? Thank you!
15 - Jul - 2022
Mike Krus
Depends what you're looking for. For GL calls you can use apitrace, the platform/vendor tools, etc. For tracking what Qt3D is doing you can build it to enable job traces (there's a configure option for that) and use the same job tracker. But that doesn't have all the information that the debug overlay provides. I would recommend upgrading to 5.15 anyway, its performance is much better.
22 - Aug - 2022
antonius
Seems to be i am the stupid guy. How to set QT3D_TRACE_ENABLED? I tried it in different ways and no output.
23 - Aug - 2022
Mike Krus
when you build qt3d, you need to pass extra options to qmake. Something like:
qmake <normal_options> -- --qt3d-profile-jobs=yes
(don't have a 5.12 build of qt available to test it out)