Cross-platform: Qt 6 brings a new abstraction layer for 3D graphics

0
16


After a long preparation phase, version 6 of the Qt framework was released as planned at the end of the year. As the first major release in eight years, the cross-platform library brings some fundamental changes in the architecture, including a new layer for 3D graphics, the connection to C ++ 17 and an extended Qt-Quick-3D module.

As with fresh main versions, the fundamental changes are usually associated with incompatibilities or breaking changes. According to its own statements, however, the Qt Company tried to keep the code changes required on the developer side as small as possible during the conversion. Almost all APIs removed in Qt 6 are probably marked as deprecated in the last LTS (Long-Term Support) release Qt 5.15.

A central change has been included in the framework since Qt 5.14, but was still marked as a technical preview under Qt 5.15, which required an explicit activation via an environment variable: The framework removes the fixed connection to OpenGL as an interface for 3D graphics and brings a new layer called Rendering Hardware Interface (RHI).

The entire 3D graphics in Qt Quick are based on the abstraction level, and by default the framework uses Direct3D under Windows and Metal under macOS. It can also use Vulkan and, as before, OpenGL or OpenGL ES.

The Qt Rendering Hardware Interface abstracts the connection between Qt Quick and the 3D API of the operating system.

(Image: Qt)

Version 5.14 initially introduced Qt Quick 3D as a technical preview. Developers can use the module to define 3D scenes in the QML script language and thus develop uniform 3D and 2D representations. Among other things, you can use Qt-Quick content as textures for 3D objects. The Qt-Quick-3D-Module brings numerous adjustments in Qt 6, which among other things aim at the RHI connection. In addition, there are extensions for the interaction of 2D and 3D objects and improved integration for rendering gITF2 content (GL Transmission Format).

If you don’t want to switch, you will find the classes tailored to OpenGL outsourced in the QtOpenGL-Module. The also new module QtShaderTools offers access to the different shader languages ​​for the 3D APIs and uses the intermediate language SPIR-V (Standard Portable Intermediate Representation) for this.

When connecting to C ++, Qt 6 relies on C ++ 17, which does not correspond to the latest C ++ 20 language standard, but Qt was C ++ 11 from version 5.7 to version 5.15. With the connection to C ++ 17, Qt 6 enables, among other things, access to the property bindings in Qt from C ++.

Also, the team has the often criticized QList-Changed the class that takes a detour in memory allocation, and new items within the list as void*-Pointer stores that reference the actual items. Qt 6 now unifies the implementation with that of the other container class QVector, and the implementation of the latter class serves as a common architecture.

In addition, the Qt team published a blog post in October after reviewing the essential classes for Qt’s meta-object system QMetaType and QVariant almost completely rewritten with a connection to C ++ 17.

It is also worth mentioning that Qt 6 now contains platform-specific APIs directly in the core. So far they were in the separate modules QtX11Extras, QtWinExtras respectively QtMacExtras outsourced. With the new architecture, event processing, the integration of windows and type conversions should be better integrated into the special features of the target system. In addition, a mechanism for native interfaces replaces the previous platform headers.

Qt 6 has recently been using CMake for the build system. The Qt Company built the library with it and recommends using it for Qt projects. However, she wants to continue to offer support for the in-house qmake over the entire life cycle of Qt 6.

The blog post on the release describes Qt 6.0 as the starting point for the next generation of Qt and admits that it is not yet as feature complete as Qt 5.15. The team wants to fill the gaps in the coming months. At the end of the blog post, the team would like to thank everyone who was involved in the development. Thousands would have helped through bug reports and feedback, and the Qt 6 What’s New page lists the names of the 274 people who were actively involved in its development.

This year not only was Qt’s 25th anniversary, but some changes in license and product policy have led to uncertainty. In January, the Qt Company announced that LTS releases would be reserved for commercial customers. Specifically, this means that only you can enjoy the longer support of the last 5.x release Qt 5.15.

In April, an email from the KDE community caused unrest, according to which the Qt Company is considering releasing open source releases up to a year later than the commercial version. The framework and the associated modules are generally available under the LGPL or GPL license.

With Qt 6, there are also potentially unpleasant innovations in the room for commercial customers: Qt only sells the current release as a subscription model, which puts some customers in a bind, as the perpetual model is no longer available, which is initially more expensive, but guarantees long-term future security and not from potential price and license changes.


(rme)

To home page



Source link
https://www.heise.de/news/Cross-Plattform-Qt-6-bringt-eine-neue-Abstraktionsschicht-fuer-3D-Grafik-mit-4984197.html

LEAVE A REPLY

Please enter your comment!
Please enter your name here