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
qssglightmapper_p.h
Go to the documentation of this file.
1
// Copyright (C) 2022 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
QSSGLIGHTMAPPER_P_H
7
#
define
QSSGLIGHTMAPPER_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
<
QtQuick3DRuntimeRender
/
private
/
qtquick3druntimerenderglobal_p
.
h
>
21
#
include
<
rhi
/
qrhi
.
h
>
22
#
include
<
ssg
/
qssglightmapper
.
h
>
23
24
#
include
<
QString
>
25
26
QT_BEGIN_NAMESPACE
27
28
struct
QSSGLightmapperPrivate;
29
struct
QSSGBakedLightingModel
;
30
class
QSSGRhiContext;
31
class
QSSGRenderer
;
32
struct
QSSGRenderModel;
33
class
QOffscreenSurface;
34
35
class
QSSGLightmapper
36
{
37
public
:
38
enum
class
BakingStatus
{
39
None
,
40
Info
,
41
Warning
,
42
Error
,
43
Cancelled
,
44
Failed
,
45
Complete
46
};
47
48
struct
BakingControl
{
49
bool
cancelled
=
false
;
50
};
51
52
/*
53
* Payload:
54
* int status (BakingStatus)
55
* string stage
56
* string message
57
* qint64 totalTimeRemaining (in ms)
58
* double totalProgress (Range 0 - 1)
59
*/
60
typedef
std
::function<
void
(
const
QVariantMap &payload,
BakingControl
*)>
Callback
;
61
62
QSSGLightmapper
();
63
~
QSSGLightmapper
();
64
void
reset
();
65
66
bool
setupLights
(
const
QSSGRenderer
&renderer);
67
void
setOptions
(
const
QSSGLightmapperOptions &options);
68
void
setOutputCallback
(
Callback
callback);
69
qsizetype
add
(
const
QSSGBakedLightingModel
&model);
70
void
setRhiBackend
(QRhi::Implementation backend);
71
void
setDenoiseOnly
(
bool
value);
72
73
// NOTE: since add() contains references to objects in the
74
// running scene we need to call the functions in the following order:
75
// add(), run(), waitForInit().
76
// OpenGL requires a fallback surface created on the main thread to create the
77
// RHI object, so it is provided as a pointer.
78
void
run
(QOffscreenSurface *fallbackSurface);
79
// waitForInit() waits until all models have been processed and are therefore
80
// not referenced anymore and it is safe to go back to rendering the scene.
81
// This should be called after run(), otherwise it will be stuck in a deadlock.
82
void
waitForInit
();
83
84
private
:
85
#
ifdef
QT_QUICK3D_HAS_LIGHTMAPPER
86
QSSGLightmapperPrivate
*
d
=
nullptr
;
87
#
endif
88
bool
bake();
89
bool
denoise();
90
};
91
92
QT_END_NAMESPACE
93
94
#
endif
QSSGLightmapper
Definition
qssglightmapper_p.h:36
QSSGLightmapper::setRhiBackend
void setRhiBackend(QRhi::Implementation backend)
Definition
qssglightmapper.cpp:3370
QSSGLightmapper::setupLights
bool setupLights(const QSSGRenderer &renderer)
Definition
qssglightmapper.cpp:3374
QSSGLightmapper::add
qsizetype add(const QSSGBakedLightingModel &model)
Definition
qssglightmapper.cpp:3365
QSSGLightmapper::reset
void reset()
Definition
qssglightmapper.cpp:3353
QSSGLightmapper::QSSGLightmapper
QSSGLightmapper()
Definition
qssglightmapper.cpp:3345
QSSGLightmapper::setOptions
void setOptions(const QSSGLightmapperOptions &options)
Definition
qssglightmapper.cpp:3357
QSSGLightmapper::Callback
std::function< void(const QVariantMap &payload, BakingControl *)> Callback
Definition
qssglightmapper_p.h:60
QSSGLightmapper::setDenoiseOnly
void setDenoiseOnly(bool value)
Definition
qssglightmapper.cpp:3379
QSSGLightmapper::waitForInit
void waitForInit()
Definition
qssglightmapper.cpp:3388
QSSGLightmapper::BakingStatus
BakingStatus
Definition
qssglightmapper_p.h:38
QSSGLightmapper::BakingStatus::Warning
@ Warning
Definition
qssglightmapper_p.h:41
QSSGLightmapper::BakingStatus::Info
@ Info
Definition
qssglightmapper_p.h:40
QSSGLightmapper::BakingStatus::None
@ None
Definition
qssglightmapper_p.h:39
QSSGLightmapper::BakingStatus::Error
@ Error
Definition
qssglightmapper_p.h:42
QSSGLightmapper::BakingStatus::Cancelled
@ Cancelled
Definition
qssglightmapper_p.h:43
QSSGLightmapper::BakingStatus::Complete
@ Complete
Definition
qssglightmapper_p.h:45
QSSGLightmapper::BakingStatus::Failed
@ Failed
Definition
qssglightmapper_p.h:44
QSSGLightmapper::run
void run(QOffscreenSurface *fallbackSurface)
Definition
qssglightmapper.cpp:3383
QSSGLightmapper::~QSSGLightmapper
~QSSGLightmapper()
Definition
qssglightmapper.cpp:3349
QSSGLightmapper::setOutputCallback
void setOutputCallback(Callback callback)
Definition
qssglightmapper.cpp:3361
QSSGRenderContextInterface::QSSGRenderer
friend class QSSGRenderer
Definition
qssgrendercontextcore.h:81
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QSSGBakedLightingModel
Definition
qssglayerrenderdata_p.h:268
QSSGLightmapper::BakingControl
Definition
qssglightmapper_p.h:48
QSSGLightmapper::BakingControl::cancelled
bool cancelled
Definition
qssglightmapper_p.h:49
qtquick3d
src
runtimerender
rendererimpl
qssglightmapper_p.h
Generated on
for Qt by
1.16.1