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
qquick3dlightmapbaker_p.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// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DLIGHTMAPBAKER_P_H
7#define QQUICK3DLIGHTMAPBAKER_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/qtquick3dglobal.h>
21#include <QtQuick/private/qquickview_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QQuick3DViewport;
26
27class Q_QUICK3D_EXPORT QQuick3DLightmapBaker : public QObject
28{
29 Q_OBJECT
30public:
31 enum class BakingStatus {
32 None,
33 Info,
34 Warning,
35 Error,
36 Cancelled,
37 Failed,
38 Complete
39 };
40
41 struct BakingControl {
42 void reset();
43 void requestCancel();
44 bool isCancelled() const;
45
46 private:
47 bool cancelFlag = false;
48 };
49
50 typedef std::function<void(const QVariantMap &, BakingControl*)> Callback;
51
52 explicit QQuick3DLightmapBaker(QQuick3DViewport *view);
53 ~QQuick3DLightmapBaker();
54
55 void bake(Callback callback);
56 void bake();
57
58 void denoise(Callback callback);
59 void denoise();
60
61private slots:
62 void onLmCancelButtonClicked();
63 void onLmWindowClosing(QQuickCloseEvent *event);
64
65private:
66 void updateView();
67
68 bool m_bakingRequested = false;
69 bool m_denoisingRequested = false;
70 bool m_currentlyBaking = false;
71 BakingControl *m_bakingControl = nullptr;
72 QQuick3DViewport *m_view = nullptr;
73 Callback m_callback;
74
75 // For the internal status/control provided by the default impl through DebugView
76 QQuickView *m_lmWindow = nullptr;
77 bool m_windowCancelRequested = false;
78
79 friend class QQuick3DSceneRenderer;
80};
81
83
84
85#endif // QQUICK3DLIGHTMAPBAKER_P_H
86 ;
\inmodule QtSql
Combined button and popup list for selecting options.
static QByteArray prepareCustomShader(QSSGRenderCustomMaterial *customMaterial, const QSSGShaderCustomMaterialAdapter::StringPairList &uniforms, const QByteArray &snippet, QSSGShaderCache::ShaderType shaderType, QSSGCustomShaderMetaData &meta, bool multiViewCompatible)
static QT_BEGIN_NAMESPACE QRhiGraphicsPipeline::BlendFactor toRhiBlendFactor(QQuick3DCustomMaterial::BlendMode mode)
\qmlproperty url CustomMaterial::vertexShader
static void setCustomMaterialFlagsFromShader(QSSGRenderCustomMaterial *material, const QSSGCustomShaderMetaData &meta)