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.
For quite some time now, you’ve been hearing about Qt3D's Framegraph. Although a brief definition of what the Framegraph is was given in the previous articles, this blog post will cover it in more detail. After reading this post, you will understand the difference between the Scenegraph and the Framegraph and see their respective uses. The more adventurous amongst you, will be able to pick up a pre-release version of Qt3D and start experimenting to see what the Framegraph can do for you.
Quite similarly to how the Scenegraph defines a scene out of a tree of Entities and Components, the Framegraph is also a tree structure but one used for a different purpose. Let's explain what that purpose is and our motivation for this design.
Over the course of rendering a single frame, a 3D renderer will likely change state many times. The number and nature of these state changes depends upon not only which materials (shaders, mesh geometry, textures and uniform variables), but also upon which high level rendering scheme you are using. For example, using a traditional simple forward rendering scheme is very different to using a deferred rendering approach. Other features such as reflections, shadows, multiple viewports, early z-fill passes all change which states a renderer needs to set over the course of a frame.
As a comparison, the renderer responsible for drawing Qt Quick 2 scenes is hard-wired in C++ to do things like batching of primitives, rendering opaque items followed by rendering of transparent items. In the case of Qt Quick 2 that is perfectly fine as that covers all of the requirements. As you can see from some of the examples listed above, such a hard-wired renderer is not likely to be flexible enough for generic 3D scenes given the multitude of rendering methods available. To make matters worse, more rendering methods are being researched all of the time. We therefore needed an approach that is both flexible and extensible whilst being simple to use and maintain. Enter the Framegraph!
Each node in the Framegraph defines a part of the configuration the renderer will use to render the scene. The position of a node in the Framegraph tree determines when and where the subtree rooted at that node will be the active configuration in the rendering pipeline. As we will see later in this article, the renderer traverses this tree in order to build up the state needed for your rendering algorithm at each point in the frame.
Obviously if you just want to render a simple cube onscreen you may think this is overkill. However, as soon as you want to start doing slightly more complex scenes this comes in handy. We will show this by presenting a few examples and the resulting Framegraphs.
Please note that unlike the Scenegraph which is composed of Entities and Components, the Framegraph is only composed of nested nodes which are all subclasses of Qt3D::QFrameGraphNode. This is because the Framegraph nodes are not simulated objects in our virtual world, but rather supporting information.
We will soon see how to construct our first simple Framegraph but before that we will be introduce the Framegraph nodes available to you. Also as with the Scenegraph tree, the QML and C++ APIs are a 1 to 1 match so you can favor the one you like best. For the sake of readability and conciseness, the QML API was chosen for this article.
FrameGraph Nodes
FrameGraph nodes specify how the renderer should sort rendering commands
FrameGraph Node
Description
ClearBuffer
Specify which OpenGL buffers should be cleared
CameraSelector
Specifies which camera should be used to perform the rendering
LayerFilter
Specifies which entities to renderer by filtering all Entity that have a matching Layer Components
Viewport
Defines a rectangular viewport where the scene will be drawn
TechniqueFilter
Defines the annotations (criteria) to be used to select the best matching Technique in a Material
RenderPassFilter
Defines the annotiations (criteria) to be used to select the best matching RenderPass in a Technique
RenderTargetSelector
Specifies which RenderTarget (FBO + Attachment) should be used for rendering
SortMethod
Specifies how the renderer should sort rendering commands
The beauty of the Framegraph is that combining these simple node types, it is possible to configure the renderer to suit your specific needs without touching any hairy, low-level C/C++ rendering code at all.
Qt3D will provide default Framegraph trees that correspond to common use cases, however if you need a renderer configuration that is out of the ordinary, you will most likely have to get your hands dirty and write your own Framegraph tree.
FrameGraph rules
In order to construct a correctly functioning Framegraph tree, you should know a few rules about how it is traversed and how to feed it to the Qt3D renderer.
Setting the Framegraph
The FrameGraph tree should be assigned to the activeFrameGraph property of a QFrameGraph component itself being a component of the root entity in the Qt3D scene. This is what makes it the active Framegraph for the renderer. Of course, since this is a QML property binding, the active Framegraph (or parts of it) can be changed on the fly at runtime. For example, if you want to use different rendering approaches for indoor vs outdoor scenes or to enable/disable some special effect.
The Qt3D renderer performs a depth first traversal of the Framegraph tree. Note that, because the traversal is depth first, the order in which you define nodes is important.
When the renderer reaches a leaf node of the Framegraph, it collects together all of the stat specified by the path from the leaf node to the root node. This defines the state used to render a section of the frame. If you are interested in the internals of Qt3D, this collection of state is called a RenderView.
Given the configuration contained in a RenderView, the renderer collects together all of the Entities in the Scenegraph to be rendered, and from them builds a set of RenderCommands and associates them with the RenderView.
The combination of RenderView and set of RenderCommands is passed over for submission to OpenGL.
When this is repeated for each leaf note in the Framegraph, the frame is complete and the renderer calls our old friend, swapBuffers(), to display the frame.
If all of this sounds very complex, don't worry, it is fairly complex but the good news is that using the Framegraph is really quite easy. At its heart, the Framegraph is a data-driven method for configuring the Qt3D renderer. Due to its data-driven nature, we can change configuration at runtime, allow non-C++ developers or designers to change the structure of a frame, and try out new rendering approaches without having to write 3000 lines of boiler plate code.
Let's try to explain this more with the help of some examples of increasing complexity.
Let's practice
Now that you know the rules to abide by when writing a Framegraph tree, we will go over a few examples and break them down.
A simple forward Renderer
Forward rendering is when you use OpenGL in its traditional manner and render directly to the backbuffer one object at a time shading each one as we go. This is opposed to deferred rendering where we render to an intermediate G-buffer. Here is a simple FrameGraph that can be used for forward rendering:
Viewport{rect:Qt.rect(0.0,0.0,1.0,1.0) property alias camera: cameraSelector.cameraClearBuffer{buffers:ClearBuffer.ColorDepthBufferCameraSelector{id: cameraSelector
}}}
As you can see, this tree has a single leaf and is composed of 3 nodes in total as shown in the following diagram.
Using the rules defined above, this framegraph tree yields a single RenderView with the following configuration:
Leaf Node -> RenderView
Viewport that fills the entire screen (uses normalized coordinates to make it easy to support nested viewports)
Color and Depth buffers are set to be cleared
Camera specified in the exposed camera property
Several different FrameGraph trees can produce the same rendering result. As long as the state collected from leaf to root is the same the result will also be the same. It's best to put state that remains constant longest nearer to the root of the framegraph as this will result in fewer leaf nodes, and hence, RenderViews, overall.
Viewport{rect:Qt.rect(0.0,0.0,1.0,1.0) property alias camera: cameraSelector.cameraCameraSelector{id: cameraSelector
ClearBuffer{buffers:ClearBuffer.ColorDepthBuffer}}}
Let’s move on to a slightly more complex example that renders a Scenegraph from the point of view of 4 virtual cameras into the 4 quadrants of the window. This is a common configuration for 3D CAD/modelling tools or could be adjusted to help with rendering a rear-view mirror in a car racing game or a CCTV camera display.
Viewport{id: mainViewport
rect:Qt.rect(0,0,1,1) property alias Camera: cameraSelectorTopLeftViewport.camera property alias Camera: cameraSelectorTopRightViewport.camera property alias Camera: cameraSelectorBottomLeftViewport.camera property alias Camera: cameraSelectorBottomRightViewport.cameraClearBuffer{buffers:ClearBuffer.ColorDepthBuffer}Viewport{id: topLeftViewport
rect:Qt.rect(0,0,0.5,0.5)CameraSelector{id: cameraSelectorTopLeftViewport }}Viewport{id: topRightViewport
rect:Qt.rect(0.5,0,0.5,0.5)CameraSelector{id: cameraSelectorTopRightViewport }}Viewport{id: bottomLeftViewport
rect:Qt.rect(0,0.5,0.5,0.5)CameraSelector{id: cameraSelectorBottomLeftViewport }}Viewport{id: bottomRightViewport
rect:Qt.rect(0.5,0.5,0.5,0.5)CameraSelector{id: cameraSelectorBottomRightViewport }}}
This tree is a bit more complex with 5 leaves. Following the same rules as before we construct 5 RenderView objects from the FrameGraph. The following diagrams show the construction for the first two RenderViews. The remaining RenderViews are very similar to the second diagram just with the other sub-trees
In full, the RenderViews created are:
RenderView (1)
Fullscreen viewport defined
Color and Depth buffers are set to be cleared
RenderView (2)
Fullscreen viewport defined
Sub viewport defined (rendering viewport will be scaled relative to its parent)
CameraSelector specified
RenderView (3)
Fullscreen viewport defined
Sub viewport defined (rendering viewport will be scaled relative to its parent)
CameraSelector specified
RenderView (4)
Fullscreen viewport defined
Sub viewport defined (rendering viewport will be scaled relative to its parent)
CameraSelector specified
RenderView (5)
Fullscreen viewport defined
Sub viewport defined (rendering viewport will be scaled relative to its parent)
CameraSelector specified
However, in this case the order is important. If the ClearBuffer node were to be the last instead of the first, this would results in a black screen for the simple reason that everything would be cleared right after having been so carefully rendered. For a similar reason, it couldn't be used as the root of the FrameGraph as that would result in a call to clear the whole screen for each of our viewports.
Although the declaration order of the FrameGraph is important, Qt3D is able to process each RenderView in parallel as each RenderView is independent of the others for the purposes of generating a set of RenderCommands to be submitted whilst the RenderView's state is in effect.
Qt3D uses a task-based approach to parallelism which naturally scales up with the number of available cores. This is shown in the following diagram for the previous example.
The RenderCommands for the RenderViews can be generated in parallel across many cores, and as long as we take care to submit the RenderViews in the correct order on the dedicated OpenGL submission thread, the resulting scene will be rendered correctly.
Deferred Renderer
When it comes to rendering, deferred rendering is a whole different beast in terms of renderer configuration compared to forward rendering. Instead of drawing each mesh and applying a shader effect to colorize it, deferred rendering adopts a two render pass method.
First all the meshes in the scene are drawn using the same shader that will output, usually for each fragment, at least four values:
normal vector
color
depth
position
Each of these values will be stored in a texture. The normal, color, depth and position textures form what is called the G-Buffer. Nothing is drawn onscreen during the first pass, but rather drawn into the G-Buffer ready for later use.
Once all the meshes have been drawn, the G-Buffer is filled with all the meshes that can currently be seen by the camera. The second render pass is then used to render the scene to the back buffer with the final color shading by reading the normal, color and position values from the G-buffr textures, and outputting a color onto a full screen quad.
The advantage of that technique is that the heavy computing power required for complex effects is only used during the second pass only on the elements that are actually being seen by the camera. The first pass doesn't cost much processing power as every mesh is being drawn with a simple shader. Deferred rendering, therefore, decouples shading and lighting from the number of objects in a scene and instead couples it to the resolution of the screen (and G-Buffer). This is a technique that has been used in many games in the recent years and although it has some issues (handling transparency, high GPU memory bandwidth and requires multiple render targets), it remains a popular choice.
Viewport{rect:Qt.rect(0.0,0.0,1.0,1.0) property alias gBuffer: gBufferTargetSelector.target property alias camera: sceneCameraSelector.cameraLayerFilter{layers:"scene"RenderTargetSelector{id: gBufferTargetSelector
ClearBuffer{buffers:ClearBuffer.ColorDepthBufferRenderPassFilter{id: geometryPass
includes:Annotation{name:"pass"; value:"geometry"}CameraSelector{id: sceneCameraSelector
}}}}}LayerFilter{layers:"screenQuad"ClearBuffer{buffers:ClearBuffer.ColorDepthBufferRenderPassFilter{id: finalPass
includes:Annotation{name:"pass"; value:"final"}}}}}
Graphically, the resulting Framegraph looks like
And the resulting RenderViews are:
RenderView (1)
defines a viewport that fills the whole screen
select all Entities that have a Layer component matching "scene"
Set the gBuffer as the active render target
clear the color and depth on the currently bound render target (the gBuffer)
select only Entities in the scene that have a Material and Technique matching the annotations in the RenderPassFilter
specify which camera should be used
RenderView (2)
defines a viewport that fills the whole screen
select all Entities that have a Layer component matching "screenQuad"
clear the color and depth buffers on the currently bound framebuffer (the screen)
select only Entities in the scene that have a Material and Technique matching the annotations in the RenderPassFilter
Other benefits of the Framegraph
Since the FrameGraph tree is entirely data-driven and can be modified dynamically at runtime, you can:
Have different Framegraph trees for different platforms and hardware and select the most appropriate at runtime
Easily add and enable visual debugging in a scene
Use different FrameGraph trees depending on the nature of what you need to render for a particular region of the scene
Also by providing a powerful tool such as FrameGraph, anyone is able to implement a new rendering technique without having to modify Qt3D's internals.
Conclusion
In this post, we have introduced the FrameGraph and the node types that compose it. We then went on to discuss a few examples to illustrate the Framegraph building rules and how the Qt3D engine uses the Framegraph behind the scenes. By now you should have a pretty good overview of the FrameGraph and how it can be used (perhaps to add an early z-fill pass to a forward renderer). Also you should always keep in mind that the FrameGraph is a tool for you to use so that you are not tied down to the provided renderer and materials that Qt3D provides out of the box.
As always, please do not hesitate to ask questions.
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.
Can you give us a relatively detailed description on "LayerFilter" type and its usages?
2 - Mar - 2015
Paul Lemire
On one side you have your scene tree composed of Entities which aggregate Components. There is a Layer Component on which you can set names. Different Entities can have different Layer Components but just setting Layer Components on Entities is meaningless if you do not configure your FrameGraph tree to filter out layers. That's where the LayerFilter FrameGraph node comes in. It has a layers property. When the layers property matches one or more Layer names, that means that the rendering will only apply on the Entities that were positively filtered. Entities that didn't have a Layer component or whose Layer's names didn't match the LayerFilter are simply ignored.
This is really useful if you want to render only some Entities given some conditions such as a debug mode where you would be drawing bounding boxes for example. Another use case is when doing deferred rendering. First you select all the Entities that needs to be renderer into the GBuffer, then in a second pass, you only draw a simple quad on which you apply the GBuffer textures.
You can see a real life use of layers filtering in the deferred-renderer example https://bit.ly/2uHck0N
3 - Mar - 2015
jiangcaiyang
The "ForwardRenderer" type is not present on "FrameGraph Nodes" table.
3 - Mar - 2015
Paul Lemire
That is because the ForwardRenderer is not a FrameGraph Node type in itself. It is a default FrameGraph tree implementation for a forward renderer provided as a convenience for users. Here you can see what the ForwardRenderer expands to https://bit.ly/2uKMAAr
30 - May - 2015
Andrey
What is the frame rate of Qt3D? How is the frequency of buffer swapping defined?
30 - May - 2015
Paul Lemire
Right now the Qt3D framerate is tied to the v-sync refresh rate, usually 60 fps
3 - Apr - 2018
Jeff Flinn
The bit.ly links in your replies are broken... can these be updated?
4 - Apr - 2018
Paul Lemire
Done
Paul Lemire
Senior Software Engineer
Senior software engineer at KDAB, Paul is a Qt approver and active contributor to the Qt 3D module where he is one of the main developers. He has been developing Qt based C++ and QML applications since 2010 and has particular interest and expertise in OpenGL and GPU assisted computing. Paul holds a Master’s degree in Computer Science.
8 Comments
2 - Mar - 2015
jiangcaiyang
Can you give us a relatively detailed description on "LayerFilter" type and its usages?
2 - Mar - 2015
Paul Lemire
On one side you have your scene tree composed of Entities which aggregate Components. There is a Layer Component on which you can set names. Different Entities can have different Layer Components but just setting Layer Components on Entities is meaningless if you do not configure your FrameGraph tree to filter out layers. That's where the LayerFilter FrameGraph node comes in. It has a layers property. When the layers property matches one or more Layer names, that means that the rendering will only apply on the Entities that were positively filtered. Entities that didn't have a Layer component or whose Layer's names didn't match the LayerFilter are simply ignored.
This is really useful if you want to render only some Entities given some conditions such as a debug mode where you would be drawing bounding boxes for example. Another use case is when doing deferred rendering. First you select all the Entities that needs to be renderer into the GBuffer, then in a second pass, you only draw a simple quad on which you apply the GBuffer textures.
You can see a real life use of layers filtering in the deferred-renderer example https://bit.ly/2uHck0N
3 - Mar - 2015
jiangcaiyang
The "ForwardRenderer" type is not present on "FrameGraph Nodes" table.
3 - Mar - 2015
Paul Lemire
That is because the ForwardRenderer is not a FrameGraph Node type in itself. It is a default FrameGraph tree implementation for a forward renderer provided as a convenience for users. Here you can see what the ForwardRenderer expands to https://bit.ly/2uKMAAr
30 - May - 2015
Andrey
What is the frame rate of Qt3D? How is the frequency of buffer swapping defined?
30 - May - 2015
Paul Lemire
Right now the Qt3D framerate is tied to the v-sync refresh rate, usually 60 fps
3 - Apr - 2018
Jeff Flinn
The bit.ly links in your replies are broken... can these be updated?
4 - Apr - 2018
Paul Lemire
Done