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
qquick3dlightmapper_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 QQUICK3DLIGHTMAPPER_P_H
7#define QQUICK3DLIGHTMAPPER_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/private/qquick3dnode_p.h>
21
23
25{
26 Q_OBJECT
27 Q_PROPERTY(float opacityThreshold READ opacityThreshold WRITE setOpacityThreshold NOTIFY opacityThresholdChanged)
28 Q_PROPERTY(float bias READ bias WRITE setBias NOTIFY biasChanged)
29 Q_PROPERTY(bool adaptiveBiasEnabled READ isAdaptiveBiasEnabled WRITE setAdaptiveBiasEnabled NOTIFY adaptiveBiasEnabledChanged)
30 Q_PROPERTY(bool indirectLightEnabled READ isIndirectLightEnabled WRITE setIndirectLightEnabled NOTIFY indirectLightEnabledChanged)
31 Q_PROPERTY(int samples READ samples WRITE setSamples NOTIFY samplesChanged)
32 Q_PROPERTY(int indirectLightWorkgroupSize READ indirectLightWorkgroupSize WRITE setIndirectLightWorkgroupSize NOTIFY indirectLightWorkgroupSizeChanged)
33 Q_PROPERTY(int bounces READ bounces WRITE setBounces NOTIFY bouncesChanged)
34 Q_PROPERTY(float indirectLightFactor READ indirectLightFactor WRITE setIndirectLightFactor NOTIFY indirectLightFactorChanged)
35 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged FINAL REVISION(6, 10))
36 Q_PROPERTY(float denoiseSigma READ denoiseSigma WRITE setDenoiseSigma NOTIFY denoiseSigmaChanged FINAL REVISION(6, 10))
37 Q_PROPERTY(float texelsPerUnit READ texelsPerUnit WRITE setTexelsPerUnit NOTIFY texelsPerUnitChanged FINAL REVISION(6, 10))
38
39 QML_NAMED_ELEMENT(Lightmapper)
40
41public:
42 float opacityThreshold() const;
43 float bias() const;
44 bool isAdaptiveBiasEnabled() const;
45 bool isIndirectLightEnabled() const;
46 int samples() const;
47 int indirectLightWorkgroupSize() const;
48 int bounces() const;
49 float indirectLightFactor() const;
50 Q_REVISION(6, 10) QUrl source() const;
51 Q_REVISION(6, 10) float denoiseSigma() const;
52 Q_REVISION(6, 10) float texelsPerUnit() const;
53
54public Q_SLOTS:
55 void setOpacityThreshold(float opacity);
56 void setBias(float bias);
57 void setAdaptiveBiasEnabled(bool enabled);
58 void setIndirectLightEnabled(bool enabled);
59 void setSamples(int count);
60 void setIndirectLightWorkgroupSize(int size);
61 void setBounces(int count);
62 void setIndirectLightFactor(float factor);
63 Q_REVISION(6, 10) void setSource(const QUrl &source);
64 Q_REVISION(6, 10) void setDenoiseSigma(float newDenoiseSigma);
65 Q_REVISION(6, 10) void setTexelsPerUnit(float newTexelsPerUnit);
66
67Q_SIGNALS:
68 void changed();
69 void opacityThresholdChanged();
70 void biasChanged();
71 void adaptiveBiasEnabledChanged();
72 void indirectLightEnabledChanged();
73 void samplesChanged();
74 void indirectLightWorkgroupSizeChanged();
75 void bouncesChanged();
76 void indirectLightFactorChanged();
77 Q_REVISION(6, 10) void sourceChanged();
78 Q_REVISION(6, 10) void denoiseSigmaChanged();
79 Q_REVISION(6, 10) void texelsPerUnitChanged();
80
81private:
82 // keep the defaults in sync with the default values in QSSGLightmapperOptions
83 float m_opacityThreshold = 0.5f;
84 float m_bias = 0.005f;
85 bool m_adaptiveBias = true;
86 bool m_indirectLight = true;
87 int m_samples = 256;
88 int m_workgroupSize = 32;
89 int m_bounces = 3;
90 float m_indirectFactor = 1.0f;
91 QUrl m_source = QUrl::fromLocalFile(QStringLiteral("lightmaps.bin"));
92 float m_denoiseSigma = 8.f;
93 float m_texelsPerUnit = 1.f;
94};
95
96QT_END_NAMESPACE
97
98#endif // QQUICK3DLIGHTMAPPER_P_H
Combined button and popup list for selecting options.