Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qssgrenderhelpers.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGRENDERHELPERS_H
5#define QSSGRENDERHELPERS_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QtQuick3D API, with limited compatibility guarantees.
12// Usage of this API may make your code source and binary incompatible with
13// future versions of Qt.
14//
15
16#include <QtQuick3DRuntimeRender/qtquick3druntimerenderglobal.h>
17
18#include <ssg/qssgrenderbasetypes.h>
19
20#include <QtCore/qsize.h>
21
22#include <QtGui/qmatrix4x4.h>
23
25
26class QSSGFrameData;
28class QRhiTexture;
32
33#ifdef Q_QDOC
37#else
41#endif
42
44{
45 Opaque = 0x1,
46 Transparent = 0x2,
48};
49
50Q_DECLARE_FLAGS(QSSGRenderablesFilters, QSSGRenderablesFilter)
51
52class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGModelHelpers
53{
54public:
55 using MaterialList = QList<QSSGResourceId>;
56
57 static void setModelMaterials(const QSSGFrameData &frameData,
58 QSSGRenderablesId renderablesId,
60 MaterialList materials);
61
62 static void setModelMaterials(const QSSGFrameData &frameData,
63 QSSGRenderablesId renderablesId,
64 MaterialList materials);
65
66 [[nodiscard]] static QMatrix4x4 getGlobalTransform(const QSSGFrameData &frameData,
68 QSSGPrepContextId prepId = {});
69
70 [[nodiscard]] static QMatrix4x4 getLocalTransform(const QSSGFrameData &frameData,
72 [[nodiscard]] static float getGlobalOpacity(const QSSGFrameData &frameData,
74 [[nodiscard]] static float getGlobalOpacity(const QSSGFrameData &frameData,
76 QSSGPrepContextId prepId);
77 [[nodiscard]] static float getLocalOpacity(const QSSGFrameData &frameData,
79
80 static void setGlobalTransform(const QSSGFrameData &frameData,
81 QSSGRenderablesId prepId,
83 const QMatrix4x4 &transform);
84
85 static void setGlobalOpacity(const QSSGFrameData &frameData,
86 QSSGRenderablesId renderablesId,
88 float opacity);
89private:
91};
92
93class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGCameraHelpers
94{
95public:
96 static QMatrix4x4 getViewProjectionMatrix(const QSSGCameraId cameraId,
97 const QMatrix4x4 *globalTransform = nullptr);
98
99private:
101};
102
103class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderHelpers
104{
105public:
106 using NodeList = QList<QSSGNodeId>;
107
108 enum class CreateFlag : quint32
109 {
110 None,
111 Recurse = 0x1,
112 Steal = 0x2
113 };
114
115 Q_DECLARE_FLAGS(CreateFlags, CreateFlag)
116
117 [[nodiscard]] static QSSGRenderablesId createRenderables(const QSSGFrameData &frameData,
118 QSSGPrepContextId prepId,
119 const NodeList &nodes,
120 CreateFlags flags = CreateFlag::None);
121
122 [[nodiscard]] static QSSGPrepContextId prepareForRender(const QSSGFrameData &frameData,
123 const QSSGRenderExtension &ext,
124 QSSGCameraId cameraId,
125 quint32 slot = 0);
126
127 [[nodiscard]] static QSSGPrepResultId commit(const QSSGFrameData &frameData,
128 QSSGPrepContextId prepId,
129 QSSGRenderablesId renderablesId,
130 float lodThreshold = 1.0f);
131
132 static void prepareRenderables(const QSSGFrameData &frameData,
133 QSSGPrepResultId prepId,
134 QRhiRenderPassDescriptor *renderPassDescriptor,
136 QSSGRenderablesFilters filter = QSSGRenderablesFilter::All);
137
138 static void renderRenderables(const QSSGFrameData &frameData,
139 QSSGPrepResultId prepId);
140
141
142private:
144};
145
146class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderExtensionHelpers
147{
148public:
149 static void registerRenderResult(const QSSGFrameData &frameData,
152
153private:
155};
156
158
159#endif // QSSGRENDERHELPERS_H
Definition qlist.h:75
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:1142
\inmodule QtGui
Definition qrhi.h:895
\inmodule QtQuick3D
\inmodule QtQuick3D
\inmodule QtQuick3D
\inmodule QtQuick3D
\inmodule QtQuick3D
CreateFlag
\value None The default value.
void extension()
[6]
Definition dialogs.cpp:230
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
@ None
Definition qhash.cpp:531
GLint GLint GLint GLint GLsizei GLsizei GLsizei GLboolean commit
GLbitfield flags
GLenum GLuint texture
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLenum GLenum transform
QSSGExtensionId
QSSGRenderablesFilter
QSSGPrepResultId
QSSGRenderablesId
QSSGPrepContextId
unsigned int quint32
Definition qtypes.h:50
unsigned long long quint64
Definition qtypes.h:61
QSqlQueryModel * model
[16]