C

System and Application Requirements

OpenGL Requirements

Qt 3D Studio requires OpenGL or OpenGL ES. The recommended minimum versions are 3.3 core profile and 3.0, respectively.

When it comes to OpenGL ES, a limited subset of the functionality is available when running on plain OpenGL ES 2.0 implementations. In practice this means losing shadow mapping, image based lighting, and many other advanced features and is therefore not recommended. On the other hand, this allows bringing up Qt 3D Studio scenes on boards like the Raspberry Pi (with the original proprietary graphics stack) or the Beaglebone Black, or in hypervisor-based virtualized environments where the GPU virtualization only supports GLES 2.0, and can therefore still be valuable in certain special situations.

Non-native implementations, like ANGLE or software implementations like Mesa's llvmpipe may work but are not tested and can fail in unexpected ways.

Application Integration Notes

C++

A typical Qt C++ application using the Qt 3D Studio OpenGL Runtime is expected to query and honor the runtime's ideal surface format. This way the OpenGL contexts will all be created with the OpenGL version and profile that best match the runtime's needs:

#include <Q3DSSurfaceViewer> // or <q3dsruntimeglobal.h> if only Q3DS::surfaceFormat() is interesting for main()

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());

    Q3DSSurfaceViewer w;
    ...
    return app.exec();
}

To enable using Qt 3D Studio headers and libraries in the application, add the studio3d module in the application's .pro file:

QT += studio3d

QML/Qt Quick

When no C++ classes are used, the studio3d module can be omitted in the .pro. To use the Studio3D element in QML code, it is enough to add the corresponding import statement:

import QtStudio3D.OpenGL \QtVer

It is nonetheless strongly recommended to set the the default surface format as shown above. Make sure the QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()) call is made after constructing QGuiApplication but before the first QQuickWindow or QQuickView. When this is not possible, for example because the QML contents is hosted in an application that has no knowledge of the Qt Quick scene's 3D needs, Studio3D may still be usable but this may be dependent on the OpenGL implementation and the context versions it offers, and is therefore more fragile.

Available under certain Qt licenses.
Find out more.