Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt [c++] - No Qt3D rendering on older laptop

Qt [c++] - No Qt3D rendering on older laptop

Scheduled Pinned Locked Moved Unsolved Game Development
16 Posts 4 Posters 665 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kevin_d
    wrote last edited by
    #1

    Hello Folks!

    I developed a game which uses the Qt3D Engine to display a custom 3D scene.
    I was now copying the programm on an older Machine (Win11, i5, 4GB Ram) and the program starts properly.
    Unfortunately, the 3D Scene is not rendering (the QT3D widget remains empty).
    I also installed some OpenGL drivers from Microsoft [https://apps.microsoft.com/detail/9nqpsl29bfff?hl=de-DE&gl=DE]

    What am I missing to set up for Qt3D to render a scene?

    best regards, kevin_d

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kevin_d
      wrote last edited by
      #2

      btw, the System has Intel HD Graphics
      Drivers: igdumd64.dll and igd10umd64.dll

      1 Reply Last reply
      0
      • 8Observer88 Offline
        8Observer88 Offline
        8Observer8
        wrote last edited by 8Observer8
        #3

        Try this:

        extern "C"
        {
            __declspec(dllexport) unsigned long NvOptimusEnablement = 1;
            __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
        }
        
        1 Reply Last reply
        0
        • K Offline
          K Offline
          kevin_d
          wrote last edited by kevin_d
          #4

          Hi!
          Thanks for the tip. Unfortunately, that did not do the trick.
          According to https://forum.qt.io/topic/50936/qt-5-4-sending-qdebug-to-a-file-40-aka-logging-41-solved/5, I am tracing the warnings, which say:

          {Warning:} D3D11 smoke test: Failed to create vertex shader
          {Warning:} Initializing RHI with DirectX backend
          {Warning:} RHI: Unable to use requested RHI Api, trying to fall back on OpenGL
          {Warning:} Initializing RHI with OpenGL backend
          {Warning:} QOpenGLContext::makeCurrent() called with non-opengl surface 0x190509c29d0
          {Warning:} QRhiGles2: Failed to make context current. Expect bad things to happen.

          My DirectX Version is locally at 12

          best regards, kevin_d

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kevin_d
            wrote last edited by
            #5

            hi!
            On a working machine, i get a "WARNING - Initializing RHI with DirectX backend" ...
            I also installed additional DirectX-components according to https://www.microsoft.com/en-gb/download/details.aspx?id=35, but it fails nevertheless.
            ~kevin_d

            1 Reply Last reply
            0
            • KH-219DesignK Offline
              KH-219DesignK Offline
              KH-219Design
              wrote last edited by
              #6

              I was intrigued enough by the posted RHI warning text lines that I thought I would poke around in Qt source code for clues.

              Disclaimer: I do not currently work on any program on Windows (nor DirectX specifically), so I have not attempted to reproduce this nor to run anything on Windows at all at the moment.

              Based on reading source code, (and depending which Qt version—here I have assumed 6.10), it seems like in order for this to happen:

              {Warning:} Initializing RHI with DirectX backend
              {Warning:} RHI: Unable to use requested RHI Api, trying to fall back on OpenGL
              

              The Qt method bool QRhiD3D11::create(QRhi::Flags flags) has to return false.

              You can see the body of the method here: https://github.com/qt/qtbase/blob/v6.10.2/src/gui/rhi/qrhid3d11.cpp#L197-L419

              This suggests at least two potential paths toward a deeper diagnosis:

              1. Make sure Visual Studio has access to Qt framework debug symbols and source code, and step through QRhiD3D11::create in a debugger.
              2. Try to write a (non Qt) small DirectX "hello world" that uses functions like createDXGIFactory2 and dxgiFactory->EnumAdapters1 (which are the functions that Qt is trying to use under the hood).

              In option (2), the idea is that if you directly write some DirectX code (in a separate main that does not use Qt at all), then you can perhaps more quickly discover what part of DirectX is failing to cooperate.

              I offer this in the spirit of brainstorming. Again, I am not actively developing any Windows/DirectX codebase at the moment, so my advice is certainly not "expert" in that regard. However, I have done such work in years past, and I have used the approaches (1) and (2) successfully in the past to debug similar scenarios where it was not clear to me whether Qt was misbehaving or whether something nested "underneath" Qt was misbehaving.

              www.219design.com
              Software | Electrical | Mechanical | Product Design

              1 Reply Last reply
              1
              • K Offline
                K Offline
                kevin_d
                wrote last edited by kevin_d
                #7

                Hello!

                Thanks for your reply.
                Appearantly, the Graphic Chip does not support DirectX11 ...
                Is there a way of a fallback to either OpenGL or DirectX10 ?

                best regards, kevin_d

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote last edited by
                  #8

                  Hi,

                  I think you can use the QSG_RHI_BACKEND environment variable for that.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kevin_d
                    wrote last edited by kevin_d
                    #9

                    Hi!
                    So... no chance for Direct3D10 ?

                    best regards, kevin_d

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote last edited by
                      #10

                      Based on a quick look at older versions of the documentation, I would say no.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kevin_d
                        wrote last edited by
                        #11

                        Hmm, i would fancy to have a fallback on OpenGL, when having no D3D11 ...
                        But it says: QOpenGLContext::makeCurrent() called with non-opengl surface ...
                        What does it mean? Can it be fixed?

                        best regards, kevin_d

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote last edited by
                          #12

                          Does it happen if you set QSG_RHI_BACKEND before starting your application ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            kevin_d
                            wrote last edited by
                            #13

                            I am not using QQuickWindow, but instead Qt3DExtras::Qt3DWindow

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote last edited by
                              #14

                              In that case you might be able to leverage Q3D_RENDERER. See the module documentation for more information.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                kevin_d
                                wrote last edited by kevin_d
                                #15

                                I did that. My output is:

                                WARNING Initializing RHI with OpenGL backend
                                WARNING No GLSL shader code found (versions tried: QList(130, 120) ) in baked shader QShader(stage=0 shaders=QList(ShaderKey(1 Version(300 QFlags()) 0)) desc.isValid=true)
                                WARNING Failed to build graphics pipeline: Creation Failed

                                No problem with this setting on the newer machine so far ...
                                Speed of the scene is comparable to DirextX11+

                                What am I missing?

                                1 Reply Last reply
                                0
                                • 8Observer88 Offline
                                  8Observer88 Offline
                                  8Observer8
                                  wrote last edited by
                                  #16

                                  It looks like you are running into a classic RHI (Rendering Hardware Interface) mismatch. Even though the performance feels snappy, those warnings are red flags that your current environment is missing the specific shader translations needed for the OpenGL backend.

                                  Here’s the breakdown of what is actually happening under the hood:

                                  1. The Shader Version Gap

                                  The error versions tried: QList(130, 120) tells us that your application is looking for older, "baked" GLSL shader code (OpenGL 3.0/2.1 era). However, the only shader found in your binary is Version(300), which corresponds to OpenGL ES 3.0.

                                  • What you're missing: Your application was likely compiled/packaged with shaders targeting modern mobile or DirectX/Vulkan backends, but the runtime is falling back to a legacy OpenGL path that doesn't have the corresponding "blobs" to talk to the GPU.

                                  2. Why it "Works" on the Newer Machine

                                  The newer machine likely has a more robust driver set or a different default RHI priority.

                                  • DirectX 11 vs. OpenGL: On Windows, Qt and similar frameworks perform significantly better on DirectX because they can use the ANGLE layer, which translates OpenGL calls to DirectX.
                                  • The "Speed" Illusion: If the scene is still fast, your system might be successfully falling back to a software rasterizer or a partial hardware acceleration path, but you'll eventually hit a "Black Screen" or a crash when the app tries to call a specific graphics pipeline that failed to build.

                                  Comparison of Backends

                                  Feature OpenGL (Legacy) DirectX 11 Vulkan / Metal
                                  Stability Lower on Windows High (Windows native) High (Modern)
                                  Shader Format GLSL HLSL SPIR-V
                                  Compatibility Hit-or-miss drivers Best for Windows Best for Cross-platform

                                  How to Fix This

                                  You likely need to force the application to use a backend that matches its baked shaders. Try one of the following:

                                  • Force the RHI: Set an environment variable before launching the app to see if it clears the warning:

                                  • QT_RHI_BACKEND=d3d11 (For Windows)

                                  • QT_RHI_BACKEND=vulkan (If supported)

                                  • Update Drivers: Even if the machine is "older," ensure the GPU drivers support OpenGL 3.3+.

                                  • Check Shader Baking: If you are the developer, ensure your qsb (Qt Shader Baker) settings include the desktop GLSL versions (--glsl "130,120,100") and not just the ES versions.

                                  Note: The "Failed to build graphics pipeline" error is the most critical. It means certain effects, materials, or lighting calculations simply won't render, even if the rest of the UI seems to be moving.

                                  Would you like me to show you how to check which OpenGL versions your current GPU drivers actually support?

                                  P.S. Sorry, but my answer above was generated with Gemini. I think it can be usefull.

                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved