1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGLIGHTMAPBAKER_P_H
5#define QSSGLIGHTMAPBAKER_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 <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
19#include <QtQuick3DRuntimeRender/private/qssglightmapper_p.h>
20
21#include <QString>
22
23QT_BEGIN_NAMESPACE
24
25class QSSGLayerRenderData;
26struct QSSGLightmapBakerPrivate;
27
28class QSSGLightmapBaker
29{
30public:
31 enum class Status {
32 Preparing,
33 Running,
34 Baking,
35 Finished
36 };
37
38 struct Context {
39 struct Environment {
40 QSSGRhiContext *rhiCtx = nullptr;
41 QSSGRenderer *renderer = nullptr;
42 QSSGLightmapperOptions lmOptions;
43 } env;
44
45 struct Settings {
46 bool bakeRequested = false;
47 bool denoiseRequested = false;
48 bool quitWhenFinished = false;
49 } settings;
50
51 struct Callbacks {
52 QSSGLightmapper::Callback lightmapBakingOutput;
53 std::function<QVector<QSSGBakedLightingModel>()> modelsToBake;
54 std::function<void(bool)> triggerNewFrame;
55 std::function<void(bool)> setCurrentlyBaking;
56 } callbacks;
57 };
58
59 QSSGLightmapBaker(const Context &ctx);
60 ~QSSGLightmapBaker();
61
62 Status process();
63
64private:
65#ifdef QT_QUICK3D_HAS_LIGHTMAPPER
66 QSSGLightmapBakerPrivate *d;
67#endif
68};
69
70QT_END_NAMESPACE
71
72#endif
73

source code of qtquick3d/src/runtimerender/rendererimpl/qssglightmapbaker_p.h