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
qquick3ddirectionallight_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGDIRECTIONALLIGHT_H
5#define QSSGDIRECTIONALLIGHT_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/private/qquick3dabstractlight_p.h>
19
20#include <QColor>
21
23
24class Q_QUICK3D_EXPORT QQuick3DDirectionalLight : public QQuick3DAbstractLight
25{
26 Q_OBJECT
27
28 QML_NAMED_ELEMENT(DirectionalLight)
29
30 Q_PROPERTY(float csmSplit1 READ csmSplit1 WRITE setCsmSplit1 NOTIFY csmSplit1Changed FINAL REVISION(6, 8))
31 Q_PROPERTY(float csmSplit2 READ csmSplit2 WRITE setCsmSplit2 NOTIFY csmSplit2Changed FINAL REVISION(6, 8))
32 Q_PROPERTY(float csmSplit3 READ csmSplit3 WRITE setCsmSplit3 NOTIFY csmSplit3Changed FINAL REVISION(6, 8))
33 Q_PROPERTY(int csmNumSplits READ csmNumSplits WRITE setCsmNumSplits NOTIFY csmNumSplitsChanged FINAL REVISION(6, 8))
34 Q_PROPERTY(float csmBlendRatio READ csmBlendRatio WRITE setCsmBlendRatio NOTIFY csmBlendRatioChanged FINAL REVISION(6, 8))
35 Q_PROPERTY(bool lockShadowmapTexels READ lockShadowmapTexels WRITE setLockShadowmapTexels NOTIFY
36 lockShadowmapTexelsChanged FINAL REVISION(6, 9))
37
38public:
39 explicit QQuick3DDirectionalLight(QQuick3DNode *parent = nullptr);
40 ~QQuick3DDirectionalLight() override {}
41
42 Q_REVISION(6, 8) float csmSplit1() const;
43 Q_REVISION(6, 8) float csmSplit2() const;
44 Q_REVISION(6, 8) float csmSplit3() const;
45 Q_REVISION(6, 8) int csmNumSplits() const;
46 Q_REVISION(6, 8) float csmBlendRatio() const;
47 Q_REVISION(6, 9) bool lockShadowmapTexels() const;
48
49 Q_REVISION(6, 8) void setCsmSplit1(float newcsmSplit1);
50 Q_REVISION(6, 8) void setCsmSplit2(float newcsmSplit2);
51 Q_REVISION(6, 8) void setCsmSplit3(float newcsmSplit3);
52 Q_REVISION(6, 8) void setCsmNumSplits(int newcsmNumSplits);
53 Q_REVISION(6, 8) void setCsmBlendRatio(float newcsmBlendRatio);
54 Q_REVISION(6, 9) void setLockShadowmapTexels(bool newLockShadowmapTexels);
55
56Q_SIGNALS:
57 Q_REVISION(6, 8) void csmSplit1Changed();
58 Q_REVISION(6, 8) void csmSplit2Changed();
59 Q_REVISION(6, 8) void csmSplit3Changed();
60 Q_REVISION(6, 8) void csmNumSplitsChanged();
61 Q_REVISION(6, 8) void csmBlendRatioChanged();
62 Q_REVISION(6, 9) void lockShadowmapTexelsChanged();
63
64protected:
65 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
66
67private:
68 float m_csmSplit1 = 0.1f;
69 float m_csmSplit2 = 0.25f;
70 float m_csmSplit3 = 0.5f;
71 int m_csmNumSplits = 0;
72 float m_csmBlendRatio = 0.05f;
73 bool m_lockShadowmapTexels = false;
74};
75
76QT_END_NAMESPACE
77#endif // QSSGDIRECTIONALLIGHT_H