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