Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtquick3d-requirements.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qtquick3d-requirements.html
6
\title Qt Quick 3D Graphics Requirements
7
\brief OpenGL requirements and considerations
8
9
\section1 Supported graphics APIs, versions, and shading languages
10
11
Qt Quick 3D supports operating with all the graphics APIs and shading languages
12
supported by Qt Quick in Qt 6.0. In some cases, with OpenGL and OpenGL ES in
13
particular, the version requirement may be higher for Qt Quick 3D than for Qt Quick.
14
15
\list
16
\li \l{https://www.khronos.org/opengl/}{OpenGL} 3.0 or higher; OpenGL 3.3 or higher is strongly recommended
17
\li \l{https://www.khronos.org/opengles/}{OpenGL ES} 2.0 or higher; OpenGL ES 3.0 or higher is strongly recommended
18
\li \l{https://docs.microsoft.com/en-us/windows/win32/direct3d11/atoc-dx-graphics-direct3d-11}{Direct3D 11.1}
19
\li \l{https://learn.microsoft.com/en-us/windows/win32/direct3d12/what-is-directx-12-}{Direct3D 12}
20
\li \l{https://www.khronos.org/vulkan/}{Vulkan} 1.0 or higher
21
\li \l{https://developer.apple.com/metal/}{Metal} 1.2 or higher
22
\endlist
23
24
The shader pipeline is based on the standard approach of Qt 6: Vulkan-compatible
25
GLSL shader code is compiled to SPIR-V, which is then translated to GLSL, HLSL,
26
and MSL source code. Refer to the \l{Qt Shader Tools} module documentation for
27
details.
28
29
Qt Quick 3D does not directly work with any of the graphics APIs mentioned
30
above. Rather, it uses the Qt Rendering Hardware Interface abstractions,
31
similarly to Qt Quick.
32
33
\section2 Choosing the graphics API
34
35
As Qt Quick 3D does not initialize rendering or a window on its own, but rather
36
relies on \l QQuickWindow or \l QQuickView or the \l Window QML type, everything
37
related to graphics API selection that applies to the
38
\l{qtquick-visualcanvas-scenegraph.html}{Qt Quick Scene Graph} applies to Qt
39
Quick 3D as well. It is possible to control the behavior of the scene graph by
40
setting specific environment variables as listed below:
41
42
\table 100%
43
\header
44
\li Environment Variable
45
\li Possible Values
46
\li Description
47
48
\row
49
\li \c QSG_RHI_BACKEND
50
\li \c vulkan, \c metal, \c opengl, \c d3d11, \c d3d12
51
\li Requests the specific RHI backend. By default the targeted graphics API
52
is chosen based on the platform, unless overridden by this variable or the
53
equivalent C++ APIs. The defaults are currently Direct3D 11 for Windows,
54
Metal for macOS, OpenGL elsewhere.
55
56
\row
57
\li \c QSG_RHI_DEBUG_LAYER
58
\li \c 1
59
\li Where applicable (Vulkan, Direct3D), enables the graphics API implementation's debug
60
and/or validation layers, if available.
61
62
\row
63
\li \c QSG_INFO
64
\li \c 1
65
\li Like with the OpenGL-based rendering path, setting this enables printing system
66
information when initializing the Qt Quick scene graph. This can be very useful for
67
troubleshooting.
68
\endtable
69
70
Applications wishing to always run with a single given graphics API can request
71
this via the \c QSG_RHI_BACKEND enivronment variable, as well as with C++. For
72
example, the following call made early in \c main(), before constructing any
73
QQuickWindow, forces the use of Vulkan (and will fail otherwise).
74
75
\code
76
QQuickWindow::setGraphicsApi(QSGRendererInterface::Vulkan);
77
\endcode
78
79
\note The \l{qtquick-visualcanvas-adaptations-software.html}{software
80
adaptation} of Qt Quick is not supported for 3D content.
81
82
\section2 OpenGL specifics
83
84
Well written Qt Quick 3D applications are expected to call
85
\l{QQuick3D::idealSurfaceFormat()} in their main() function, and use the
86
returned QSurfaceFormat as the default:
87
88
\code
89
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
90
\endcode
91
92
Calling this has no effect when a graphics API other than OpenGL is used, but is
93
highly beneficial when the API is OpenGL as it will lead to creating an OpenGL
94
context that is best suited for Qt Quick 3D's needs.
95
96
\section2 OpenGL ES 2.0 support
97
98
Qt Quick 3D supports running on OpenGL ES 2.0, but with a significantly limited
99
feature set. The following list contains some of the features that will be
100
unavailable or disfunctional:
101
102
\list
103
\li Image based lighting, light probes, skybox
104
\li Shadow mapping
105
\li Screen space ambient occlusion
106
\li Multisampling
107
\li Certain post-processing effects
108
\li Custom materials that use shaders relying on GLSL features not present in GLSL ES 100
109
\li Order Independent Transparency
110
\endlist
111
112
\note Qt Quick 3D requires OpenGL ES 3.0 / WebGL 2 on the WebAssembly platform.
113
OpenGL ES 2.0 / WebGL 1 is not supported.
114
*/
qtquick3d
src
quick3d
doc
src
qtquick3d-requirements.qdoc
Generated on
for Qt by
1.14.0