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