summaryrefslogtreecommitdiffstats
path: root/src/api/studio3d/doc/src/requirements.qdoc
blob: f93483c2d2ec99099bfc48b2f7a9590258ff2908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt 3D Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page qt3dstudio-opengl-runtime-requirements.html
    \title System and Application Requirements

    \section1 OpenGL Requirements

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

    When it comes to OpenGL ES, a limited subset of the functionality is
    available when running on plain \c{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 \c ANGLE or software implementations like
    \c{Mesa's llvmpipe} may work but are not tested and can fail in unexpected
    ways.

    \section1 Application Integration Notes

    \section2 C++

    A typical Qt C++ application using the \RUNTIME is expected to
    query and honor the runtime's \c{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:

    \code
    #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();
    }
    \endcode

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

    \badcode
    QT += studio3d
    \endcode

    \section2 QML/Qt Quick

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

   \qml
       import QtStudio3D.OpenGL \QtVer
   \endqml

   It is nonetheless strongly recommended to set the the default surface format
   as shown above. Make sure the
   \c{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.
*/