Important: Please read the Qt Code of Conduct -

WebGL and Remote Desktop

  • Hi,

    I'm building an application using Qt for all business logic and heavy processing work, and JavaScript shown within a single WebEngine widget as the user interface. C++ and JavaScript communicates via a web channel and everything works just beautifully... except this one thing :)

    I make extensive use of WebGL to implement some shaders I need for an image viewer, and this also works just fine within the WebEngine widget on my Windows laptop, but when I run the application on a remote Windows machine that I connect to via RDP / Remote Desktop the WebGL context doesn't work. I know that applications running through a Remote Desktop connection cannot directly access hardware accelerated OpenGL, but in other applications, like e.g. the browsers I have on the remote machine, they make use of Microsoft's OpenGL 1.1 software renderer fallback in these situations, making it possible to run OpenGL in software instead. This is disabled in Qt's webengine, so it doesn't work.

    I've created this small test application that loads into a QWebEngineView where you can see that WebGL is disabled:

    Does anyone know:

    1. If there is a workaround for this to get WebGL rendering working over a Remote Desktop connection in my Qt application, and
    2. If there are any plans to enable the fallback to the OpenGL 1.1 software renderer in the WebEngine views?

    Best regards,

  • Lifetime Qt Champion

    Hi Mads og velkommen til forummet ( hi and welcome to the forum)

    To use openGL over Remote Desktop , you must connect to the (root) console
    Often this is done with a batch file containing
    tscon 1 /dest:console
    start "C:\Program Files\ what ever open gl app you want"

  • @mrjj thank you for your reply.

    I've seen the page you link to before. As I understand it, this solution will close the remote desktop connection and launch the application. I then need to re-connect using the remote desktion client. This solution makes sure that the application is launched with hardware access on a local session, and while it's ok for me while developing the application, it sadly is not an acceptable workaround for my users - who will also work on the app through remote desktop.

    Best regards,

  • Lifetime Qt Champion


    Its how it works in windows.
    The reason is the that TS adapter cannot not be switched when session is started
    so one must reconnect to allow accelerated gfx. It is not related to Qt at all.
    There are very tools to overcome this and as alternative can be used.

  • @mrjj
    Hello again,

    I do understand that Remote Desktop has problems with hardware accelerated OpenGL, but using the fallback software OpenGL 1.1 renderer should be possible I guess? That works in e.g. browsers.

    Best regards,

  • Lifetime Qt Champion

    Well it default fallbacks to OpenGL 1.1 Software (last time i checked)
    but most 3D programs dont run (well) on that ancient version
    so wont matter much.

    I cant say if QWebEngine can use software rendering if it was enabled or
    its simply not good enough :)

Log in to reply