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.
One of the biggest driving factors behind the design of Qt3D 2.0 is the ability to configure the renderer in order to accommodate custom rendering techniques. In this blog post I will explain how to render a scene in Qt3D with shadows.
Shadow mapping in Qt3D. Note the self-shadowing of the plane and of the trefoil knot.
The complete working source code for this blog post is available in the Qt3D repository, under the examples/shadow_map_qml directory. The entire rendering will be configured using QML (i.e. this is a QML-only example), but it's perfectly possible to also use C++ to achieve the very same result.
Shadow mapping
Shadows are not directly supported by OpenGL, and these days there are countless techniques that can be employed to generate them. Shadow mapping is one of the oldest; it's still widely used due to its simplicity and ability to generate good-looking shadows, while having a very small performance cost. The Wikipedia entry on shadow mapping has a very good overview of the modern incantations of this technique. However, for our purposes, we are going to stick to a very basic version of it.
Shadow mapping is typically implemented using a two pass rendering. In the first pass we generate the shadow information, and in the second pass we can render the scene "normally" (i.e., using any rendering technique of our choice), while at the same time using the information gathered in the first pass to draw the shadows.
The idea behind shadow mapping is the following: only the closest fragments to the light are the ones lit. Fragments "behind" other fragments are occluded, and therefore in shadow.
Therefore, in the first pass we draw the scenefrom the point of view of the light. The information that we then store is simply the distance of the closest fragment in this "light space". In OpenGL terms, this corresponds to having a Framebuffer Object, or FBO, with a depth texture attached to it. In fact, the "distance from the eye" is the definition of the depth; and the default depth testing done by OpenGL will actually store only the depth for the closest fragment.
(A color texture attachment is not even needed -- we don't need to shade fragments, only to calculate their depth.)
Exaggerated shadow map texture of the very same scene represented above.
The image above is the shadow map. That is, the depth stored when rendering the scene from the light point of view; darker colours represent a shallow depth (i.e. closer to the camera). In our scene, the light sits somewhere above the objects in the scene, on the right side w.r.t. the main camera (cf. the previous screenshot). This matches with the fact that the toyplane is closer to the camera than the other objects.
Once we have generated the shadow map, we then do the second rendering pass. In this second pass we render using the normal scene's camera; we can use any desired effect here, like for instance Phong shading. The important bit is that in the fragment shader we apply the shadow map algorithm, that is, we ask: is that fragment the closest fragment to the light? If so, then it must be drawn lit; otherwise, it must be drawn in shadow.
How to answer that question is easy once we have the shadow map generated in the first pass. All it suffices is to remap the fragment in light space, therefore calculating its depth from the light point of view, as well as where its coordinates are on the shadow map texture. We can then sample the shadow map texture at the given coordinates and compare the fragment's depth with the result of the sampling: if the fragment is further away, then it's in shadow, otherwise it is lit.
This is the theory about shadow mapping. Let's see how to turn this theory into code using Qt3D.
Getting started
Let's start from the main.qml file, where we set up the entire scene.
The first components we create are a Camera, which represents the camera used for the final rendering, and a Configuration element which allows us to control this camera using the keyboard or the mouse. The parameters of the camera are self-explainatory and there isn't much to say about that.
We then create a Light entity, which represents our light -- a directional spotlight, sitting somewhere above the plane, and looking down at the scene's origin. This light entity is then used by our custom frame graph, ShadowMapFrameGraph, and our rendering effect, AdsEffect, whose instances are created just after the light.
Lastly, we create three entities for the meshes in the scene: a trefoil knot, a toy aircraft, and a ground plane. The implementation of these three entities is straightforward and will not be covered here; they simply aggregate a mesh, a transformation and a material that uses the effect defined above. For extra fun, the toyplane and the trefoil knot transformations are actually animated.
As I said before, the light is a directional spotlight. Since in the first rendering pass we're going to use the light as a camera, I decided to actually put a Camera sub-entity inside of it, and to expose it as a property. Apart from the camera, the light exposes as properties a position, its colour/intensity, and a 4x4 transformation matrix; we'll see where that matrix gets used, while the rest is straightforward.
Frame graph
In Qt3D 2.0 the frame graph is the data-driven configuration for the rendering. In this example, ShadowMapFrameGraph.qml contains its implementation, which looks like this:
The code defines a FrameGraph entity, which has a tree of entities as the active frame graph. Any path from the leaves of this tree to the root is aviable frame graph configuration; filter entities can enable or disable such paths, and selector entities can alter the configuration.
In our case, the tree looks like this:
Viewport
RenderPassFilter
RenderTargetSelector
ClearBuffer
CameraSelector
RenderPassFilter
ClearBuffer
CameraSelector
So we have two paths from the topmost Viewport entity. Each path corresponds to a pass of the shadow map technique; the paths are enabled and disabled using a RenderPassFilter, an entity that can filter depending on arbitrary values defined in a given render pass (in our case: a string). The actual passes are not defined here, but in the effect (see below); the frame graph simply modifies its configuration when a given pass is rendered.
Now, in the shadow map generation pass, we must render to an offscreen surface (the FBO) which has a depth texture attachment: this in Qt3D is represented by the RenderTarget entity, which has a number of attachments. In this case, only one attachment is needed: a depth attachment, defined by the RenderAttachment entity using a type of RenderAttachment.DepthAttachment (stating it should store the depth), and a Texture2D entity which actually configures the texture storage used to store the depth information.
Moreover, in this first pass, we must render using the light's camera; therefore, we have a CameraSelector entity that sets the camera to the one exported by the Light.
The second pass is instead way more straightforward, in which we simply render to the screen using the main camera.
The effect
The bulk of the magic happens in the AdsEffect.qml file, where our main Effect entity is defined. As you can imagine from the name, it's an effect implementing the ADS shading model, i.e. Phong, with the addition of shadow mapped generated shadows.
An effect contains the implementation of a particular rendering strategy; in this case, shadow mapping using two passes.
The parameters list defines some default values for the effect. Those values will get mapped to OpenGL shader program uniforms, so that in the shaders we can access them. In this case, we expose some information from the Light entity (its position, its intensity, its view/projection matrix defined by its internal camera), as well as the shadow map texture exposed by the frame graph.
In general, it's possible to put such parameters all the way down, from a Material, to its Effect, to one of the effect's Techniques. This allows a Material instance to override defaults in an Effect or Technique. (The bindings array provides the same thing, except that it also allows us to rename some parameters. In our case, it renames the ambient/diffuse/specular values defined in the material to the actual uniform names used by the shader programs.)
We then have a Technique element. In order to be able to adapt the implementation to different hardware or OpenGL versions, an Effect is implemented by providing one or more Technique elements. In our case, only one technique is provided, targeting OpenGL 3.2 Core (or greater).
Inside that technique, we finally have the definition of our two rendering passes. We "tag" each pass with an Annotation entity, matching the ones we've set into the frame graph configuration, so that each pass will have different rendering settings.
The first pass is the shadow map generation. To do so, we load a suitable set of GLSL shaders, which are actually extremely simple -- they do nothing except from MVP projection, to bring meshes from their model space into clip space (and, remember, in this first pass, the light is the camera). The fragment shader is totally empty: there's no color to be generated, and the depth will be automatically captured for us by OpenGL. Note that in this first pass, we also set some custom OpenGL state in the form of a polygon offset and depth testing mode.
The second pass is instead a normal forward rendering using Phong shading. The code in the effect entity is extremely simple: we simply configure some parameters (see above) and load a pair of shaders which will be used when drawing.
The shaders
I will not explain the shader code in too much detail, because that would require a crash course in GLSL. However, I will explain the shadow mapping parts. The first part happens in the vertex shader (ads.vert), where we output towards the fragment shader the coordinates of each vertex in light space:
(Actually, the coordinates get adjusted a little to allow us to easily sample the shadow map texture; that's the purpose of the shadowMatrix, please refer to a book or to the Wikipedia entry on shadow mapping to understand why that's necessary).
The second part happens in the fragment shader (ads.frag), where we sample the shadow map, and if the currently processed fragment is behind the one closest to the light, then the current fragment is in shadow (and only gets ambient contribution), otherwise it gets full Phong shading:
float shadowMapSample =textureProj(shadowMapTexture, positionInLightSpace); vec3 ambient = lightIntensity * ka; vec3 result = ambient;if(shadowMapSample >0) result +=dsModel(position,normalize(normal)); fragColor =vec4(result,1.0);
And that's it!
Conclusions
In this post I've shown how it's possible to configure Qt3D in order to achieve a custom rendering effect. Although shadow mapping is one of the simplest rendering techniques, the point is demonstrating how Qt3D imposes no particular rendering algorithm or strategy. You can easily experiment with a variety of multipass effects, e.g. introduce stencil shadows, or maybe that effect you've just seen on that SIGGRAPH paper...
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.
yes, you need a checkout from the "dev" branch of Qt (which currently corresponds to 5.5).
You don't need to clone everything, only qtbase and qtdeclarative are really needed, plus optionally qimageformats (to be able to load DDS textures). If you're using the "qt5" repository (i.e. init-repository / git submodules), be sure to checkout "dev" in each submodule instead of in the top level repository! Full instructions are available here.
21 - Jan - 2015
Philip
Cool! I got it working. Is there any documentation that I could generate or look at?
21 - Jan - 2015
Giuseppe D'Angelo
Unfortunately not yet... but you're more than welcome to join the #qt-3d hannel on Freenode and ask around, there's usually always someone around (esp. in CET working hours).
22 - Jan - 2015
Philip
What are the default uniforms that are set in the shader programs? I see you can add uniforms through Effect's parameters property. For example modelMatrix, modelView, modelViewNormal, mvp are all defined in ads.vert but aren't referenced in the qml. I'm assuming these are default uniforms set by qt3d? I'm assuming there's others default uniforms like viewMatrix or projectionMatrix?
23 - Jan - 2015
Giuseppe D'Angelo
You're absolutely correct :) There's a set of builtin uniforms that are set by the engine.
Take a look into RenderView::initializeStandardUniformSetters where you can find the list, it's basically the various combinations of model/view/projection/viewport matrices, their inverses and the elapsed time in the application.
23 - Jan - 2015
Philip
Cool thanks.
24 - Jan - 2015
Sean Harmer
Please let us know if there's other standard uniforms that you would like to see added to the list. Best bet is to file a JIRA task.
26 - Jan - 2015
Philip
I need to try to implement a simple depth pealing algorithm to try test out the Framegraph / Effect / Entry system. I just haven't had time yet.
26 - Jan - 2015
Jim
I would be interested to see the C++ version of this. I plan on using Qt3d for image generation due to Qt's renown documentation. I do all of my programming in C++.
26 - Jan - 2015
Giuseppe D'Angelo
Hi Jim,
a C++ version of this should not be much different, it would essentially be a 1:1 translation of the scene into C++, therefore becoming a bit more verbose.
For comparison, take a look at the various examples that are shipped both in QML and C++ form (e.g. simple-qml / simple-cpp).
26 - Jan - 2015
jiangcaiyang
Hello, I got Qt 5.5 dev branch and compiled Qt statically. All goes well except all the example not linked. It shows:
.obj/release/main.o:main.cpp:(.text+0x8a): undefined reference to `_imp___ZN4Qt3D6WindowC1EP7QScreen'
.obj/release/main.o:main.cpp:(.text+0x9e): undefined reference to `_imp___ZN4Qt3D5Quick16QQmlAspectEngineC1EP7QObject'
.obj/release/main.o:main.cpp:(.text+0xbe): undefined reference to `_imp___ZN4Qt3D13QRenderAspectC1EP7QObject'
.obj/release/main.o:main.cpp:(.text+0xc3): undefined reference to `_imp___ZNK4Qt3D5Quick16QQmlAspectEngine12aspectEngineEv'
.obj/release/main.o:main.cpp:(.text+0xdd): undefined reference to `_imp___ZN4Qt3D13QAspectEngine14registerAspectEPNS_15QAbstractAspectE'
.obj/release/main.o:main.cpp:(.text+0xff): undefined reference to `_imp___ZN4Qt3D12QInputAspectC1EP7QObject'
.obj/release/main.o:main.cpp:(.text+0x3d8): undefined reference to `_imp___ZN4Qt3D13QAspectEngine7setDataERK4QMapI7QString8QVariantE'
Makefile.Release:84: recipe for target 'release\playground-qml.exe' failed
.obj/release/main.o:main.cpp:(.text+0x3e9): undefined reference to `_imp___ZN4Qt3D13QAspectEngine10initializeEv'
.obj/release/main.o:main.cpp:(.text+0x427): undefined reference to `_imp___ZN4Qt3D5Quick16QQmlAspectEngine9setSourceERK4QUrl'
.obj/release/main.o:main.cpp:(.text+0x4a7): undefined reference to `_imp___ZTVN4Qt3D5Quick16QQmlAspectEngineE'
.obj/release/main.o:main.cpp:(.text+0x4c1): undefined reference to `_imp___ZN4Qt3D6WindowD1Ev'
.obj/release/main.o:main.cpp:(.text+0x5b5): undefined reference to `_imp___ZN4Qt3D6Window16staticMetaObjectE'
E:/Develop/Qt5.4/Tools/mingw491_32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: .obj/release/main.o: bad reloc address 0x14 in section `.text$_Z17qRegisterMetaTypeIP8QSurfaceEiPKcPT_N9QtPrivate21MetaTypeDefinedHelperIS4_Xaasr12QMetaTypeId2IS4_E7DefinedntsrS9_9IsBuiltInEE11DefinedTypeE[__Z17qRegisterMetaTypeIP8QSurfaceEiPKcPT_N9QtPrivate21MetaTypeDefinedHelperIS4_Xaasr12QMetaTypeId2IS4_E7DefinedntsrS9_9IsBuiltInEE11DefinedTypeE]'
Looking deep in the code, maybe it is probably due to the namespace of "Qt3D" mobule. I am not sure.
I am using Windows with mingw4.91
26 - Jan - 2015
jiangcaiyang
I notice that all examples requires "play-ground-qml" project, which is the not linked.
26 - Jan - 2015
Sean Harmer
They all require the simple exampleresources project. We'll need to look into this. Last time I tried a static build it was on Linux and the examples linked and executed there. For now, I'd suggest using a dynamic build until we can get this resolved. Patches welcome ;)
26 - Jan - 2015
jiangcaiyang
Is it because of the the export keyword?
I noticed that Qt3D Core defines only shared export, not static export:
If it's a static build there's no need to export anything. That export keyword is actually just a macro for Q_DECL_EXPORT/Q_DECL_IMPORT which in turn are macros for the platform specific export/visibility compiler intrinsics. In a static build everything is in the same executable.
26 - Jan - 2015
jiangcaiyang
In addition, the original exampleresources.pri got not compiled. it is suggested to add "lib" prefix at line 6 and 8 before "exampleresources". the final looks like this:
Ah looks like a MSVC vs mingw issue in the .pro and .pri files then.
27 - Jan - 2015
jiangcaiyang
Problem solved.
Maybe all the #ifdef directives have to be changed.
Taken from another module of Qt, Enginio have long been unsuccessfully linked. I've fired quite a lot post to the developers. Now it is Okay with static build. Looking deep in code, it is written like this:
I've changed all the directives in Qt 3D to look similar to this, and get compiled and linked. I suggest change all the directives to adapt to static build in MinGW. or make a bunch of new directives such as "QT3D_STATIC_EXPORT".
27 - Jan - 2015
Sean Harmer
Thanks, peppe has pushed a patch with this fix in. Should land once gerrit is fixed.
5 - Sept - 2015
Marco
Hi,
I have problems running Qt3D shadow map example. After starting the application I can only see a black screen in the app window. This happens with all multi-pass rendering examples(multiview,...). I have tried to run the same example(s) on another PC with other hardware and windows version. Beside Qt3D I have tried many other multi-pass rendering methods. These all run fine. I hope you can give me fast a useful hint.
Thanks in advance
Marco
7 - Sept - 2015
Giuseppe D'Angelo
Hi Marco,
I think the example was accidentally broken, but it should now work in the 5.6 branch.
24 - Nov - 2015
Dominik
hey there,
something im wondering about is:
I load a mesh from a .obj file
next i want to set a center/origin for this object.
is this possible?
for example
Transform{
id: ....
Rotate{id: ...; origin/center: Qt.vector3d(x, y, z}
}
cheers
30 - Nov - 2015
Giuseppe D'Angelo
Hi Dominik,
There are now actually helpers for "rotate around a point" kind of scenarios. Fetch the code from the 5.6 branch and take a look for the QTransform::rotateAround helper (also exposed in QML).
18 - Apr - 2018
Carlos Ranoya
Hi Giuseppe.
Congratulations for this article. Very enlightening.
I've been studying this Qt example and found your post.
I have one doubt: is it possible to use the Framebuffer Object - the rendered shadow map texture, in this case - as texture source of any QML component instanciated at the root window, above Scene3D?
If so, how to do that?
Thanks for any kind of help.
Giuseppe D’Angelo
Senior Software Engineer
Senior Software Engineer at KDAB. Giuseppe is a long-time contributor to Qt, having used Qt and C++ since 2000, and is an Approver in the Qt Project. His contributions in Qt range from containers and regular expressions to GUI, Widgets, and OpenGL. A free software passionate and UNIX specialist, before joining KDAB, he organized conferences on opensource around Italy. He holds a BSc in Computer Science.
25 Comments
21 - Jan - 2015
Philip
Do you need Qt 5.5 to build Qt3D?
21 - Jan - 2015
Giuseppe D'Angelo
Hi,
yes, you need a checkout from the "dev" branch of Qt (which currently corresponds to 5.5).
You don't need to clone everything, only qtbase and qtdeclarative are really needed, plus optionally qimageformats (to be able to load DDS textures). If you're using the "qt5" repository (i.e. init-repository / git submodules), be sure to checkout "dev" in each submodule instead of in the top level repository! Full instructions are available here.
21 - Jan - 2015
Philip
Cool! I got it working. Is there any documentation that I could generate or look at?
21 - Jan - 2015
Giuseppe D'Angelo
Unfortunately not yet... but you're more than welcome to join the #qt-3d hannel on Freenode and ask around, there's usually always someone around (esp. in CET working hours).
22 - Jan - 2015
Philip
What are the default uniforms that are set in the shader programs? I see you can add uniforms through Effect's parameters property. For example modelMatrix, modelView, modelViewNormal, mvp are all defined in ads.vert but aren't referenced in the qml. I'm assuming these are default uniforms set by qt3d? I'm assuming there's others default uniforms like viewMatrix or projectionMatrix?
23 - Jan - 2015
Giuseppe D'Angelo
You're absolutely correct :) There's a set of builtin uniforms that are set by the engine.
Take a look into RenderView::initializeStandardUniformSetters where you can find the list, it's basically the various combinations of model/view/projection/viewport matrices, their inverses and the elapsed time in the application.
23 - Jan - 2015
Philip
Cool thanks.
24 - Jan - 2015
Sean Harmer
Please let us know if there's other standard uniforms that you would like to see added to the list. Best bet is to file a JIRA task.
26 - Jan - 2015
Philip
I need to try to implement a simple depth pealing algorithm to try test out the Framegraph / Effect / Entry system. I just haven't had time yet.
26 - Jan - 2015
Jim
I would be interested to see the C++ version of this. I plan on using Qt3d for image generation due to Qt's renown documentation. I do all of my programming in C++.
26 - Jan - 2015
Giuseppe D'Angelo
Hi Jim,
a C++ version of this should not be much different, it would essentially be a 1:1 translation of the scene into C++, therefore becoming a bit more verbose.
For comparison, take a look at the various examples that are shipped both in QML and C++ form (e.g. simple-qml / simple-cpp).
26 - Jan - 2015
jiangcaiyang
Hello, I got Qt 5.5 dev branch and compiled Qt statically. All goes well except all the example not linked. It shows:
Looking deep in the code, maybe it is probably due to the namespace of "Qt3D" mobule. I am not sure.
I am using Windows with mingw4.91
26 - Jan - 2015
jiangcaiyang
I notice that all examples requires "play-ground-qml" project, which is the not linked.
26 - Jan - 2015
Sean Harmer
They all require the simple exampleresources project. We'll need to look into this. Last time I tried a static build it was on Linux and the examples linked and executed there. For now, I'd suggest using a dynamic build until we can get this resolved. Patches welcome ;)
26 - Jan - 2015
jiangcaiyang
Is it because of the the export keyword? I noticed that Qt3D Core defines only shared export, not static export:
26 - Jan - 2015
Sean Harmer
If it's a static build there's no need to export anything. That export keyword is actually just a macro for Q_DECL_EXPORT/Q_DECL_IMPORT which in turn are macros for the platform specific export/visibility compiler intrinsics. In a static build everything is in the same executable.
26 - Jan - 2015
jiangcaiyang
In addition, the original exampleresources.pri got not compiled. it is suggested to add "lib" prefix at line 6 and 8 before "exampleresources". the final looks like this:
26 - Jan - 2015
Sean Harmer
Ah looks like a MSVC vs mingw issue in the .pro and .pri files then.
27 - Jan - 2015
jiangcaiyang
Problem solved.
Maybe all the #ifdef directives have to be changed. Taken from another module of Qt, Enginio have long been unsuccessfully linked. I've fired quite a lot post to the developers. Now it is Okay with static build. Looking deep in code, it is written like this:
I've changed all the directives in Qt 3D to look similar to this, and get compiled and linked. I suggest change all the directives to adapt to static build in MinGW. or make a bunch of new directives such as "QT3D_STATIC_EXPORT".
27 - Jan - 2015
Sean Harmer
Thanks, peppe has pushed a patch with this fix in. Should land once gerrit is fixed.
5 - Sept - 2015
Marco
Hi, I have problems running Qt3D shadow map example. After starting the application I can only see a black screen in the app window. This happens with all multi-pass rendering examples(multiview,...). I have tried to run the same example(s) on another PC with other hardware and windows version. Beside Qt3D I have tried many other multi-pass rendering methods. These all run fine. I hope you can give me fast a useful hint. Thanks in advance Marco
7 - Sept - 2015
Giuseppe D'Angelo
Hi Marco, I think the example was accidentally broken, but it should now work in the 5.6 branch.
24 - Nov - 2015
Dominik
hey there,
something im wondering about is: I load a mesh from a .obj file next i want to set a center/origin for this object.
is this possible? for example Transform{ id: .... Rotate{id: ...; origin/center: Qt.vector3d(x, y, z} }
cheers
30 - Nov - 2015
Giuseppe D'Angelo
Hi Dominik,
There are now actually helpers for "rotate around a point" kind of scenarios. Fetch the code from the 5.6 branch and take a look for the QTransform::rotateAround helper (also exposed in QML).
18 - Apr - 2018
Carlos Ranoya
Hi Giuseppe. Congratulations for this article. Very enlightening.
I've been studying this Qt example and found your post. I have one doubt: is it possible to use the Framebuffer Object - the rendered shadow map texture, in this case - as texture source of any QML component instanciated at the root window, above Scene3D?
If so, how to do that? Thanks for any kind of help.