Mon, 11/30/2020 - 08:56
Hi Friends,
I have a working project using OCCT-7.5.0 and Qt-5.15.2, I am using QQuickFramebufferObject to visualize OCCT inside Qml. There are many changes in graphic stack in Qt6, but in theory, it is still possible to use OpenGL, I have updated the dependencies and i have set GraphicsApi to OpenQL, but the framebufferobject is plain white. It receives events and render is called on Renderer instance, but the screen is just white. All other Qml Items work as expected except the OCCT FBO.
Do anyone have attempted this with some success?
With deprecation of OpenGL everywhere, i am afraid my OCCT app will be in trouble in near future. I have not tried VTK, but it seems that VTK is an option. Does anyone know about some minimal working example of VTK+Qt+OCCT?
Thanks,
Frank.
Mon, 11/30/2020 - 10:25
Where OpenGL has been deprecated (apart from Apple platforms, which is completely irrelevant problem)?
As far as I understand, Qt 6 supports OpenGL, but it is no more the only rendering backend.
Moreover, even Qt 5 has two rendering backends which could be switched in compile-time and even in run-time (on Windows platform): OpenGL and OpenGL ES.
So that when using OCCT, Qt has to be built with a single rendering backend or to force rendering backend at startup (QCoreApplication::setAttribute (Qt::AA_UseDesktopOpenGL)).
How VTK could help you here? VTK relies on it's own OpenGL wrappers, hence should have the same integration issues.
Mon, 11/30/2020 - 16:56
Hi Kirill,
Thank you for your response, I already set QCoreApplication::setAttribute (Qt::AA_UseDesktopOpenGL):
But it didn't work. What i mean by OpenGL deprecation is that Qt is moving away from OpenGL in Qt6 to native frameworks (Vulkan, Metal, DirectX) and have deprecated many OpenGL classes. For Example QQuickFramebufferObject in Qt6 documentation is marked as legacy.
If you can point me to a working Qt6+OCCT+Qml example it would be infinitelly helpful.
Thank you,
Frank M.
Mon, 11/30/2020 - 17:57
I don't think Qt tries to deprecate OpenGL backend - they just tried to make architecture flexible enough to support several backends, and hence try to replace "bad" building blocks in the current design too tied in to OpenGL renderer.
This might cause some problems, however, as they do probably care more about redesigning their own GUI composer rather than on native renderers embedded into Qt applications like OCCT 3D Viewer.
But in this context OpenGL backend in Qt will unlikely suffer more than new backends based on Vulkan/Direct3d or similar - so far I don't see here any attempt to deprecate OpenGL backend.
If you will take a look onto OCCT 3D Viewer, you'll see that unlike Qt it was designed to support different graphic libraries from very old days - this is what for a Graphic3d_GraphicDriver interface.
For a long time it was implemented with OpenGL renderer (TKOpenGl toolkit) and with a proxy Direct3D renderer (TKD3DHost using OpenGL-Direct3D interop layer).
In future there will be a native Vulkan renderer (TKVulkan) - see related issue on Bugtracker.
By the way, there are also interoperability extensions for combining OpenGL+Vulkan renderers (similar to Direct3D+OpenGL interoperability extensions).
Sorry, so far I haven't seen any experiments with pre-release version of Qt6.
So far I can see only the following statement in documentation:
As usual, it only specifies that it is incompatible with Vulkan and Metal without details upon which API is compatible.
Documentation is obviously incomplete - either references to another "better" API are missing, Qt6 deprecates the whole ability to combine their QtQuick renderer with ANY native renderer or Qt developers haven't figured out this problem yet (postponed it to Qt 6.1 or Qt 6.5).
In any case - it worth asking this question on Qt forums (as general question of interoperability with OpenGL / other native renderers with QtQuick).
Mon, 11/30/2020 - 18:19
Thank you Kirill, I will try in the Qt Forums.